/* ════════════════════════════════════════════════════════════════
   MODA FINDS — Catalog page styles (builds on customer-theme.css,
   which defines the shared .wrap page-width utility)
════════════════════════════════════════════════════════════════ */

/* ── hero: single full-width banner image ───────────────────
   The banner itself (assets/images/modafinds-hero-banner.jpg) already has
   the logo, headline, subtitle and feature icons composed into the
   graphic, so there's no separate text overlay here — just the image,
   shown at its natural aspect ratio (never cropped) so nothing baked into
   it is ever cut off. */
.catalog-hero {
    line-height: 0;
    border-bottom: 1px solid var(--border);
}
.hero-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── category strip ─────────────────────────────────────── */
.category-strip {
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.category-strip .wrap {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 14px;
    padding-bottom: 14px;
    scrollbar-width: none;
}
.category-strip .wrap::-webkit-scrollbar { display: none; }
.cat-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px 8px 10px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s;
}
.cat-pill i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-cream);
    font-size: 1rem;
    color: var(--accent);
    transition: background .15s, color .15s;
}
.cat-pill:hover { color: var(--primary); }
.cat-pill.active {
    color: var(--primary-dark);
    border-color: var(--primary-light);
    background: var(--primary-light);
}
.cat-pill.active i { background: var(--primary); color: #fff; }

/* ── main layout: sidebar + grid ────────────────────────── */
.catalog-main { padding: 28px 0 72px; }
.catalog-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}
@media (max-width: 991px) {
    .catalog-layout { grid-template-columns: 1fr; }
}

/* .filter-scrim is a sibling of .filter-sidebar inside .catalog-layout
   (a grid with exactly 2 explicit columns) purely so it's easy to toggle
   independently of the drawer. It must stay out of grid-item flow at every
   width it isn't actively acting as a backdrop — an unstyled static <div>
   left in flow would auto-place into column 2 of row 1 and bump the real
   content (.catalog-content) into a second grid row, narrow column 1. Only
   the mobile drawer media query re-enables it, with position:fixed, which
   also takes it out of flow on its own. */
.filter-scrim { display: none; }

/* ── sidebar filters ─────────────────────────────────────── */
.filter-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 86px;
}
.filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.filter-sidebar-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .92rem; }
.filter-sidebar-title i { color: var(--accent); }
.filter-sidebar-header-actions { display: flex; align-items: center; gap: 14px; }
.filter-drawer-close { display: none; background: none; border: none; font-size: 1.1rem; color: var(--text-muted); cursor: pointer; }
.filter-block { margin-bottom: 22px; }
.filter-block:last-of-type { margin-bottom: 16px; }
.filter-block-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 10px;
}
.filter-block-label i { color: var(--accent); }
.filter-control {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 9px 11px;
    font-family: var(--font-body);
    font-size: .84rem;
    color: var(--text);
    background: #fff;
    outline: none;
    min-width: 0;
    transition: border-color .2s, box-shadow .2s;
}
.filter-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(214,59,122,.12); }
input[type="date"].filter-control {
    -webkit-appearance: none;
    appearance: none;
    min-height: 38px;
    overflow: hidden;
    line-height: 1.4;
}
select.filter-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B6B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
/* minmax(0, 1fr), not plain 1fr: a bare 1fr track still sizes to its
   content's min-content width, and a native date input's intrinsic
   min-content (mm/dd/yyyy segments + calendar icon) is wider than half the
   260px sidebar — the track would grow to fit it and push the Return
   field past the sidebar's edge. minmax(0, 1fr) lets the track (and the
   input's own min-width:0 below) actually shrink to the allotted space. */
.filter-date-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.filter-date-row label {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.price-range-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.price-range-row .filter-control { padding-left: 10px; }

.swatch-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.color-chip {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    outline: 1.5px solid var(--border);
    outline-offset: 1px;
    padding: 0;
    cursor: pointer;
    background-color: #ccc; /* fallback if the color name isn't a valid CSS keyword */
    transition: outline-color .15s, transform .1s;
}
.color-chip:hover { outline-color: var(--primary); }
.color-chip.active { outline-color: var(--primary); outline-width: 2px; transform: scale(1.08); }
.color-chip.active::after {
    content: '\f26e';
    font-family: 'bootstrap-icons';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    color: #fff;
    text-shadow: 0 0 2px rgba(0,0,0,.65);
}

.filter-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
/* ── top bar: count / chips / sort ──────────────────────── */
.results-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.results-count { font-size: .86rem; color: var(--text-muted); }
.results-count strong { color: var(--text); font-weight: 700; }
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.topbar-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px;
}
.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .95rem;
    transition: background .15s, color .15s;
}
.view-toggle-btn.active { background: var(--primary); color: #fff; }
@media (max-width: 767px) { .view-toggle { display: none; } }
.sort-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 32px 8px 16px;
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    color: var(--text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231F1F1F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
}
/* Below 768px the three topbar items (count / chips / sort) no longer have
   room to share one row — flex-wrap lets them wrap, but .active-chips'
   flex:1 basis keeps pulling them back onto one cramped line instead of
   actually breaking, so the sort <select> ends up squeezed and clipped. */
@media (max-width: 767px) {
    .results-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .active-chips { order: 2; flex: initial; }
    .topbar-controls { order: 3; width: 100%; }
    .sort-select { flex: 1; width: 100%; }
}

/* ── product grid ────────────────────────────────────────── */
.gowns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
@media (min-width: 1200px) { .gowns-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) { .gowns-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

/* list view: one row per gown, photo on the left */
.gowns-grid.list-view { grid-template-columns: 1fr; gap: 14px; }
.gowns-grid.list-view .gown-card { display: flex; flex-direction: row; }
.gowns-grid.list-view .gown-photo-wrap { width: 160px; flex-shrink: 0; aspect-ratio: 3 / 4; }
.gowns-grid.list-view .gown-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.gowns-grid.list-view .gown-view-btn { width: auto; align-self: flex-start; margin-top: 12px; padding: 8px 20px; }
@media (max-width: 575px) {
    .gowns-grid.list-view .gown-card { flex-direction: column; }
    .gowns-grid.list-view .gown-photo-wrap { width: 100%; }
}

/* Flex column, stretched to the grid row's full height (CSS Grid's default
   align-items:stretch) — so the "View Details" button below lands at the
   same vertical position on every card in a row, regardless of how much
   the name/tags/price text above it varies in length. */
.gown-card-link { text-decoration: none; color: inherit; display: flex; height: 100%; }
.gown-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow .25s, transform .25s;
}
.gown-card-link:hover .gown-card { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.gown-photo-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: linear-gradient(150deg, var(--primary-light) 0%, #fff 100%);
}
.gown-photo { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }
.gown-card-link:hover .gown-photo { transform: scale(1.06); }
.gown-no-photo {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); font-size: 2.8rem; opacity: .4;
}
.gown-avail-badge {
    position: absolute; top: 10px; right: 10px;
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}
.badge-avail  { background: rgba(232,245,233,.95); color: var(--avail-fg);  border: 1px solid var(--avail-border); }
.badge-booked { background: rgba(239,239,239,.95); color: var(--booked-fg); border: 1px solid var(--booked-border); }

.card-save-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(4px);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    transition: background .15s, color .15s, transform .1s;
}
.card-save-btn:hover { background: #fff; transform: scale(1.06); }
.card-save-btn.is-saved { background: var(--primary); color: #fff; }

.gown-info { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.gown-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gown-category { font-size: .72rem; color: var(--text-muted); margin-bottom: 8px; }
.gown-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.gown-tag {
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 8px;
    font-size: .68rem;
    color: var(--text-muted);
    font-weight: 600;
}
.branch-tag {
    background: var(--accent-light);
    border: 1px solid #E3CB9C;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: .68rem;
    color: #8A651F;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.gown-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.price-amount { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.price-unit { font-size: .68rem; color: var(--text-muted); }
.price-buy-sep { margin: 0 1px; }
.price-buy { font-size: .84rem; font-weight: 700; color: var(--text); }
.gown-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: auto;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-size: .78rem;
    font-weight: 700;
    padding: 8px;
    transition: background .15s, color .15s;
}
.gown-card-link:hover .gown-view-btn { background: var(--primary); color: #fff; }

/* ── skeleton ────────────────────────────────────────────── */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton { background: linear-gradient(90deg, #F2ECE9 25%, #E7DEDA 50%, #F2ECE9 75%); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: 6px; }
.skeleton-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.skeleton-photo { aspect-ratio: 3 / 4; }
.skeleton-body { padding: 14px 16px 16px; }
.skeleton-line { height: 11px; margin-bottom: 9px; }

/* ── empty / error state ─────────────────────────────────── */
.state-box { grid-column: 1 / -1; text-align: center; padding: 72px 20px; }
.state-icon { font-size: 2.6rem; color: var(--accent); margin-bottom: 16px; display: block; }
.state-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.state-desc { font-size: .88rem; color: var(--text-muted); max-width: 360px; margin: 0 auto 18px; line-height: 1.6; }

/* ── load more ───────────────────────────────────────────── */
.load-more-row { text-align: center; margin-top: 36px; }

/* ── mobile floating "Filter & Sort" button ─────────────────
   Fixed (not sticky): it needs to float above content at a constant
   viewport offset throughout the whole scroll, not just pin near the end
   of .catalog-content's scroll range the way a top-anchored sticky element
   would. */
.mobile-filter-bar { display: none; }
@media (max-width: 991px) {
    .mobile-filter-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(78px + env(safe-area-inset-bottom));
        z-index: 150;
        justify-content: center;
        pointer-events: none;
    }
    .mobile-filter-btn {
        pointer-events: auto;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: var(--text);
        color: #fff;
        border: none;
        border-radius: var(--radius-pill);
        padding: 12px 24px;
        font-size: .84rem;
        font-weight: 700;
        box-shadow: 0 6px 20px rgba(0,0,0,.22);
        cursor: pointer;
    }
    .mobile-filter-btn .count-dot {
        background: var(--primary);
        color: #fff;
        border-radius: 50%;
        width: 18px; height: 18px;
        font-size: .66rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
/* Tablet width (768–991px) has no bottom tab bar, so the floating button
   sits lower, flush with the viewport edge like on desktop. */
@media (min-width: 768px) and (max-width: 991px) {
    .mobile-filter-bar { bottom: 18px; }
}
@media (max-width: 991px) {
    /* sidebar becomes a slide-in drawer */
    .filter-sidebar {
        position: fixed;
        inset: 0;
        top: auto;
        z-index: 1000;
        max-height: 88vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        opacity: 0;
        visibility: hidden;
        overflow-y: auto;
        /* overflow-y:auto can add a scrollbar that eats into the base 20px
           right padding (visible with classic/non-overlay scrollbars) —
           a bit of extra padding on both sides keeps content clear of it
           and balanced either way. */
        padding-left: 24px;
        padding-right: 28px;
        transition: transform .28s ease, opacity .28s ease, visibility 0s linear .28s;
    }
    .filter-sidebar.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        transition: transform .28s ease, opacity .28s ease, visibility 0s linear 0s;
    }
    .filter-sidebar-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
        margin: -20px -28px 32px -24px;
        padding: 16px 24px 14px 20px;
    }
    .filter-sidebar-header-actions { gap: 20px; }
    .filter-drawer-close { display: inline-flex; align-items: center; }
    .filter-sidebar-footer {
        position: sticky;
        bottom: -1px;
        background: #fff;
        margin: 10px -28px -20px -24px;
        padding: 24px 28px 14px 24px;
    }
    .filter-scrim {
        display: block;
        position: fixed; inset: 0; z-index: 999;
        background: rgba(0,0,0,.45);
        opacity: 0; visibility: hidden;
        transition: opacity .28s ease, visibility 0s linear .28s;
    }
    .filter-scrim.is-open { opacity: 1; visibility: visible; transition: opacity .28s ease, visibility 0s linear 0s; }
}

/* ── FAQ (Bootstrap 5 accordion, re-themed) ─────────────────── */
.faq-section { background: var(--bg-cream); padding: 56px 0; }
.faq-heading { text-align: center; margin-bottom: 28px; }
.faq-heading h2 {
    font-family: var(--font-script);
    font-weight: 400;
    font-size: clamp(2rem, 4.4vw, 2.8rem);
}
.faq-accordion { max-width: 820px; margin: 0 auto; }
.faq-accordion .accordion-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius) !important;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-accordion .accordion-button {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .92rem;
    color: var(--text);
    background: #fff;
    padding: 16px 20px;
    box-shadow: none !important;
}
.faq-accordion .accordion-button:focus { box-shadow: 0 0 0 3px rgba(214,59,122,.15) !important; }
.faq-accordion .accordion-button:not(.collapsed) {
    color: var(--primary-dark);
    background: var(--primary-light);
}
.faq-accordion .accordion-button::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23B32E63' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.faq-accordion .accordion-body {
    font-size: .86rem;
    color: var(--text-muted);
    line-height: 1.7;
    padding: 4px 20px 18px;
}
.faq-contact-note { text-align: center; margin-top: 24px; font-size: .86rem; color: var(--text-muted); }
.faq-contact-note a { color: var(--primary); font-weight: 700; text-decoration: none; }
.faq-contact-note a:hover { text-decoration: underline; }
@media (max-width: 767px) {
    .faq-section { padding: 40px 0; }
    .faq-accordion .accordion-button { font-size: .86rem; padding: 14px 16px; }
    .faq-accordion .accordion-body { padding: 4px 16px 16px; }
}
