/*
 * Copyright © 1996 - 2026 Gousse & Gousse Inc. or its Affiliates., All Rights Reserved.
 *  author: Al D. Gousse
 *    site: www.goussecorp.com
 *   email: info@goussecorp.com
 *  twitter: @goussecorp
 **/

/* Shared page-specific stylesheet for shop_list.html and shop_detail.html
   (Foundation for Sites migration, planning/frontend-framework.md). Covers
   only what Foundation's grid/card/button/menu utility classes can't do on
   their own — the shop-list-only bits (category toggle, breadcrumb/back-
   link resets, search/sort form resets) plus small page-level polish
   (heading treatment) — layered on top of brand.css, which now owns every
   shared storefront component (product cards, product-detail layout,
   category sidebar, and — as of this pass — the product image gallery too).
   Brand colors match the Foundation palette override in
   foundation-input.scss (#7a1620 primary / #c9a227 secondary) so these two
   pages look consistent with the rest of the migrated storefront.
   2026-07 redesign note: `.product-card-noimg`/`-name`/`-price`/`-oos`/
   `-link` used to be defined here too ("ported from the pre-Foundation
   rules in brand.css" per the original version of this comment) with
   fixed-height/no-clamp values that — since this file loads *after*
   brand.css in every template's <head> — silently won the cascade and
   fought brand.css's redesigned card treatment (most seriously,
   `.product-card-name { display: block }` here overrode the `display:
   -webkit-box` brand.css's 2-line clamp depends on, breaking it outright).
   Removed here now that brand.css owns the single, current version of all
   five.
   2026-07-21 consistency pass: the product-gallery/-thumb/-scroll/-zoom
   rules that used to live here too are gone for the exact same reason —
   brand.css had already been redesigned to own the same selectors with
   richer values (border-radius, box-shadow, and — importantly —
   `var(--crest-gold-border)` instead of the plain `--crest-gold` hex this
   file was hardcoding), but because this file loads after brand.css, this
   file's older plain-gold/no-radius versions were still silently winning
   the cascade and undoing that a11y-contrast fix on the gallery's scroll
   buttons and thumbnail borders. Same bug class as the `.product-card-name`
   one above; fixed the same way (delete the stale duplicate, let brand.css
   own it single-source). */

/*
 * Copyright © 1996 - 2026 Gousse & Gousse Inc. or its Affiliates., All Rights Reserved.
 *  author: Al D. Gousse
 *    site: www.goussecorp.com
 *   email: info@goussecorp.com
 *  twitter: @goussecorp
 **/

/* Category sidebar on the shop list page (shop_list.html): collapsed
   behind a plain JS-toggled button on small screens so products aren't
   pushed far below the fold by a long category list, but always fully
   visible on medium+ screens (Foundation's 640px breakpoint) where it sits
   beside the product grid rather than above it. Plain class toggle rather
   than native <details> - Chromium's UA styling for closed <details>
   content couldn't be reliably overridden with an author stylesheet. */
.shop-category-toggle {
    display: none;
}

@media (max-width: 39.9375em) {
    /* Typography/border brought in line with the rest of the redesign's
       small-uppercase-letter-spaced control convention (.brand-dept-trigger,
       .shop-category-aside h2) — this toggle used to be a plain bold label
       with a generic `#ccc` border-bottom, an off-palette gray that didn't
       belong anywhere else on either page and (being a "just text," not a
       component brand.css already themes) never got swept into the gold
       palette when everything around it was. */
    .shop-category-toggle {
        display: block;
        width: 100%;
        cursor: pointer;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-size: 0.85rem;
        padding: 0.6rem 0;
        background: none;
        border: none;
        border-bottom: 1px solid var(--crest-gold-border);
        text-align: left;
        color: var(--crest-ink, #2a1a12);
    }

    .shop-category-toggle:focus {
        outline: 2px solid var(--crest-red-dark);
        outline-offset: 2px;
    }
    .shop-category-body {
        display: none;
    }
    .shop-category-body.is-open {
        display: block;
    }

    /* `.shop-category-aside`'s `position: sticky` (brand.css) is a desktop
       nicety -- keeps the category card in view while a shopper scrolls a
       tall product grid next to it. On a phone the aside sits collapsed
       above the grid rather than beside it, so "sticky" would just pin a
       toggle bar mid-scroll for no benefit; turned off below the same
       breakpoint the collapse behavior already uses. */
    .shop-category-aside {
        position: static;
        padding: 0.75rem 1rem;
    }
}

/* Medium+ (Foundation's own breakpoint, matching the max-width above):
   the sidebar used to be a fixed Foundation `medium-3` column (25% of the
   row) regardless of content, leaving a lot of dead space next to short
   names like "Shoes" while every longer one (e.g. "Sporting Goods &
   Outdoors") still had to fit inside that same fixed slice. `fit-content`
   -- together with `white-space: nowrap` on the department links
   (brand.css) and the `3ch` card padding (brand.css) -- sizes the sidebar
   to exactly what its longest name needs and no more. The product grid
   (the `<main>` immediately after it in shop_list.html) picks up the
   width the sidebar gives back.
   Selectors need the `.grid-x >` prefix -- Foundation's own grid classes
   are `.grid-x>.medium-3{width:25%}`/`.grid-x>.medium-9{...}` (two classes,
   0,2,0 specificity), which otherwise wins over a plain `.shop-category-
   aside`/`main` selector (0,1,0 / 0,1,1) regardless of load order, since
   specificity is compared before source order. Confirmed live: without
   this prefix the sidebar stayed pinned at its old fixed width. */
@media (min-width: 40em) {
    .grid-x > .shop-category-aside {
        flex: 0 0 auto;
        width: fit-content;
        min-width: 10rem;
        /* Flush with the true left edge -- `.brand-page .grid-container`
           is deliberately full-bleed (max-width:100%, see brand.css), so
           `margin-left: 0` here lands exactly at the viewport edge.
           (A prior pass tried shifting 24px past Foundation's normal 15px
           gutter via `margin-left: -9px`, which overshot past the edge
           entirely -- confirmed live, `getBoundingClientRect().x` was -9,
           not 0. Zero is the actual flush position.) */
        margin-left: 0;
    }

    /* `flex-basis: 0` (not `auto`), matching Foundation's own `.cell.auto
       {flex:1 1 0}` convention -- with `auto` here, this element's hypo-
       thetical flex-basis resolved to its own huge intrinsic content width
       (the product grid), which was wider than the row had left next to
       the sidebar and forced a wrap onto a new line below it entirely,
       instead of sharing the row. `flex-basis: 0` makes flex-grow alone
       decide the final width from available space, ignoring content size. */
    .grid-x > .shop-category-aside + main {
        flex: 1 1 0%;
        width: auto;
        max-width: none;
    }
}

/* style.css's generic `nav, p:has(> a) { background, border, padding }`
   rule (written to turn a "<p><a>...</a></p>" byline into a toolbar pill)
   also matches the breadcrumb <nav> and the "My orders" link here, showing
   up as two stray white boxes with nothing to do with either element.
   2026-07-21 consistency pass: found the same bug hitting two more spots
   on these pages, added to this reset for the same reason —
   `.shop-category-aside > p` (shop_list.html's "All Departments" link,
   `<p><a>...</a></p>` with no class of its own to opt out) was rendering
   as a bordered/backgrounded pill sitting above the plain department list
   right below it in the same sidebar card; `.product-detail-back`
   (shop_detail.html's "&larr; Back to shop") DOES have a class, but
   brand.css only ever styled `.product-detail-back a` (the link), never
   `.product-detail-back` itself (the <p>), so nothing there defeated the
   generic rule either — same equal-specificity, source-order loss as the
   other two. All four share one reset since they all need the exact same
   properties cleared. */
.shop-breadcrumb,
.shop-my-orders,
.shop-category-aside > p,
.product-detail-back {
    display: block;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* 2026-07 redesign: breadcrumb + "My orders" used to be two stacked
   paragraphs (the second one, `.shop-my-orders`, floating directly under
   the page's H1 with no visual relationship to anything around it —
   confirmed in the pre-redesign screenshots). Paired into one utility row
   via shop_list.html so "My orders" reads as a small account shortcut in
   the corner of the page header, not an orphaned line of body text. */
.shop-utility-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
}

.shop-my-orders {
    margin: 0;
    font-size: 0.85rem;
}

.shop-my-orders a {
    color: var(--crest-red-dark);
    text-decoration: none;
    font-weight: 600;
}

.shop-my-orders a:hover {
    text-decoration: underline;
}

/* Groups the search + sort controls into one visually intentional bar
   (card-like, matching `.product-card`/`.shop-category-aside`) instead of
   two independent form elements sitting loose against the page background
   -- pre-redesign this was the "two random floating boxes" look flagged in
   the initial review. */
.shop-toolbar {
    background: #fff;
    border: 1px solid var(--crest-gold-border);
    border-radius: var(--brand-radius);
    padding: 1rem 1.15rem;
    margin-bottom: 1.5rem;
}

/* The shop page's own search and sort forms (shop_list.html) fall under
   style.css's generic `form { background, border, padding, box-shadow }`
   rule meant for the admin panel's forms, since every <form> on the page
   matches it. Without this reset, that showed up as an unwanted padded,
   bordered, shadowed box sitting around and below the search bar. */
.shop-inline-form {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
}

.shop-sort-form {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.shop-sort-form label {
    margin: 0;
    white-space: nowrap;
}

/* style.css's generic `select { width: 100% }` reset (meant for the admin
   panel's stacked-label form fields) is otherwise the sort `<select>`'s
   only source of a `width`. As a *direct* flex child of `.shop-sort-form`
   with no `flex`/`flex-basis` of its own, that 100% width becomes its
   flex-basis too (flex-basis:auto falls back to the width property) —
   confirmed live, the dropdown was ballooning to fill nearly the entire
   toolbar row instead of sitting inline next to its label. `width: auto`
   here lets it size to its own option text like a normal <select>.
   Same fix applied to the product-detail page's variant `<select>` for
   parity, even though it isn't a flex child there — cheap insurance
   against the same global rule now that it's been shown to bite twice on
   these two pages. */
.shop-sort-form select,
.product-detail-add select {
    width: auto;
}

.shop-sort-form select {
    height: 2.35rem;
}

/* Foundation's default placeholder color is a very light gray that's hard
   to read against a white input on this page's brighter background. */
.shop-inline-form input::placeholder {
    color: #6b6558;
    opacity: 1;
}

/* Foundation's `.input-group` already joins the field and button with zero
   gap between them (confirmed live: 0px, not a spacing bug) -- but without
   this, the field keeps Foundation's default light-gray (#cacaca) border
   while the adjacent button picks up brand.css's dark-ink button border
   (`.brand-page .button:not(.alert)`), and that color mismatch on two
   directly-touching boxes reads as a seam -- as if the search bar were two
   separate pieces rather than one control. Matching the field's border to
   the same gold used by the header search input, and dropping the shared
   inner edge the same way `.brand-search input` does, removes the seam. */
.shop-inline-form .input-group-field {
    height: 2.35rem;
    border: 1px solid var(--crest-gold-border);
    border-right: none;
    border-radius: 0;
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    background: #fff;
    color: var(--crest-ink);
}

.shop-result-count {
    color: var(--crest-red-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin: 0 0 1.1rem;
}

.shop-pager {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--crest-gold-border);
}

.shop-pager .pager-info {
    font-size: 0.88rem;
    color: var(--crest-ink);
}

/* Two page-level headings on these pages — shop_list.html's plain
   `<h1>Shop</h1>` and shop_detail.html's "Product not found" fallback —
   had no scoped typography of their own, unlike every sibling heading
   pattern elsewhere in the redesign (.dept-hero h1, .product-detail-info
   h1, .brand-legal h1). Both were falling through all the way to
   style.css's bare `h1 { font-size: 1.5rem; margin-bottom: 0.25rem }`
   admin-panel default, reading as a plain, tightly-cramped outlier next to
   the rest of these two pages' art-directed spacing. Scoped by structural
   position rather than a new template class, since both are already
   uniquely reachable that way (shop_list.html's is a direct child of
   `#main`; shop_detail.html's "not found" case is a direct child of
   `.product-detail-shell`; the *found* product name `<h1>` lives one level
   deeper inside `.product-detail-info` and keeps its own existing
   treatment untouched) — one rule, no markup changes needed on either
   template. */
#main > h1,
.product-detail-shell > h1 {
    color: var(--crest-ink);
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin: 0 0 1.1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--crest-gold-border);
}
