/* ==========================================================================
   The location bar — "Share your location to shop local"

   A strip the height of the search bar, pinned under the fixed header. It
   replaced a full-screen modal: the question is worth asking, it is not
   worth covering the shop with.

   --pp-loc-top is written by master.blade.php from the header's measured
   height, because the header is .fixed-top and its height changes with the
   breakpoint. The fallback keeps the bar roughly right if the script never
   runs.
   ========================================================================== */

.pp-locbar {
    position: fixed;
    top: var(--pp-loc-top, 86px);
    left: 0;
    right: 0;
    /* Under the header (1030) and the offcanvas drawers, over the page. */
    z-index: 1028;

    background: #F2EAD4;
    border-bottom: 1.5px solid #356746;
    box-shadow: 0 6px 18px rgba(47, 42, 31, 0.12);
    font-family: 'Planc', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    color: #2f2a1f;

    /* Slides out from under the header. Starts up behind it, so the header
       hides the travel and the strip appears to come from the bar itself. */
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 240ms cubic-bezier(.22, 1, .36, 1), opacity 180ms ease;
}

.pp-locbar.is-shown {
    transform: translateY(0);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .pp-locbar { transition: opacity 120ms ease; transform: none; }
}

.pp-locbar-inner {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    /* A notched phone in landscape puts the cutout in the side gutter. */
    padding: 9px max(16px, env(safe-area-inset-right, 0px)) 9px max(16px, env(safe-area-inset-left, 0px));
}

.pp-locbar-prompt {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: #284f36;
}

.pp-locbar-prompt i {
    font-size: 18px;
    color: #356746;
    flex-shrink: 0;
}

.pp-locbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
}

.pp-locbar-zip {
    width: 94px;
    flex: 0 0 auto;
    background: #fff;
    border: 1.5px solid #356746;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #2f2a1f;
    outline: none;
}

.pp-locbar-zip::placeholder {
    color: #8a7a62;
    font-weight: 500;
    letter-spacing: normal;
}

.pp-locbar-zip:focus {
    box-shadow: 0 0 0 3px rgba(181, 190, 128, 0.45);
}

/* Neon fill, brown-dirt text — never neon text on cream. */
.pp-locbar-go {
    flex: 0 0 auto;
    background: #EDFA70;
    border: 1.5px solid #5E4C2A;
    border-radius: 38px;
    padding: 9px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5E4C2A;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.pp-locbar-go:hover,
.pp-locbar-go:focus-visible {
    background: #5E4C2A;
    color: #EDFA70;
}

.pp-locbar-go[disabled] { opacity: .6; cursor: progress; }

.pp-locbar-or {
    font-size: 12.5px;
    color: #5E4C2A;
    opacity: .8;
    flex: 0 0 auto;
}

.pp-locbar-geo {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: transparent;
    border: 1.5px solid #5E4C2A;
    border-radius: 38px;
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.1;
    color: #5E4C2A;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.pp-locbar-geo:hover,
.pp-locbar-geo:focus-visible {
    background: #5E4C2A;
    color: #F2EAD4;
}

.pp-locbar-geo svg { flex-shrink: 0; }

.pp-locbar-x {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: #5E4C2A;
    font-size: 18px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.pp-locbar-x:hover,
.pp-locbar-x:focus-visible { background: rgba(94, 76, 42, .12); }

/* Failures take their own full-width line so the row above never reflows. */
.pp-locbar-error,
.pp-locbar-hint {
    flex: 1 0 100%;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
}

.pp-locbar-error { color: #b4452f; }

/* Calm, not the error treatment: a browser with location switched off is a
   normal state, not something the shopper did wrong. */
.pp-locbar-hint {
    color: #5E4C2A;
    background: #d8d2c0;
    border-left: 3px solid #B5BE80;
    border-radius: 8px;
    padding: 8px 10px;
}

.pp-locbar-hint summary {
    cursor: pointer;
    color: #356746;
    font-weight: 600;
    font-size: 12px;
}

.pp-locbar-hint ol {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
}

.pp-locbar-hint p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }

.pp-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Narrow ───────────────────────────────────────────────────────────────
   Three short lines: the prompt with the close button on it, then ZIP and Go,
   then the geolocation button across the full width. "Use my current
   location" does not fit beside a ZIP field on a phone — squeezed onto that
   row it either clips or shrinks the field to nothing — and it is the easier
   of the two answers, so it gets a whole row and a real tap target. Three
   compact lines is still a bar; the modal it replaced was most of a screen. */
@media (max-width: 719px) {
    .pp-locbar-inner { padding-top: 8px; padding-bottom: 9px; gap: 8px; }

    /* Clear of the close button. */
    .pp-locbar-prompt { flex: 1 1 100%; font-size: 13.5px; padding-right: 38px; }

    .pp-locbar-controls { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; }

    .pp-locbar-x { position: absolute; top: 5px; right: 8px; }

    .pp-locbar-zip { flex: 1 1 96px; width: auto; min-width: 0; }
    .pp-locbar-go { flex: 0 0 auto; }
    .pp-locbar-geo { flex: 1 1 100%; padding: 10px 12px; }
    .pp-locbar-or { display: none; }
}

@media (max-width: 400px) {
    .pp-locbar-geo { font-size: 12.5px; }
    .pp-locbar-go { padding: 9px 15px; }
}
