/* ================================================================
   StoreLocator.css — Store locator page (map + list views)
   All values use Momento design tokens from tokens.css
   ================================================================ */

/* ── Global base (scoped to this page) ───────────────────── */
html, body {
    height: 100%;
    width: 100%;
    overflow: auto;
}

/* ── Page title ("Stores") — full-width block at the top of the content,
      nothing beside it. Matches reference .fc-stores-h1 / .fc-stores-inner. ── */
.stores-title-bar {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
    /* No bottom padding: the content container below already provides the gap
       (its own padding-top), so a bottom pad here would double the spacing. */
    padding: var(--space-2) var(--space-2) 0;
}

.stores-page-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 28px;
    line-height: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    color: #000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
}

/* ── Background & layout ──────────────────────────────────── */
.main-background {
    background: linear-gradient(180deg, var(--color-surface-info-bg) 0%, #FEFFFF 100%);
    /* NOT a flat 100vh. #main-scroll-container carries the directional header's clearance as an
       inline padding-top (written by fcNativeHeader from the header's real height — 156px on this
       page, which stacks search + location bar + List/Map toggle) and the native tab bar's
       clearance as padding-bottom (app.css). Both count toward the scroller's scrollable extent,
       so a child floored at a flat one-viewport height makes the page taller than the viewport by
       exactly their sum. Measured at 412x800 with a short store list before this fix:
       scrollHeight 1036 = 156 + 800 + 80 against a clientHeight of 800, i.e. 319px of empty
       gradient below the last card (reported 2026-09-03). Subtracting both terms makes the floor
       "one viewport of VISIBLE area", which is what it was always meant to be.
       Long lists are unaffected — content height already exceeds the floor, so min-height is
       inert there (verified: a 75-card list measured 9245px either way). */
    --fc-storeloc-tabclear: 0px;
    min-height: calc(100vh
                     - var(--native-header-h, 0px)
                     - var(--fc-storeloc-tabclear));
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Native only: the tab-bar clearance app.css puts on the scroll container. The mobile browser has
   no bottom tab bar (MainLayout gates `has-bottomnav` on !isBrowser), so it stays 0 there. */
.page.has-bottomnav .main-background {
    --fc-storeloc-tabclear: calc(56px + var(--fc-tabbar-pad-bottom));
}

.dn { display: flex; }

@media (max-width: 599px) {
    .main-background {
        background: linear-gradient(180deg, var(--color-surface-info-bg) 0%, #FEFFFF 100%);
    }
}

@media (min-width: 1025px) {
    .dn { display: none; }

    /* Keep the header bar visible on desktop so the location selector shows there too.
       The search is markup-gated to mobile and the List/Map toggle keeps its own .dn,
       so only the location bar remains visible here. */

    /* ...except on a tablet. A tablet in landscape is wider than 1024px, but it never gets the
       desktop split view: _isDesktop comes from window.getScreenType, which only the WEB host
       defines (FCApp.Web/Components/App.razor), so on a device it is always false and the page
       stays in single-view List/Map mode. Hiding the toggle there left the user on whichever view
       was open with no way to switch. Keyed on the native shell, so web desktop - which does show
       list and map side by side and genuinely needs no toggle - is untouched. */
    html.fc-native-shell .dn { display: flex; }
}

/* ── Sticky header ────────────────────────────────────────── */
/* ── Location bar / List-Map toggle ────────────────────────────────────────────────────────────
   The blue block is Home's `.fc-home-locationbar` now (see the note in StoreLocator.razor), so all
   the `#store-locator-header` rules that used to live here are GONE — the native sticky block with
   its ride-up transform and --fc-safe-top padding, the desktop/mobile `.sticky_cls` variants, the
   `.header-content-container` container overrides, and the five `.setloc*` chip overrides. Home's
   rules supply every one of those, and the chip now matches Home's exactly instead of this page's
   flattened variant (pill radius, 14px arrow, 92%-white label). `.header-wrapper` is unused too.
   Deliberate behaviour change: the bar SLIDES AWAY with the directional header rather than pinning
   to the top. */

/* The location+toggle bar is position:sticky. .main-background is display:flex, which makes
   the bar a STICKY FLEX ITEM — Chromium pins it, but the native MAUI WebView (Android System
   WebView / WKWebView) does NOT pin sticky flex items reliably, so it detached and floated
   mid-list. In LIST mode the children only stack vertically, so a plain block context is
   visually identical AND makes sticky work on every engine. Map mode keeps flex (the map
   fills the remaining height), and desktop (≥1025) keeps its flex row layout untouched. */
@media (max-width: 1024px) {
    .main-background:not(.store-map-mode) {
        display: block;
    }
}

/* A tablet in landscape is >1024px, so it used to take the DESKTOP flex sizing - a column sized to
   fill one screen with the list scrolling inside it. But the desktop split view never engages on a
   device (_isDesktop comes from window.getScreenType, web-host only), so the markup is still
   single-view: the column was sized for a layout it is not using, and ran past the bottom tab bar,
   hiding the last rows behind it. Give the native shell the same block layout it already uses in
   portrait, at any width - the page scrolls and #main-scroll-container's padding-bottom provides
   the tab-bar clearance, exactly as it does on a phone. */
html.fc-native-shell .main-background:not(.store-map-mode) {
    display: block;
    /* `@media (min-width: 701px)` pins this to `height: calc(100vh - 100px)` with `min-height: 0`.
       That is the desktop sizing - one fixed viewport, with the list scrolling INSIDE it - and it
       is right for desktop, where the split view actually engages. On a device it never does, so
       the page scrolls instead and a 3180px list sat inside a 1080px box: it overflowed every
       ancestor, which put #main-scroll-container's padding-bottom ABOVE the list rather than after
       it, and the last rows ended up behind the tab bar. Auto height lets the box wrap the list so
       that padding lands where it should. The min-height floor from the base rule is restored for
       short lists (one viewport of VISIBLE area, the base rule's own wording). */
    height: auto;
    min-height: calc(100vh
                     - var(--native-header-h, 0px)
                     - var(--fc-storeloc-tabclear));
}


/* Desktop (≥1025px) fills exactly one screen (the list scrolls internally, no page
   scroll), so the blue header sits in normal flow — sticky there only detached it and
   left an 88px gap under the non-fixed topbar. */
@media (min-width: 1025px) {
}

/* Mobile / tablet (≤1024px): the list view scrolls the page, so pin the blue bar
   (location selector + List/Map toggle) to the very top while scrolling — matching
   the reference's sticky fc-stores-mbar. top:0 (not 88px) because the topbar above
   is not fixed and scrolls away, so the bar takes the top with no gap. */
@media (max-width: 1024px) {
}

/* On the stores page ONLY, the mobile search bar must NOT stay fixed — the user
   wants just the location selector + List/Map toggle to stick. The search bar is
   sticky app-wide (.topbar_search_div), so un-stick it here (class added by Topbar
   when IsOnStoreLocatorPage). Other pages keep their sticky mobile search. */
.topbar_search_div--nosticky {
    position: static !important;
    top: auto !important;
}

/* ── Store details as a centered popup (web) ────────────────────────────────
   Same content as the bottom drawer — only the wrapper changed to a centered
   MudDialog. Give it the drawer's width/padding and let tall content scroll. */
.store-details-dialog {
    max-width: 640px !important;
    border-radius: var(--radius-xl) !important;
    overflow: hidden;
}

.store-details-dialog .mud-dialog-content {
    padding: var(--space-2) var(--space-4) var(--space-4) !important;
    max-height: 82vh;
    overflow-y: auto;
}

/* The header sat flush in the drawer; keep it tidy at the top of the dialog. */
.store-details-dialog #store-drawer-header {
    padding-left: 0;
    padding-right: 0;
}

/* Store Details action buttons (Get Directions | View Store Inventory): styled only by
   StoreLocationDrawer.razor's style block, as in v3.0.2. A v3.1-only override sat here until
   2026-09-30 (14px / 12.5px labels, 10px / 6px side padding). Kelly asked for v3.0.2's button
   rules; the only part still live was the 10px desktop side padding, since the component's own
   phone rule already wins below 600px. */

/* ── Map view on mobile/tablet: fixed, non-scrolling full screen ──────────────
   In MAP view the page must NOT scroll — the map fills the area below the header
   (reference .fc-stores--mapmode). Scoped via :has() to the stores page in map
   mode only, so list view and every other page are unaffected. Flexbox fills the
   map to the exact remaining height (no pixel guessing). */
@media (max-width: 1024px) {
    /* Lock the app scroll container so the map screen is fixed. */
    #main-scroll-container:has(.main-background.store-map-mode) {
        overflow: hidden;
    }

    /* Make the page column (topbar + main-background) fill exactly one viewport. */
    #main-scroll-container:has(.main-background.store-map-mode) > article {
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .main-background.store-map-mode {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        /* Map mode wants NO bottom gap — the map runs to the top edge of the tab bar. On native,
           BottomDrawer gives every .fc-home-scrollwrap (this element) a 16px breathing gap for
           LIST content; with box-sizing:border-box that gap comes out of the map's own area, so
           the map stopped short of the bar. It used to be a 90px copy of the whole tab-bar
           clearance, which is most of why the map read as "not fitted" on device. */
        padding-bottom: 0 !important;
        /* Be a flex COLUMN so #main-content-container's flex:1 actually resolves — without this the
           child collapsed to content height and the map fell back to .map-display's min-height:400px
           floor, leaving white space below the map on tall phones (v3.0.2 map-fill fix). */
        display: flex;
        flex-direction: column;
    }

    /* The content row and the map fill the space left under the location bar + toggle.
       EXPLICIT height, not flex-grow: the reference carries the same rule with a measured note
       that flex-grow does NOT distribute through this chain on the device WebView — the child
       keeps its content basis and the map falls back to .map-display's `min-height: 400px` floor,
       leaving white space between the map and the tab bar (reported 2026-09-03, Android).
       Every term is a value the app already publishes, so this cannot drift with header content:
       --native-header-h and --fc-location-h are measured and written by fcNativeHeader in
       ScrollPositionHelper.js on every layout pass, and the tab-bar term is the same clearance
       app.css puts on #main-scroll-container. 100dvh (not vh) so mobile viewport changes are
       accounted for. `flex: none` stops flex from re-deriving it.
       Verified against Chromium's own flex result at 412x800 before the switch: 800-156-108-0=536
       and 800-156-108-80=456 both matched the measured heights exactly, so web geometry is
       unchanged and only the WebView's failed distribution is fixed. */
    .main-background.store-map-mode #main-content-container {
        /* Tab-bar clearance is NATIVE-ONLY — MainLayout puts `has-bottomnav` on `.page` under
           !isBrowser, so the mobile browser has no bottom tab bar and must not subtract for one. */
        --fc-storeloc-tabclear: 0px;
        flex: none;
        height: calc(100dvh
                     - var(--native-header-h, 0px)
                     - var(--fc-location-h, 0px)
                     - var(--fc-storeloc-tabclear));
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .page.has-bottomnav .main-background.store-map-mode #main-content-container {
        --fc-storeloc-tabclear: calc(56px + var(--fc-tabbar-pad-bottom));
    }

    .main-background.store-map-mode .map-container {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    /* Fill the (now definite) map-container instead of collapsing to the 400px floor. */
    .main-background.store-map-mode .map-display {
        height: 100%;
        min-height: 0;
    }

    /* No sticky in map mode — the screen is fixed, so keep the bar in normal flow. */
}

/* ── Back button ──────────────────────────────────────────── */
.back-button-wrapper {
    margin-bottom: 1rem;
}

.back-button {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: var(--space-1) 0;
    transition: opacity 0.2s ease;
    font-family: var(--font-body);
    font-size: 14px;
    font-style: normal;
    font-weight: var(--fw-semibold);
    line-height: 16px;
    letter-spacing: 0.2px;
}

.back-button:hover {
    opacity: 0.8;
}

/* ── Search input ─────────────────────────────────────────── */
.search-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.custom-search-field {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: var(--color-surface-default);
    border: 1px solid var(--color-text-primary);
    border-radius: var(--radius-md);
    padding: 0 var(--space-1);
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.custom-search-field:focus-within {
    border-color: var(--color-brand-primary);
    box-shadow: 0 0 0 1px var(--color-brand-primary);
}

.search-input-html {
    flex-grow: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--color-text-secondary);
    padding: 0 10px;
}

.search-input-html::placeholder {
    color: var(--color-border-subtle);
}

.search-icon-start .mud-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.arrow-icon-end-html {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.arrow-icon-end-html .mud-icon {
    color: var(--color-brand-accent);
}

/* ── View selector ────────────────────────────────────────── */
.view-selector {
    background: transparent;
    /* 16px ABOVE the toggle, not below: the blue bar (.fc-home-locationbar) already pays its own
       16px underneath, so padding-bottom here stacked to 32px and pushed the toggle 8px down while
       making the whole bar 8px taller than the reference's. The 8px margin-top that used to sit
       here went with it — the padding is the gap. */
    padding: var(--space-2) 0 0;
}

.view-button {
    padding: 0;
    height: 40px;
    border: 1px solid var(--color-brand-accent);
    background-color: var(--color-surface-default);
    color: var(--color-brand-accent);
    text-align: center;
    font-family: var(--font-heading);
    font-size: 16px;
    font-style: normal;
    font-weight: var(--fw-bold);
    line-height: 24px;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-half);
    width: 100%;
}

.view-button .mud-icon {
    color: var(--color-brand-accent) !important;
    font-size: 20px !important;
    width: 20px;
    height: 20px;
}

/* Map (duotone) icon: red side panels + white middle panel. */
#map-view-icon {
    --fa-secondary-color: #ffffff;
    --fa-secondary-opacity: 1;
}

.view-button.active {
    background-color: var(--color-brand-accent) !important;
    color: var(--color-surface-default) !important;
}

.view-button.active .mud-icon {
    color: var(--color-surface-default) !important;
}

.view-selector .map-button {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.view-selector .list-button {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-left: none;
}

/* ── Search results view ──────────────────────────────────── */
.search-results-container {
    width: 100%;
    background: transparent;
    padding: 0;
}

.search-results-content {
    max-width: 1048px !important;
    width: 100%;
    padding: var(--space-1) !important;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.search-results-header {
    margin-bottom: 1.5rem;
    padding: 0 var(--space-1);
    flex-shrink: 0;
}

.search-results-scrollable-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    max-height: calc(100vh - 250px);
}

.title-and-sort-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
}

.search-results-title {
    color: var(--color-text-primary) !important;
    font-family: var(--font-heading);
    font-size: 22px;
    font-style: normal;
    font-weight: var(--fw-xbold);
    line-height: 32px;
    margin: 0 !important;
}

.search-results-subtitle {
    color: var(--color-text-primary) !important;
    font-family: var(--font-body);
    font-size: 14px;
    font-style: normal;
    font-weight: var(--fw-normal);
    line-height: normal;
    margin-top: 4px !important;
    text-align: left;
    width: 100%;
    display: block;
}

.sort-button {
    background-color: var(--color-surface-default) !important;
    color: var(--color-text-primary) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    padding: var(--space-1) var(--space-2) !important;
    text-transform: none !important;
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    min-width: auto !important;
}

.sort-button:hover {
    background-color: var(--color-surface-subtle) !important;
}

/* ── Search results list ──────────────────────────────────── */
.search-results-list {
    width: 100%;
}

/* 8px between cards and 16px x 24px inside, matching the list rows (.list-item) and v3.0.2 — this
   was 16px between cards and 16px all round. */
.search-result-item {
    margin-bottom: 8px;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    background-color: var(--color-surface-default) !important;
    cursor: pointer;
    /* Hover/press copied from v3.0.2 (Kelly, 2026-09-23): only the border and shadow animate, over
       0.15s. This was `all 0.3s` with a grey fill and a 2px lift on hover and no press state. */
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid var(--color-border);
}

/* Hover only where there is a real pointer — same reason as .list-item:hover. */
@media (hover: hover) {
    .search-result-item:hover {
        border-color: var(--color-brand-primary);
        box-shadow: var(--elevation-sm);
    }
}

.search-result-item:active {
    border-width: 2px;
    filter: brightness(0.8);
}

.mud-paper.search-result-item:active {
    transform: scale(0.99) !important;
}

.search-result-item .mud-stack {
    width: 100%;
    align-items: flex-start !important;
    gap: 0 !important;
}

.search-result-text-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
}

.search-result-name {
    font-weight: var(--fw-xbold) !important;
    color: var(--color-text-secondary) !important;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
    margin-bottom: 2px !important;
    font-family: var(--font-heading);
    font-style: normal;
    line-height: var(--text-action-md-lh);
}

.search-result-address {
    color: var(--color-text-primary) !important;
    line-height: 1.2;
    font-size: 14px;
    font-weight: var(--fw-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
    margin-bottom: 2px !important;
    font-family: var(--font-body);
    font-style: normal;
}

.search-result-distance {
    color: var(--color-border-subtle) !important;
    font-weight: var(--fw-normal);
    font-size: 14px !important;
    line-height: var(--text-action-md-lh);
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-style: normal;
}

/* 40x40, matching .favorite-star-html on the list rows — was 55x55, the only other size on the page. */
.search-result-favorite-star {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    cursor: pointer;
    margin-left: var(--space-1);
    /* Real <button> (was a <span>) — strip the UA button chrome. */
    background: none;
    border: none;
    font: inherit;
    color: inherit;
}

/* ── Map styles ───────────────────────────────────────────── */
.content-container-fullscreen {
    flex-grow: 1;
    position: relative;
    width: 100%;
    min-height: 400px;
}

.current-location-button {
    position: absolute;
    bottom: 20px;
    /* LEFT, not right: Google's native zoom (+/-) cluster now sits at the map's bottom-right, so a
       bottom-right FAB would overlap it. Bottom-left is the free corner (clears the Google watermark). */
    left: 20px;
    background-color: var(--color-surface-default);
    border-radius: 50%;
    border: none;
    width: 48px;
    height: 48px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 500;
}

#current-location-button .location-icon {
    color: var(--color-brand-accent) !important;
    font-size: 24px !important;
}

/* ── List view ────────────────────────────────────────────── */
.list-container-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: transparent;
    padding: 0;
}

.no-locations {
    /* Was a fixed width:420px — wider than a phone viewport, so the empty state overflowed
       horizontally and (because #main-scroll-container's overflow-x computes to auto) scrolled/
       bounced left-right during vertical scroll. Cap at 420px but never exceed the available
       width, and stay centered. Desktop/tablet still render at 420px. */
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    align-self: center;
}

.list-container {
    max-width: 1048px !important;
    width: 100%;
    padding: var(--space-1) !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* No flex gap here: the count/Sort-By row's own 8px bottom padding provides the
       gap to the cards (matches reference: listhead padding-bottom = 8px). */
    gap: 0;
}

.scrollable-list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    max-height: calc(100vh - 65px);
}

/* The store list column shares the page's 16px gutter. The cards sat at 24 because TWO insets
   stacked: 16px from the column's own container plus `.list-container { padding: var(--space-1)
   !important }` (8px) — 16 + 8 = 24, while the logo, Set Location chip and "Stores" title all sit
   at 16. Zeroing only the HORIZONTAL half of that 8px leaves the outer 16 as the single gutter and
   keeps the 8px top/bottom, which is real breathing room for the card column rather than a gutter.
   !important is required to beat the shorthand above, which carries it.
   `.scrollable-list-container`'s 4px right padding is scrollbar clearance, not a gutter —
   deliberately untouched. */
#list-container.list-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Scrollbar styling */
.scrollable-list-container::-webkit-scrollbar,
.search-results-scrollable-container::-webkit-scrollbar {
    width: 6px;
}

.scrollable-list-container::-webkit-scrollbar-track,
.search-results-scrollable-container::-webkit-scrollbar-track {
    background: var(--color-surface-subtle);
    border-radius: 10px;
}

.scrollable-list-container::-webkit-scrollbar-thumb,
.search-results-scrollable-container::-webkit-scrollbar-thumb {
    background: var(--color-border-subtle);
    border-radius: 10px;
}

.scrollable-list-container::-webkit-scrollbar-thumb:hover,
.search-results-scrollable-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-disabled);
}

.list-item {
    margin-bottom: 8px;
    /* Real 1px border (was an inset box-shadow, which intermittently failed to repaint on the LAST
       card at the scroll boundary in the native WebView — the "sometimes missing border"). A real
       border paints with the box; box-sizing:border-box keeps the size identical, so no layout shift. */
    border: 1px solid var(--color-border);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    background-color: var(--color-surface-default) !important;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Hover only where there is a real pointer (mouse / trackpad). On a phone, WebKit leaves :hover
   stuck on the last card tapped, so that card kept a blue border until something else was tapped
   (seen on the iPhone simulator). v3.0.2 has this rule ungated. */
@media (hover: hover) {
    .list-item:hover {
        border-color: var(--color-brand-primary);
        box-shadow: var(--elevation-sm);
    }
}

/* Press state, as in v3.0.2: thicker border + 1% shrink + 20% darker.
   border-width only (not colour), so it composes with :hover above — a mouse press reads as a 2px
   brand-blue border, a touch press as 2px in the resting border colour. brightness(0.8) is the same
   "20% darker" press PressFeedback.css gives the CTA trio and the catch-all, so the row presses like
   every other button. It darkens the whole card, label and star included. */
.list-item:active {
    border-width: 2px;
    filter: brightness(0.8);
}

/* The shrink needs BOTH !important AND extra specificity, which is why it is split out.
   `.mud-paper:hover { transform: none !important }` (SavedItems.css) is unscoped and app-wide, a
   mouse press matches :hover as well as :active, and SavedItems.css is linked AFTER this file in both
   hosts — so an equal-specificity important rule here would lose on source order and the shrink would
   never happen. Matching .mud-paper as well makes this (0,3,0), which wins outright. The row really
   carries both classes, but it does tie the shrink to the row staying a MudPaper. */
.mud-paper.list-item:active {
    transform: scale(0.99) !important;
}

.list-item .mud-stack {
    width: 100%;
    align-items: flex-start !important;
    gap: 0 !important;
}

.list-text-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
}

.location-name_store {
    color: var(--color-text-primary) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
    margin-bottom: 2px !important;
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--text-action-md-size);
    font-weight: var(--fw-bold);
    line-height: var(--text-action-md-lh);
    letter-spacing: 0.2px;
}

.location-address_store {
    color: var(--color-text-primary) !important;
    line-height: 1.2;
    font-size: var(--text-action-md-size);
    font-weight: var(--fw-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
    margin-bottom: 2px !important;
    font-family: var(--font-body);
    font-style: normal;
}

.location-zipcode {
    color: var(--color-text-primary);
    margin-top: -4px;
    font-family: var(--font-body);
    font-size: 14px;
    font-style: normal;
    font-weight: var(--fw-normal);
    line-height: var(--text-action-md-lh);
}

.location-distance {
    color: var(--color-text-muted) !important;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-size: var(--text-action-md-size);
    font-style: normal;
    font-weight: var(--fw-normal);
    line-height: var(--text-action-md-lh);
}

/* A real <button>, so it carries the UA button-chrome reset a <span> never needed: background and
   border zeroed, and the inherited font restored so the browser's default button font cannot resize
   the glyph. Geometry is unchanged, which is why it still measures 40x40. */
.favorite-star-html {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    cursor: pointer;
    margin-left: var(--space-1);
    background: none;
    border: none;
    font: inherit;
    color: inherit;
}

/* ── Loading states ───────────────────────────────────────── */
.list-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.search-results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

/* ── Favourite spinner ────────────────────────────────────── */
.star-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Utility ──────────────────────────────────────────────── */
.mud-stack {
    gap: 0 !important;
}

.search-result-text-content .mud-typography-body2,
.search-result-text-content .mud-typography-subtitle1,
.search-result-text-content .mud-typography-caption {
    margin-bottom: 0 !important;
    line-height: 1.2;
}

.search-result-name    { margin-bottom: 2px !important; }
.search-result-address { margin-bottom: 2px !important; }
.search-result-distance { margin-bottom: 0 !important; }

.list-text-content .mud-typography-body2,
.list-text-content .mud-typography-subtitle1,
.list-text-content .mud-typography-caption {
    line-height: 1.2;
}

.location-name_store    { margin-bottom: 4px !important; }
.location-address_store { margin-bottom: 4px !important; }
.location-distance      { margin-bottom: 0 !important; }

/* Selected row: grey background + outline applied while the store-details
   drawer is open for this row, so the user can see which store the drawer
   belongs to. Cleared automatically when the drawer closes.
   Uses outline (not border) so the row width stays identical to its
   unselected siblings — no layout shift between rows. */
.list-item.list-item-selected,
.search-result-item.search-result-item-selected {
    background-color: var(--color-surface-default) !important;
    /* Match the reference highlight: 1px inset brand-blue border + subtle shadow
       (same as the card hover), instead of a thick outline or gray fill. */
    box-shadow: inset 0 0 0 1px var(--color-brand-primary), var(--elevation-sm) !important;
}

/* ── Map container ────────────────────────────────────────── */
.map-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Custom zoom (+/-) control styled to match the Leaflet reference:
   a rounded white bar, stacked buttons split by a thin divider. */
.fc-map-zoom {
    display: flex;
    flex-direction: column;
    margin: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
}

.fc-map-zoom-btn {
    width: 30px;
    height: 30px;
    line-height: 30px;
    padding: 0;
    border: none;
    background: #fff;
    color: #333;
    font: bold 18px 'Lucida Console', Monaco, monospace;
    text-align: center;
    cursor: pointer;
    display: block;
    user-select: none;
}

.fc-map-zoom-btn:first-child {
    border-bottom: 1px solid #ccc;
}

.fc-map-zoom-btn:hover {
    background: #f4f4f4;
}

/* "My location" navigation button (bottom-left) — matches the reference .fc-stores-mybtn. */
.fc-map-locate {
    margin: 16px;
}

.fc-map-locate-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md, 12px);
    background: var(--color-surface-default, #FFFFFF);
    border: 1px solid var(--color-border, #E0E0E0);
    color: var(--color-brand-accent, #B50407);
    font-size: 20px;
    cursor: pointer;
}

.map-display {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: var(--radius-lg);
}

/* Desktop: fit the map + list scroll area to the visible viewport. The header,
   "Stores" title and count row occupy ~150-215px above the content, so the
   full-100vh map/list previously ran past the bottom of the screen (no page
   scroll), cutting off the list scrollbar and leaving dead space. Cap the
   heights so the list scrolls fully within view with no wasted space.
   Mobile keeps its full-screen map (rules below the 701px breakpoint). */
@media (min-width: 701px) {
    /* Topbar (~100px) sits above .main-background inside the scroll container, so a full
       100vh background overruns the viewport by the topbar height, leaving empty gradient
       (scrollable dead space) below the map/list. Subtract the topbar height so the
       topbar + store content fill exactly the viewport, with the footer directly below. */
    /* Definite height (viewport minus the ~100px topbar) so the flex children below
       fill it EXACTLY. Was min-height, which — combined with the fixed content-row
       height below not accounting for the location bar — let the page overflow by
       ~one row and half-scroll (felt "stuck", and the map captured the wheel). */
    .main-background {
        height: calc(100vh - 100px);
        min-height: 0;
    }

    /* Fill whatever space is left after the location bar + "Stores" title (flex),
       instead of a fixed calc that overshot by the location bar's height. main-background
       is a flex column, so flex:1 + min-height:0 sizes this to the remaining area and
       lets the list scroll internally with no page overflow. */
    #main-content-container {
        flex: 1 1 auto;
        min-height: 0;
    }

    .list-container-wrapper,
    .list-container {
        height: 100%;
        min-height: 0;
    }

    .map-container {
        height: 100%;
    }

    .scrollable-list-container {
        max-height: none;
        min-height: 0;
        flex: 1 1 0;
    }
}

/* ── Mobile (phones): whole-page scroll for the LIST view ──────────────────
   Requested: the store list should scroll with the whole page, not inside its own
   div (matching the desktop-mobile layout). Let the list containers flow at their
   natural height so #main-scroll-container is the single scroller. Scoped to
   :not(.store-map-mode) so the Map view keeps its fixed full-height layout. */
/* 1024, not 700, and it must match the `display: block` breakpoint above. List mode drops
   .main-background to a block at <=1024px, and in a block context `flex: 1 1 0` on the list resolves
   its basis to 0 - the column has no definite height to share out - so the rows collapse and the
   list renders empty under "N stores found". These rules are what make the block context work, so
   they have to cover the same range. Stopping at 700px left 701-1024 broken: phones were fine,
   tablets in PORTRAIT were not, and the same tablet in landscape (>1024) was fine because it keeps
   the flex layout. Map mode is excluded by :not(), so it keeps flex as before. */
@media (max-width: 1024px) {
    .main-background:not(.store-map-mode) .content-container-fullscreen {
        min-height: 0;
    }
    .main-background:not(.store-map-mode) .list-container-wrapper,
    .main-background:not(.store-map-mode) .list-container {
        height: auto;
        min-height: 0;
        max-height: none;
    }
    .main-background:not(.store-map-mode) .scrollable-list-container {
        overflow-y: visible;
        max-height: none;
        flex: none;
    }
}

/* The same set for a native shell at ANY width, so a tablet in landscape gets the block layout it
   needs to go with the `display: block` above. Without these the list keeps `flex: 1 1 0` and
   collapses, the way tablet portrait did before the breakpoint above was widened to 1024. */
html.fc-native-shell .main-background:not(.store-map-mode) .content-container-fullscreen {
    min-height: 0;
}
/* Written with the ID on purpose. `@media (min-width: 1025px) { #main-content-container { height:
   calc(100vh - 196px) } }` is the desktop rule, and an ID beats the class selectors above - so in
   LANDSCAPE this box stayed pinned (624px on an 820px-tall iPad) while the list inside it was
   3180px. The list overflowed it exactly as it overflowed .main-background in portrait, and the
   last rows went behind the tab bar again. Same reasoning as the block above: a device never gets
   the desktop split view, so the box must wrap its content and let the page scroll. */
html.fc-native-shell .main-background:not(.store-map-mode) #main-content-container {
    height: auto;
}
html.fc-native-shell .main-background:not(.store-map-mode) .list-container-wrapper,
html.fc-native-shell .main-background:not(.store-map-mode) .list-container {
    height: auto;
    min-height: 0;
    max-height: none;
}
html.fc-native-shell .main-background:not(.store-map-mode) .scrollable-list-container {
    overflow-y: visible;
    max-height: none;
    flex: none;
}

/* ── ≤1024px: supply the page's 16px horizontal gutter ─────────────────────
   The gutter is carried by `.map_cls` (`padding: var(--space-2)`), and StoreLocator.razor applies
   that class ONLY when `_isDesktop` — so below 1025px there is no outer gutter at all.
   `#list-container.list-container` above then zeroes the column's own inset UNCONDITIONALLY,
   because at desktop the two stacked to 16 + 8 = 24. The arithmetic differs by breakpoint, so that
   fix left ≤1024px at 0 + 0 and the cards sat flush against both screen edges while "Stores" stayed
   at 16 (`.stores-title-bar` carries its own padding) — three different insets on one screen.
   Supply the missing outer gutter here so the cards align with the title, exactly as they do at
   ≥1025px. Deliberately does NOT touch the #list-container rule, which desktop still depends on.
   Map mode keeps its full-bleed layout through the same `:not(.store-map-mode)` scope. */
@media (max-width: 1024px) {
    .main-background:not(.store-map-mode) #main-content-container {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }
}

/* Desktop (≥1025px) shows the location bar (~48px) above the content, which the
   701px offset (148px) doesn't account for — grow the offset so the map + list
   still fill exactly the viewport. Placed after the 701px block so it wins. */
@media (min-width: 1025px) {
    #main-content-container {
        height: calc(100vh - 196px);
    }
}

.map_cls {
    max-width: 1280px;
    margin: 0 auto;
    gap: var(--space-2);
    padding: var(--space-2);
}

/* Sort By trigger — values are the reference's .fc-stores-sortbtn verbatim, which also matches the
   Homepage trigger's radius-lg. NOTE this changes the corner radius from the radius-md that
   .mud_card_cls used; that md value was the odd one out against both references. The overrides are
   only to undo MudButton's own defaults (uppercase, 64px min-width, Material elevation) so the
   reference values actually land. */
.fc-stores-sortbtn.mud-button-root {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 8px 16px;
    min-width: 0;
    background: var(--color-surface-default);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-size: var(--text-label-md-size);
    font-weight: var(--fw-bold);
    line-height: var(--text-label-md-lh);
    color: var(--color-text-primary);
    text-transform: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.fc-stores-sortbtn-icon { font-size: 14px; }

.card_cls {
    font-size: 14px;
    font-weight: var(--fw-bold);
    line-height: var(--text-body-md-lh);
    color: var(--color-text-primary);
    cursor: pointer;
}

.filter_cls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    /* Match reference .fc-stores-listhead dimensions: 4px horizontal inset, 8px below the row. */
    padding: 0 4px 8px;
}

.store_count_cls {
    font-size: var(--text-action-md-size);
    font-weight: var(--fw-normal);
    line-height: var(--text-body-md-lh);
    letter-spacing: 0.2px;
    color: var(--color-text-primary);
}

.mud_card_cls {
    border-radius: var(--radius-md);
    box-shadow: none !important;
    border: 1px solid var(--color-border);
}

/* Sort By button text — match reference .fc-stores-sortbtn: Inter, 14/700, black,
   tight line-height so the button height matches (~34px). Content inside unchanged. */
.mud_card_cls .mud-card-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: var(--text-label-md-size);
    font-weight: var(--fw-bold);
    line-height: var(--text-label-md-lh);
    color: var(--color-text-primary);
}

/* ── Sort drawer animations ───────────────────────────────── */
@keyframes store_sort_drawer_slide_up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes store_sort_drawer_slide_down {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
}

.store_sort_drawer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto !important;
    height: auto !important;
    max-height: 90vh;
    width: 100% !important;
    max-width: 700px;
    margin: 0 auto !important;
    background-color: var(--color-surface-default);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    overflow-y: auto;
    z-index: 1300;
    animation: store_sort_drawer_slide_up 0.3s ease-out;
    will-change: transform;
}

.store_sort_drawer.store_sort_drawer--closing {
    animation: store_sort_drawer_slide_down 0.28s ease-in forwards;
}

@media (min-width: 745px) {
    .store_sort_drawer {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
    }

    @keyframes store_sort_drawer_slide_up {
        from { transform: translate(-50%, 100%); }
        to   { transform: translate(-50%, 0); }
    }

    @keyframes store_sort_drawer_slide_down {
        from { transform: translate(-50%, 0); }
        to   { transform: translate(-50%, 100%); }
    }
}

.store_sort_radio {
    border-radius: var(--radius-lg);
    width: 100%;
}

.store_sort_radio:hover {
    background: var(--color-border);
}

.radio_group_cls {
    width: 100%;
}

.store_sort_drawer .mud-drawer-content {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Handle bar */
.drawer_handle {
    width: 48px;
    height: 4px;
    background-color: var(--color-border);
    border-radius: 99px;
    margin: var(--space-1) auto 4px;
}

/* Drawer header */
.sort_drawer_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-1) var(--space-2) var(--space-1) 20px !important;
}

.sort_header_left {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.drawer_header_text {
    font-size: 20px !important;
    font-weight: var(--fw-bold) !important;
    color: var(--color-text-primary) !important;
}

/* Radio list */
.sort_radio_list {
    flex: 1;
    padding: var(--space-1) var(--space-2);
    display: flex;
    flex-direction: column;
    margin-top: -20px;
}

.sort_radio_list .mud-radio-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
}

.store_sort_radio {
    width: 100% !important;
    border-radius: 10px !important;
    padding: 0px 14px !important;
    margin: 0 !important;
}

.store_sort_radio .mud-icon-button {
    background-color: transparent !important;
    /* Brand blue overrides MudBlazor's default Color.Primary indigo on the
       radio circle (both unchecked outline and checked dot). */
    color: rgba(0, 79, 170, 1) !important;
}
.store_sort_radio .mud-icon-button:hover,
.store_sort_radio .mud-icon-button:focus { background-color: transparent !important; }

.store_sort_radio .mud-ripple,
.store_sort_radio .mud-ripple-radio { display: none !important; }

/* Force the SVG icon (the actual circle / dot) to inherit the brand blue. */
.store_sort_radio .mud-icon-root,
.store_sort_radio svg {
    color: rgba(0, 79, 170, 1) !important;
    fill: currentColor !important;
}

.store_sort_radio:has(input:checked) {
    background-color: rgba(0, 79, 170, 0.08) !important;
    border-radius: 10px !important;
}

.store_sort_radio:has(input:checked) .mud-radio-content,
.store_sort_radio:has(input:checked) .mud-typography {
    font-weight: var(--fw-bold) !important;
    color: var(--color-text-primary) !important;
}

.store_sort_radio .mud-radio-content,
.store_sort_radio .mud-typography {
    font-size: 15px;
    color: var(--color-text-primary);
}

/* Drawer footer.
   GRID, not flex, and that is deliberate: Momento's Button Row is two EXACTLY equal columns. With
   `display:flex` + `flex:1` on both buttons the split came out 279/281 in a 568px row where each
   should be 280 — the outlined Close button's border escapes the flex free-space split (MudBlazor
   also trims its padding 16→15 to compensate, which is what leaves the asymmetry). `1fr 1fr` sizes
   the TRACKS, so the buttons are equal no matter what borders or padding they carry. Both variants
   of this footer have exactly two children. */
.sort_drawer_footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-1);
    padding: var(--space-2);
    border-top: 1px solid var(--color-border);
}

/* Apply Changes button — vibrant red when there's a pending change.
   Muted when disabled (no change since last apply) so it reads as
   low-emphasis without disappearing entirely. */
.apply_changes_btn {
    flex: 1;
    background-color: var(--color-brand-accent) !important;
    color: var(--color-surface-default) !important;
    border-radius: var(--radius-lg) !important;
    font-family: var(--font-heading) !important;
    font-weight: var(--fw-bold) !important;
    font-size: var(--text-action-md-size) !important;
    text-transform: none !important;
    height: 56px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Hover deliberately NOT restyled here. This used to set `background-color: #8a0306 !important` — a
   DARKER red than the #B50407 resting fill — where the rest of the app's filled CTAs brighten on
   hover. Left to the shared treatment so this button behaves like its type. */

.apply_changes_btn:disabled,
.apply_changes_btn.mud-button-disabled {
    background-color: #c0685a !important;
    color: var(--color-surface-default) !important;
    opacity: 0.85;
    cursor: not-allowed;
    pointer-events: none;
}

/* Close button. border 1.5px, not 2px: 1.5px is the app's canonical Secondary weight
   (.fc-modal-cancel, .mudbutton-icon-outlined); this was the heaviest of the three different
   Secondary borders the Stores page shipped (1 / 1.5 / 2). Colour unchanged. font-family added for
   the same reason as .apply_changes_btn above. */
.close_btn {
    flex: 1;
    border: 1.5px solid var(--color-brand-primary) !important;
    color: var(--color-brand-primary) !important;
    border-radius: var(--radius-lg) !important;
    font-family: var(--font-heading) !important;
    font-weight: var(--fw-bold) !important;
    font-size: var(--text-action-md-size) !important;
    text-transform: none !important;
    height: 56px;
    background-color: transparent !important;
}

/* ── Sort By centered popup (MudDialog) ─────────────────────────
   Dimensions/spacing matched to the reference StoreSortModal (.fc-ssort):
   600px wide, 24px content padding, 4px option gaps, 10px/8px option padding,
   56px buttons, NO divider above the footer. */
.store_sort_dialog {
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    max-width: 600px;
}

/* Container geometry — reference_project_updated gets this from its shared Components/Modal.css,
   which puts a 16px inset on the SHELL, a 16px flex gap between the title/content/actions regions,
   and 0 padding on the regions themselves. main has no Modal.css and its other dialogs are tuned
   against MudBlazor's defaults, so it is scoped to this dialog. */
.store_sort_dialog.mud-dialog {
    padding: var(--space-2);
    gap: var(--space-2);
}
.store_sort_dialog .mud-dialog-content,
.store_sort_dialog .mud-dialog-actions {
    padding: 0 !important;
}
.store_sort_dialog .mud-dialog-content {
    min-height: 0;
    overflow: visible;
}
.store_sort_dialog .mud-dialog-actions { gap: var(--space-1); }

/* Header: title + close, with a clear gap (24px) before the options. */
.store_sort_dialog .sort_drawer_header {
    padding: 0 !important;
    margin-bottom: var(--space-3);
    min-height: 0;
}

/* Sort arrows — solid weight, same icon the page's Sort By trigger buttons use. */
.store_sort_dialog .sort_header_icon {
    font-size: 18px;
    color: var(--color-text-primary);
    line-height: 1;
}

/* Close (X) — plain round icon button with fa-solid fa-xmark (reference .fc-iconbtn). */
.store_sort_dialog .sort_close_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: -8px -8px -8px 0;   /* keep the glyph flush to the top-right without adding row height */
    border: none;
    border-radius: var(--radius-full);
    background: none;
    cursor: pointer;
    color: var(--color-text-primary);
    font-size: 18px;
    line-height: 1;
}

.store_sort_dialog .sort_close_btn:hover {
    background: var(--color-surface-subtle);
}

/* Options list: 4px gaps, no side padding (card padding handles it), no drawer offset. */
.store_sort_dialog .sort_radio_list {
    margin-top: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-half);
}

/* Reference option rows (.fc-ssort-opt) — compact, exact spacing. */
.store_sort_opt {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    width: 100%;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.store_sort_opt--on {
    background: color-mix(in srgb, var(--color-brand-primary) 10%, transparent);
}

.store_sort_radio_circle {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.store_sort_radio_circle--on {
    border-color: var(--color-brand-primary);
}

.store_sort_radio_dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-brand-primary);
}

.store_sort_opt_label {
    flex: 1;
    font-family: var(--font-body);
    font-size: var(--text-body-md-size);
    /* Pinned, not inherited: the document base line-height differs from the reference's
       (see the base-typography note), which made each option row 43px instead of 44px. */
    line-height: var(--text-body-md-lh);
    color: var(--color-text-primary);
}

.store_sort_opt--on .store_sort_opt_label {
    font-weight: var(--fw-bold);
}

/* Footer: no divider, 56px buttons. padding:0 here is CORRECT and must stay — .mud-dialog already
   pays the 16px inset above, so re-adding it here would double it to 32px. margin-top removed: the
   footer now lives in <DialogActions> and the shell's 16px flex gap already separates it. `flex: 1`
   makes it span .mud-dialog-actions (itself a flex row) so the 1fr 1fr grid still halves the row. */
.store_sort_dialog .sort_drawer_footer {
    padding: 0 !important;
    border-top: none !important;
    gap: var(--space-1);
    flex: 1;
}

.store_sort_dialog .apply_changes_btn,
.store_sort_dialog .close_btn {
    height: 56px;
}

/* Close button: force the brand-blue (#004FAA) border/text. MudButton's Outlined
   variant otherwise paints a lighter theme-primary border. */
.store_sort_dialog .close_btn,
.store_sort_dialog .close_btn.mud-button-root {
    border: 1.5px solid var(--color-brand-primary) !important;
    border-color: var(--color-brand-primary) !important;
    color: var(--color-brand-primary) !important;
    background-color: transparent !important;
}

/* Page-level loader: absolute overlay scoped to .main-background (which is
   position: relative). Topbar stays visible above it. The map container
   stays mounted in the DOM behind the loader so Google Maps can initialize
   while the user sees the loading state; both list + map become visible
   together once _isInitialLoadComplete flips.

   Height is capped at the visible viewport area so the FCLoader's flex
   centering aligns with the visible-area midpoint (otherwise .main-background
   extends past the viewport and the spinner ends up below center). */
.store-locator-init-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-default, #ffffff);
}

.store-locator-init-loader.with-topbar {
    /* Topbar is ~88px tall in browser mode; subtract it so the loader covers
       only the area visible below the Topbar. */
    height: calc(100vh - 88px);
}

.sticky_cls {
    position: sticky;
    z-index: 99;
}

.list_map_text_cls {
    font-size: var(--text-action-md-size);
    font-weight: var(--fw-bold);
    letter-spacing: 0.2px;
    line-height: var(--text-action-md-lh);
}

/* ── iOS fix: make the store-details bottom sheet scroll internally & keep its
   buttons above the tab bar ───────────────────────────────────────────────────
   Same two iOS-only bugs the #sort-filter-drawer block in app.css already solved
   (Android was unaffected):
   1) The sheet relies on MudDrawer's transform with no bottom:0 anchor, so on iOS
      it stretched to ~90dvh with the whole .custom-bottom-drawer as the scroller —
      which iOS wouldn't scroll, so the page BEHIND the sheet scrolled instead and
      the sheet stayed put. Making the drawer a strict flex column whose body
      (.store-drawer-content) is the ONLY scroller fixes the internal scroll.
   2) The fixed bottom tab bar (.custom-tabs-p / .mud-tabs-toolbar, z-index 1000)
      is a later sibling of .page, so in the WebView it paints ON TOP of the sheet
      (whose 1300 z-index is trapped in .page's stacking context) and covered the
      Get Directions / favorite / inventory buttons. Hide it while the sheet is open.
   #store-location-drawer is the mobile-only MudDrawer (web uses .store-details-dialog),
   so these rules never touch web/desktop. */
#store-location-drawer.custom-bottom-drawer {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#store-location-drawer .store-drawer-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

html:has(#store-location-drawer.drawer-open) .custom-tabs-p,
html:has(#store-location-drawer.drawer-open) .mud-tabs-toolbar {
    display: none !important;
}

/* ── KEPT FROM MAIN ──────────────────────────────────────────────
   Rules the reference project does not have. Appended after its stylesheet so they
   still win on equal specificity, exactly as they did before the import. */
/* ── Store-detail action buttons: keep labels on ONE line as the drawer narrows ──────────────
   The two side-by-side buttons (Get Directions | View Store Inventory) each get half the width,
   so on mobile / mobile-desktop widths MudButton's Size.Large label (15px + ~22px side padding)
   wrapped to two lines. Match the reference (14px label, tight side padding) and step the size
   down further on small phones so the labels scale WITH the screen instead of wrapping. */
#get-directions-button,
#view-store-inventory-button {
    font-size: 14px;
}
#get-directions-button.mud-button-root,
#view-store-inventory-button.mud-button-root {
    padding-left: 10px;
    padding-right: 10px;
}
#get-directions-button .mud-button-label,
#view-store-inventory-button .mud-button-label {
    font-size: inherit;
}
/* ── Map view on mobile/tablet: fixed, non-scrolling full screen ──────────────
   In MAP view the page must NOT scroll — the map fills the area below the header
   (reference .fc-stores--mapmode). Scoped via :has() to the stores page in map
   mode only, so list view and every other page are unaffected. Flexbox fills the
   map to the exact remaining height (no pixel guessing). */
@media (max-width: 1024px) {
    /* Lock the app scroll container so the map screen is fixed. */
    #main-scroll-container:has(.main-background.store-map-mode) {
        overflow: hidden;
    }

    /* Make the page column (topbar + main-background) fill exactly one viewport. */
    #main-scroll-container:has(.main-background.store-map-mode) > article {
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .main-background.store-map-mode {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        /* Map mode wants NO bottom gap — the map runs to the top edge of the tab bar. On native,
           BottomDrawer gives every .fc-home-scrollwrap (this element) a 16px breathing gap for
           LIST content; with box-sizing:border-box that gap comes out of the map's own area, so
           the map stopped short of the bar. It used to be a 90px copy of the whole tab-bar
           clearance, which is most of why the map read as "not fitted" on device. */
        padding-bottom: 0 !important;
        /* Be a flex COLUMN so #main-content-container's flex:1 actually resolves — without this the
           child collapsed to content height and the map fell back to .map-display's min-height:400px
           floor, leaving white space below the map on tall phones (v3.0.2 map-fill fix). */
        display: flex;
        flex-direction: column;
    }

    /* The content row and the map fill the space left under the location bar + toggle.
       EXPLICIT height, not flex-grow: the reference carries the same rule with a measured note
       that flex-grow does NOT distribute through this chain on the device WebView — the child
       keeps its content basis and the map falls back to .map-display's `min-height: 400px` floor,
       leaving white space between the map and the tab bar (reported 2026-09-03, Android).
       Every term is a value the app already publishes, so this cannot drift with header content:
       --native-header-h and --fc-location-h are measured and written by fcNativeHeader in
       ScrollPositionHelper.js on every layout pass, and the tab-bar term is the same clearance
       app.css puts on #main-scroll-container. 100dvh (not vh) so mobile viewport changes are
       accounted for. `flex: none` stops flex from re-deriving it.
       Verified against Chromium's own flex result at 412x800 before the switch: 800-156-108-0=536
       and 800-156-108-80=456 both matched the measured heights exactly, so web geometry is
       unchanged and only the WebView's failed distribution is fixed. */
    .main-background.store-map-mode #main-content-container {
        /* Tab-bar clearance is NATIVE-ONLY — MainLayout puts `has-bottomnav` on `.page` under
           !isBrowser, so the mobile browser has no bottom tab bar and must not subtract for one. */
        --fc-storeloc-tabclear: 0px;
        flex: none;
        height: calc(100dvh
                     - var(--native-header-h, 0px)
                     - var(--fc-location-h, 0px)
                     - var(--fc-storeloc-tabclear));
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .page.has-bottomnav .main-background.store-map-mode #main-content-container {
        --fc-storeloc-tabclear: calc(56px + var(--fc-tabbar-pad-bottom));
    }

    .main-background.store-map-mode .map-container {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    /* Fill the (now definite) map-container instead of collapsing to the 400px floor. */
    .main-background.store-map-mode .map-display {
        height: 100%;
        min-height: 0;
    }

    /* No sticky in map mode — the screen is fixed, so keep the bar in normal flow. */
}
.search-result-item {
    margin-bottom: 12px;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background-color: var(--color-surface-default) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
}
.search-result-item:hover {
    background-color: var(--color-surface-subtle) !important;
    transform: translateY(-2px);
    box-shadow: var(--elevation-sm);
}
.search-result-favorite-star {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    cursor: pointer;
    margin-left: 12px;
    /* Real <button> (was a <span>) — strip the UA button chrome. */
    background: none;
    border: none;
    font: inherit;
    color: inherit;
}
.list-item:hover {
    border-color: var(--color-brand-primary);
    box-shadow: var(--elevation-sm);
}
.favorite-star-html {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    cursor: pointer;
    margin-left: 12px;
}
