/* General Body and Container Styling */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.container {
    padding-top: 40px;
    padding-bottom: 40px;
}
.content-spacer {
    padding-top: 40px;
    padding-bottom: 20px;
}
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #343a40;
    font-weight: 600;
}
/* filter bar & search field styling */
.filter-bar {
    margin: 0 auto 40px auto;
    padding: 25px;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 1200px; /* Aligns with the width of the stock grid */
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

/* Group styling for inputs and selects */
.search-group, .filter-group {
    flex: 1;
    min-width: 250px;
}

.search-group input, 
.filter-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d4af37; /* Sourcing Agent Gold */
    border-radius: 4px;
    font-size: 0.95rem;
    color: #343a40;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.search-group input:focus, 
.filter-group select:focus {
    border-color: #b8962d;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Button Styling matching the "Quiet Luxury" feel */
.btn-filter {
    padding: 12px 28px;
    background-color: #343a40; /* Dark Charcoal/Sapphire base */
    color: #ffffff;
    border: 1px solid #343a40;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-filter:hover {
    background-color: #d4af37;
    border-color: #d4af37;
    color: #ffffff;
}

/* Reset Link */
.clear-filters {
    font-size: 0.85rem;
    color: #6c757d;
    text-decoration: none;
    margin-left: 10px;
    transition: color 0.2s ease;
}

.clear-filters:hover {
    color: #d4af37;
    text-decoration: underline;
}

/* Responsive adjustments for Mobile */
@media (max-width: 768px) {
    .filter-bar {
        padding: 15px;
        margin: 0 15px 30px 15px;
    }
    
    .search-group, .filter-group {
        min-width: 100%; /* Stack on small screens */
    }
    
    .btn-filter {
        width: 100%;
    }
}
/* end filter bar & search field styling */

/* Stock Grid Layout */
.stock-grid {
    display: grid;
    gap: 20px;
    /* This makes the grid responsive by default: auto-fill columns, each min 280px wide */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding: 0 15px;
}
/* Stock Card Styling */
.stock-card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    padding: 15px;
}
.stock-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.stock-image-wrapper {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px;
}
.stock-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
    transition: filter 0.3s ease;
}
.stock-card h3 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
}
.stock-card p {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #6c757d;
}
.stock-card .badge {
    font-size: 0.85em;
    padding: 0.4em 0.8em;
    border-radius: 0.25rem;
    font-weight: 500;
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #6c757d;
    color: #fff;
}
.stock-card .btn-view-details {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #17a2b8; /* A color consistent with the 'info' button style */
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}
.stock-card .btn-view-details:hover {
    background-color: #138496;
}
.stock-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 15px;
}
.stock-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0;
    transition: filter 0.3s ease;
}
.sold-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(220, 53, 69, 0.4); /* Red with 30% opacity */
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    z-index: 2;
    letter-spacing: 2px;
    transform: rotate(-10deg); /* Tilt effect */
    border-radius: 4px;
    padding:10px;
}
.stock-card:has(.sold-out-overlay) img {
    filter: brightness(50%) grayscale(50%);
}
.stock-card h3 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
}
.stock-card p {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #6c757d;
}
.stock-card p:last-of-type {
    font-weight: 600;
    color: var(--color-sapphire-blue, #004D99);
    margin-bottom: 0;
    font-size: 1.2rem;
}
.stock-card .badge {
    display: none;
}
.stock-card .btn-view-details {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #17a2b8;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}
.stock-card .btn-view-details:hover {
    background-color: #138496;
}
/* Custom Order CTA Section Styling */
.custom-order-cta {
    padding: 40px 20px;
    background-color: var(--color-secondary-light, #EEEEEE);
    border-radius: 8px;
    margin-top: 40px;
}
.custom-order-cta h2 {
    color: var(--color-sapphire-blue, #004D99);
    margin-bottom: 10px;
    font-size: 2rem;
}
.custom-order-cta p {
    margin-bottom: 20px;
    color: var(--color-text-fade-dark, #555555);
}

/* --- RESPONSIVENESS MEDIA QUERIES --- */
/* Tablet and smaller desktop adjustments */
@media (max-width: 992px) {
    .stock-grid {
        gap: 15px; 
    }
}
/* Mobile/Small Tablet Adjustments */
@media (max-width: 768px) {
    .content-spacer {
        padding-top: 20px;
        padding-bottom: 10px;
    }
    h1 {
        font-size: 2em; /* Smaller heading */
        margin-bottom: 20px;
    }
    .stock-grid {
        /* Reduce min width slightly to allow 3 columns on narrow tablets if needed */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 10px; 
        padding: 0 10px;
    }
    .stock-card {
        padding: 10px;
    }
    .stock-card img {
        height: 180px; /* Shorter image height */
    }
}

/* Small Phone Adjustments (Force single column) */
@media (max-width: 480px) {
    /* Main container padding adjustment */
    .container {
        padding: 20px 0;
    }
    .content-spacer {
        padding-top: 10px;
    }
    h1 {
        font-size: 1.8em;
    }
    .stock-grid {
        /* Force single column layout */
        grid-template-columns: 1fr;
        padding: 0 15px; /* Add horizontal padding to the grid wrapper */
        gap: 30px; /* Increase gap for vertical separation */
    }
    .stock-card {
        max-width: none; 
        padding: 15px;
    }
    .stock-card img {
        height: 250px; /* Make image taller for better view in single column */
    }
    .stock-card h3 {
        font-size: 1.3rem;
    }
    .stock-card p {
        font-size: 1rem;
    }
    .sold-out-overlay {
        font-size: 1.3rem;
        transform: rotate(-3deg);
    }
    
    /* CTA section responsiveness */
    .custom-order-cta {
        padding: 30px 15px;
        margin-top: 30px;
    }
    .custom-order-cta h2 {
        font-size: 1.4em;
    }
    .custom-order-cta p {
        font-size: 0.9em;
    }
}