/* Storefront navigation, search, and listing filters. Loaded after app.css. */

.shop-header { position: sticky; top: 0; z-index: 30; }
.masthead {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "menu logo cart" "search search search";
    align-items: center;
    gap: 0.55rem 0.75rem;
    padding: 0.6rem 0 0.7rem;
}
.masthead .logo { grid-area: logo; justify-self: center; }
.masthead .logo img { width: min(210px, 52vw); }
.menu-toggle {
    grid-area: menu;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.4rem 0.2rem;
    background: none;
    border: 0;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.menu-icon { display: grid; gap: 4px; width: 22px; }
.menu-icon span { display: block; height: 2px; background: currentColor; border-radius: 1px; }
.menu-word { display: none; }
.masthead .cart-link {
    grid-area: cart;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.2rem;
    min-height: 44px;
    color: var(--navy);
}
.masthead .cart-link > span:first-of-type { display: none; }
.cart-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 99px;
    background: var(--navy);
    color: var(--cream);
    font-size: 0.72rem;
    letter-spacing: 0;
}

.site-search { grid-area: search; position: relative; display: flex; min-width: 0; }
.site-search input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #d6c8b2;
    border-right: 0;
    background: var(--card);
    padding: 0.5rem 0.8rem;
    border-radius: 2px 0 0 2px;
    font-size: 1rem;
}
.site-search input::placeholder { color: #8a8174; }
.site-search button {
    min-height: 44px;
    width: 48px;
    padding: 0;
    border-radius: 0 2px 2px 0;
    flex: 0 0 auto;
}
.suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: min(70vh, 34rem);
    overflow: auto;
}
.suggest-label {
    margin: 0;
    padding: 0.55rem 0.8rem 0.25rem;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
}
.suggest a {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.45rem 0.8rem;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.25;
}
.suggest a.plain-row { grid-template-columns: 1fr auto; }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--cream); }
.suggest img, .suggest .thumb-fallback { width: 44px; height: 44px; object-fit: contain; background: var(--cream); }
.suggest .thumb-fallback { display: grid; place-items: center; font-family: var(--serif); color: var(--navy); }
.suggest small { color: var(--muted); display: block; font-size: 0.8rem; }
.suggest .suggest-price { font-weight: 600; white-space: nowrap; }
.suggest .suggest-all { display: block; padding: 0.65rem 0.8rem; border-top: 1px solid var(--line); font-weight: 600; color: var(--navy); }

/* Desktop category bar with dropdowns */
.shop-nav { display: none; background: var(--navy); }
.shop-nav-list { list-style: none; margin: 0 auto; padding: 0; display: flex; align-items: stretch; }
.shop-nav-list > li { position: relative; }
.shop-nav-list > li > a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0.75rem 0.9rem;
    color: var(--cream);
    text-decoration: none;
    font-size: 0.97rem;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.shop-nav-list > li > a:hover,
.shop-nav-list > li:focus-within > a,
.shop-nav-list > li > a[aria-current] { border-bottom-color: var(--gold-2); color: #fff; }
.shop-nav-list > li:first-child > a { padding-left: 0; }
.util-links { display: none; grid-area: util; gap: 1.1rem; }
.util-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.util-links a:hover, .util-links a[aria-current] { color: var(--navy); text-decoration: underline; }
.mega {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 35;
    min-width: 19rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 2px solid var(--gold-2);
    box-shadow: var(--shadow);
}
.has-menu:hover > .mega,
.has-menu:focus-within > .mega,
.has-menu.open > .mega { display: block; }
.has-menu.closed > .mega { display: none; }
.mega-inner { padding: 0.9rem 1.1rem 1rem; }
.mega-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin: 0 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.mega-head a { font-family: var(--serif); font-size: 1.15rem; text-decoration: none; }
.mega-head span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.mega-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.4rem; width: max-content; max-width: 36rem; }
.mega-list li { break-inside: avoid; }
.mega-list a { display: block; padding: 0.28rem 0; text-decoration: none; font-size: 0.95rem; color: var(--ink); white-space: nowrap; }
.mega-list a:hover { color: var(--navy); text-decoration: underline; }
.shop-nav-list > li:nth-child(n+5) .mega { left: auto; right: 0; }
.shop-nav-list > li:last-child > a { padding-right: 0; }

/* Phone section chips */
.chip-bar { border-top: 1px solid var(--line); background: var(--cream); }
.chip-scroll {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.5rem 1rem 0.6rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll a {
    flex: 0 0 auto;
    padding: 0.35rem 0.75rem;
    border: 1px solid #d6c8b2;
    border-radius: 99px;
    background: var(--card);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    color: var(--navy);
}
.chip-scroll a[aria-current] { background: var(--navy); border-color: var(--navy); color: var(--cream); }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(15, 21, 38, 0.5); }
.drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(23rem, 88vw);
    background: var(--paper);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.2);
    outline: none;
}
.drawer-head {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem 0.5rem 1.1rem;
    background: var(--navy);
    color: var(--cream);
}
.drawer-title { font-family: var(--serif); font-size: 1.3rem; }
.drawer-close { background: none; border: 0; color: var(--cream); min-height: 44px; width: 44px; padding: 0; }
.drawer-list { list-style: none; margin: 0; padding: 0.3rem 0; }
.drawer-list + .drawer-list { border-top: 1px solid var(--line); }
.drawer-link, .drawer-list summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.1rem;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.15rem;
    cursor: pointer;
    list-style: none;
}
.drawer-list summary::-webkit-details-marker { display: none; }
.drawer-list summary::after { content: "+"; font-family: var(--sans); color: var(--gold); font-size: 1.3rem; line-height: 1; }
.drawer-list details[open] summary::after { content: "–"; }
.drawer-list details ul { list-style: none; margin: 0 0 0.5rem; padding: 0 0 0 1.1rem; }
.drawer-list details a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1.1rem 0.5rem 0.7rem;
    border-left: 2px solid var(--line);
    text-decoration: none;
    color: var(--ink);
}
.drawer-list details a span { color: var(--muted); font-size: 0.85rem; }
.drawer-pages .drawer-link { font-family: var(--sans); font-size: 1rem; }
body.drawer-open { overflow: hidden; }

/* Breadcrumbs */
.crumbs { padding-top: 0.9rem; font-size: 0.88rem; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "/"; margin: 0 0.45rem; color: #b9ab94; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs + main .page-head { padding-top: 0.6rem; }
.crumbs + main .product { padding-top: 0.6rem; }

/* Listing */
.listing-head h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 0.2rem; }
.search-note { color: var(--muted); }
.search-page-form { display: flex; max-width: 34rem; margin-top: 1rem; }
.search-page-form input { flex: 1; min-width: 0; }
.listing { padding-top: 1rem; }
.listing-grid { display: grid; gap: 1rem; }
.filters-box { background: var(--card); border: 1px solid var(--line); }
.filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.85rem;
    list-style: none;
    min-height: 46px;
}
.filters-toggle::-webkit-details-marker { display: none; }
.filters-toggle::after { content: "+"; font-size: 1.2rem; color: var(--gold); margin-left: auto; }
.filters-box[open] .filters-toggle::after { content: "–"; }
.filter-badge { background: var(--navy); color: var(--cream); border-radius: 99px; padding: 0 0.5rem; font-size: 0.7rem; }
.filter-form { padding: 0 1rem 1rem; display: grid; gap: 0.2rem; }
.facet { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0.75rem 0 0.6rem; min-width: 0; }
.facet legend {
    padding: 0.75rem 0 0.35rem;
    float: left;
    width: 100%;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
}
.facet legend + * { clear: both; }
.facet-links { list-style: none; margin: 0; padding: 0; }
.facet-links a { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.3rem 0; text-decoration: none; color: var(--ink); line-height: 1.3; }
.facet-links a:hover { color: var(--navy); text-decoration: underline; }
.facet-links a[aria-current] { font-weight: 600; color: var(--navy); }
.count { color: var(--muted); font-size: 0.85rem; font-weight: 400; white-space: nowrap; }
.facet-checks { display: grid; gap: 0.15rem; max-height: 17rem; overflow-y: auto; padding-right: 0.2rem; }
label.choice.facet-check { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.22rem 0; font-size: 0.97rem; cursor: pointer; line-height: 1.3; }
.facet-check input { margin-top: 0.15em; }
.facet-check span:first-of-type { flex: 1 1 auto; min-width: 0; }
.facet-check .count { margin-left: auto; flex: 0 0 auto; }
.brand-find { width: 100%; min-height: 40px; margin-bottom: 0.5rem; padding: 0.4rem 0.6rem; }
.price-range { display: flex; align-items: center; gap: 0.5rem; }
.price-range label { flex: 1 1 0; min-width: 0; }
.price-range input { width: 100%; min-height: 42px; }
.filter-actions { display: flex; align-items: center; gap: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.filter-actions button { flex: 1 1 auto; }
.text-link { color: var(--navy); }

.results { min-width: 0; }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; margin-bottom: 0.8rem; }
.results-count { margin: 0; color: var(--muted); }
.sort-form { display: flex; align-items: center; gap: 0.5rem; }
.sort-form label { display: inline; font-size: 0.9rem; color: var(--muted); }
.sort-form select { min-height: 42px; padding: 0.4rem 0.6rem; }
.active-filters { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; padding: 0; }
.active-filters a {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--navy);
    border-radius: 99px;
    text-decoration: none;
    font-size: 0.88rem;
}
.active-filters a span { font-size: 1.05rem; line-height: 1; }
.results-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.results-grid .card h3 { font-size: 1.02rem; }
.results-grid .card-body { padding: 0.7rem 0.75rem 0.9rem; }
.pager { flex-wrap: wrap; align-items: center; margin-top: 1.4rem; }
.pager a { min-width: 2.4rem; text-align: center; padding: 0.45rem 0.6rem; }
.pager-gap { color: var(--muted); }

/* Home sections */
.section-grid { display: grid; gap: 0.9rem; }
.section-card { background: var(--card); border: 1px solid var(--line); padding: 1rem 1.1rem 1.1rem; }
.section-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; text-decoration: none; margin-bottom: 0.3rem; }
.section-card-head span { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; }
.section-card-head small { color: var(--muted); white-space: nowrap; }
.section-card p { color: var(--muted); margin-bottom: 0.5rem; }
.section-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.section-card li a { display: inline-block; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 99px; font-size: 0.85rem; text-decoration: none; background: var(--paper); }
.footer-grid-shop { grid-template-columns: 1fr; }

@media (min-width: 600px) {
    .results-grid { grid-template-columns: repeat(3, 1fr); }
    .section-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid-shop { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
    .masthead {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        grid-template-areas: "logo search util cart";
        gap: 1.5rem;
        padding: 0.8rem 0;
    }
    .masthead .logo { justify-self: start; }
    .masthead .logo img { width: 230px; }
    .menu-toggle { display: none; }
    .site-search { max-width: 40rem; justify-self: center; width: 100%; }
    .masthead .cart-link > span:first-of-type { display: inline; }
    .shop-nav { display: block; }
    .util-links { display: none; }
    .chip-bar { display: none; }
    .listing-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
    .filters-panel { position: sticky; top: 9.5rem; max-height: calc(100vh - 10.5rem); overflow-y: auto; }
    .filters-toggle { pointer-events: none; }
    .filters-toggle::after { display: none; }
    .results-grid { grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
    .section-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid-shop { grid-template-columns: 1.4fr 1fr 0.6fr 0.8fr; }
}

@media (min-width: 1180px) {
    .results-grid { grid-template-columns: repeat(4, 1fr); }
    .util-links { display: flex; }
}

@media (max-width: 1120px) and (min-width: 900px) {
    .shop-nav-list > li > a { padding: 0.7rem 0.55rem; font-size: 0.88rem; }
}

/* Product page gallery: main image, then thumbnails, then the buy box. No overlap. */
.product { grid-template-columns: minmax(0, 1fr); }
.product > * { min-width: 0; }
.gallery { display: grid; gap: 0.6rem; align-content: start; }
.gallery-main {
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--line);
    padding: 0.75rem;
}
.gallery .gallery-main img,
.gallery #main-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(68vh, 560px);
    aspect-ratio: auto;
    object-fit: contain;
    background: none;
}
.gallery .card-fallback.large { width: 100%; }
.gallery .thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 0;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
}
.gallery .thumb {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    min-height: 0;
    padding: 2px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 2px;
    cursor: pointer;
}
.gallery .thumb[aria-current="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.gallery .thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    background: none;
}
.product-buy h1 { font-size: clamp(1.55rem, 3.4vw, 2.4rem); letter-spacing: 0; overflow-wrap: anywhere; }
@media (min-width: 800px) {
    .product { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
    .gallery { position: sticky; top: 9.5rem; }
    .gallery .thumb { width: 72px; height: 72px; }
}

/* Best-practice pass: contrast, buy box, specs, trust notes, tap targets. */
:root { --gold-text: #7f6139; }
.eyebrow { color: var(--gold-text); }
.eyebrow.light { color: var(--gold-2); }

.brand-name a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.brand-name a:hover { border-bottom-color: var(--navy); }

.add-form { display: grid; grid-template-columns: auto 5.2rem minmax(0, 1fr); gap: 0.6rem; align-items: center; margin: 1rem 0 0.4rem; }
.add-form .qty-field { font-weight: 600; }
.add-form input[name="qty"] { min-height: 48px; text-align: center; font-size: 1.05rem; padding: 0.4rem; }
.add-btn { min-height: 52px; font-size: 1.08rem; font-weight: 600; letter-spacing: 0.02em; width: 100%; }

.buy-facts { list-style: none; margin: 1rem 0; padding: 0.85rem 1rem; background: var(--cream); border: 1px solid var(--line); display: grid; gap: 0.45rem; font-size: 0.96rem; }
.buy-facts li { margin: 0; }
.buy-facts strong { color: var(--navy); }
.cart-total .buy-facts, .summary .buy-facts { margin-top: 1rem; }
.checkout-btn { width: 100%; min-height: 52px; font-weight: 600; font-size: 1.05rem; }

.spec-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.spec-table th { width: 38%; font-weight: 600; color: var(--muted); background: var(--paper); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.rate-table { margin: 0.8rem 0 1rem; }
.rate-table td { text-align: right; white-space: nowrap; }

.section-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.section-head-row h2 { margin-bottom: 0.6rem; }

.nf-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.nf-links a { display: flex; align-items: center; min-height: 48px; padding: 0.5rem 0.9rem; background: var(--card); border: 1px solid var(--line); text-decoration: none; }
.page-head .search-page-form { margin-top: 1rem; }

/* Tap targets: at least about 44px tall on touch screens. */
.site-footer a { display: flex; align-items: center; min-height: 40px; margin: 0; }
.pager a, .pager-step { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.crumbs a { display: inline-block; padding: 0.35rem 0; }
.facet-links a { min-height: 40px; display: flex; align-items: center; }
.text-btn { min-height: 44px; }
.prose h2 { margin-top: 1.6rem; }
.summary .buy-facts li { display: block; }
.cart-total { justify-items: stretch; max-width: 28rem; margin-left: auto; }
