/* Shifman Collections Styles */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 150px;
}

#collections {
    background-color: #fff;
}

.shifman-collections-banner {
    position: relative;
    height: 100vh;
    width: 100%;
    /* Background from your array index 0 */
    background-image: url('https://shifmanmattresses.com/wp-content/uploads/2025/07/1500x983-Afternoonified-1893_1_filmic.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    overflow: hidden;
}

/* Subtle overlay to ensure white text readability */
.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
    z-index: 1;
}

.banner-inner {
    position: relative;
    z-index: 2;
    max-width: 1400px; /* Matching your header's nav-container */
    margin: 0 auto;
    width: 100%;
    height: 100%;
    padding: 140px 20px 100px; /* Top padding allows fixed header clearance */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end; /* Right-aligns all content */
}

/* Mission Text Styling */
.mission-text {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.8;
    text-align: right;
    letter-spacing: 0.05em;
    font-family: 'Montserrat';
    font-weight: 400;
    max-width: 380px;
    margin: 0;
}

/* Bottom Title and Button Group */
.title-cta-group {
    text-align: right;
}

.main-title {
    color: #ffffff;
    font-size: clamp(42px, 6vw, 60px); /* Fluid typography */
    text-transform: uppercase;
    letter-spacing: 4px;
    line-height: 1.1;
    margin-bottom: 40px;
    font-family: 'Playfair Display';
    font-weight: 600;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.15);
}

.btn-luxury {
    display: inline-block;
    padding: 18px 50px;
    border: 1px solid #ffffff;
    background-color: #ffffff;
    color: #1a1a1a;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Montserrat';
    font-size: 11px;
    letter-spacing: 0.2em; /* Matching header.css letter-spacing */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Mobile Layout */
@media (max-width: 1024px) {
    .banner-inner {
        align-items: center; /* Center-align for mobile devices */
        text-align: center;
    }
    .mission-text, .title-cta-group {
        text-align: center;
    }
    .main-title {
        font-size: 38px;
    }

    .desktop-only-desc {
        display: none; /* Cleaner mobile look as requested */
    }
}

/* Grid Layout */
.collection-grid-container {
    margin-top: 20px;
}

.sub-collection-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* This centers 1, 2, or 3 items */
    gap: 20px 10px; /* Consistent spacing between cards */
    margin: 0 auto;
    padding-bottom: 20px;
}

@media (max-width: 1024px) {
    .sub-collection-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Card Styling */
.collection-card {
    flex: 1 1 300px; /* Grow, shrink, and start at 300px */
    max-width: 380px; /* Prevents cards from getting too wide when there's only 1 */
    min-width: 280px;
    text-decoration: none !important;
    transition: all 0.4s ease;
}

.card-image-wrap {
    aspect-ratio: 3 / 4; /* Vertical portrait for elegance */
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.collection-card:hover .card-image-wrap img {
    transform: scale(1.05);
}

.card-content {
    padding-left: 10px;
}

.card-content h3 {
    font-family: 'Playfair Display';
    font-weight: 500;
    font-size: 22px;
    color: #4a403d;
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    font-style: italic;
}

.card-link {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #B8A686; /* Muted Gold */
    border-bottom: 1px solid #B8A686;
    padding-bottom: 4px;
}

@media (max-width: 768px) {
    .sub-collection-grid {
        gap: 10px; /* Tighter gaps for mobile screens */
        padding: 26px 10px;
    }

    .collection-card {
        /* Force exactly 2 per row by calculating 50% minus the gap */
        flex: 0 1 calc(50% - 10px); 
        min-width: 0; /* Allow it to shrink below the desktop min-width */
        max-width: none;
    }

    /* Adjust typography for the smaller mobile cards */
    .collection-card h3 {
        font-size: 1.1rem;
        margin-top: 10px;
    }

    /* The "Lone Card" Rule: 
       If the last card is an odd number (1st, 3rd, 5th...), 
       it means it's alone on its row. Make it 100%. */
    .collection-card:last-child:nth-child(odd) {
        flex: 0 1 100%;
        max-width: 100%;
    }

    /* Optional: If it's full width, you might want to 
       center the text for a more "featured" look */
    .collection-card:last-child:nth-child(odd) .card-content {
        text-align: center;
    }
    
    .card-subtitle {
        font-size: 0.85rem;
    }

    .shifman-hero {
        padding: 150px 0 60px 25px;
    }

    .mrs-eaves {
        line-height: 1.1;
    }
}