/* ==========================================================================
   Helados De la Casa — Dónde comprar (loads after brand.css)
   ========================================================================== */

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

[hidden] { display: none !important; }

button { font: inherit; color: inherit; cursor: pointer; }

.pill { border: 0; }
.pill:disabled { opacity: .6; cursor: progress; }
.pill--gold { background: var(--gold); color: var(--navy); }
.pill--gold:hover { box-shadow: 0 6px 0 0 var(--navy); }

.link-arrow { background: none; border-left: 0; border-right: 0; border-top: 0; padding: 0 0 2px; }

.topbar__nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Layout ---------- */

.finder {
    display: grid;
    grid-template-columns: minmax(340px, 440px) 1fr;
    height: calc(100vh - 69px);
    height: calc(100svh - 69px);
}

.panel {
    position: relative;
    overflow-y: auto;
    padding: 2.4rem clamp(1.25rem, 3vw, 2.4rem) 3rem;
    background: var(--paper);
    border-right: 1px solid color-mix(in srgb, var(--mist) 45%, transparent);
    scrollbar-width: thin;
    scrollbar-color: var(--mist) transparent;
}
/* a strip of the pot pattern fading out behind the heading */
.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 220px;
    background-image: var(--pattern-light);
    background-size: 108px 72px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
            mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
    pointer-events: none;
}
.panel > * { position: relative; }

.panel__head h1 {
    font-size: clamp(2.1rem, 3.2vw, 2.8rem);
    font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 144;
    margin-bottom: .7rem;
}
.panel__head h1 em {
    font-style: italic;
    font-weight: 600;
    font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
    color: var(--gold-ink);
}
.panel__count {
    margin: 0 0 1.8rem;
    font-size: .8rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--navy) 65%, transparent);
}

/* ---------- Search ---------- */

.search {
    display: flex;
    gap: .4rem;
    padding: .35rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1.5px var(--navy), 0 14px 30px -18px rgba(17, 40, 74, .5);
    transition: box-shadow .3s;
}
.search:focus-within { box-shadow: 0 0 0 3px var(--gold), 0 14px 30px -18px rgba(17, 40, 74, .5); }
.search input {
    flex: 1;
    min-width: 0;
    padding: 0 1rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: .98rem;
    color: var(--navy);
    outline: none;
}
.search input::placeholder { color: color-mix(in srgb, var(--navy) 45%, transparent); }
.search .pill { padding: .75em 1.4em; }

.locate {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin: 1rem 0 0 .6rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}
.locate__dot {
    width: .7rem; height: .7rem;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 30%, transparent);
}

.search-status { min-height: 1.5em; margin: .8rem 0 0 .6rem; font-size: .9rem; font-weight: 300; }
.search-status.is-error { color: #a3261b; font-weight: 400; }

/* ---------- Nearest result ---------- */

.nearest {
    margin: 1rem 0 2.2rem;
    padding: 1.6rem 1.6rem 1.4rem;
    border-radius: 24px;
    background-color: var(--navy);
    color: var(--cream);
    opacity: 0;
    transform: translateY(14px) scale(.98);
    transition: opacity .6s var(--ease-out), transform .7s var(--ease-spring);
}
.nearest.is-in { opacity: 1; transform: none; }
.nearest .eyebrow { margin-bottom: .6rem; }
.nearest h2 { font-size: 1.9rem; margin-bottom: .4rem; color: #fff; }
.nearest__address { margin: 0; font-weight: 300; opacity: .85; }
.nearest__distance {
    margin: .5rem 0 1.3rem;
    font-size: .78rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
}
.nearest__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }
.nearest .link-arrow { color: var(--cream); }

/* ---------- List ---------- */

.list-title {
    margin: 2.2rem 0 .6rem;
    font-family: var(--sans);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .34em;
    text-transform: uppercase;
}
.nearest:not([hidden]) + .list-title { margin-top: 0; }

.locations { list-style: none; margin: 0; padding: 0; }

.loc {
    display: flex;
    align-items: center;
    gap: .8rem;
    border-top: 1px solid color-mix(in srgb, var(--mist) 55%, transparent);
    transition: background .25s;
}
.loc:last-child { border-bottom: 1px solid color-mix(in srgb, var(--mist) 55%, transparent); }
.loc:hover,
.loc.is-active { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.loc.is-active { box-shadow: inset 4px 0 0 var(--gold); }

.loc__main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: .15rem;
    padding: .95rem .2rem .95rem .7rem;
    border: 0;
    background: none;
    text-align: left;
}
.loc__main strong {
    font-family: var(--serif);
    font-variation-settings: "SOFT" 100, "WONK" 0;
    font-weight: 700;
    font-size: 1.12rem;
    line-height: 1.2;
}
.loc__main span { font-size: .85rem; font-weight: 300; line-height: 1.4; opacity: .8; }

.loc__side { display: grid; justify-items: end; gap: .35rem; padding-right: .5rem; }
.loc__distance { font-size: .72rem; letter-spacing: .12em; color: var(--gold-ink); font-weight: 500; white-space: nowrap; }
.loc__go {
    padding: .4em .95em;
    border: 1.5px solid var(--navy);
    border-radius: 999px;
    background: transparent;
    font-size: .8rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background .25s, color .25s;
}
.loc__go:hover { background: var(--navy); color: var(--paper); }

.loc__main:focus-visible,
.loc__go:focus-visible,
.locate:focus-visible,
.app:focus-visible,
.sheet__cancel:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Map ---------- */

.map-wrap { position: relative; padding: 14px; background: var(--paper); }
#map {
    width: 100%;
    height: 100%;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--mist) 60%, transparent);
}

.map-status {
    position: absolute;
    top: 30px; left: 30px;
    padding: .45em 1em;
    border-radius: 999px;
    background: var(--navy);
    color: var(--cream);
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    pointer-events: none;
}

/* Balloon pins, lifted from the logo mark */
.pin {
    width: 34px;
    height: 40px;
    padding: 0;
    border: 0;
    background: var(--mark) center / contain no-repeat;
    filter: drop-shadow(0 4px 3px rgba(11, 28, 54, .35));
    animation: drop .7s var(--ease-spring) both;
    animation-delay: calc(var(--i) * 40ms + 300ms);
}
.pin:hover,
.pin.is-active { z-index: 2; }
.pin.is-active { width: 46px; height: 54px; animation: drop .7s var(--ease-spring) both, float 3s ease-in-out .7s infinite; }
@keyframes drop { from { opacity: 0; translate: 0 -40px; } to { opacity: 1; translate: 0 0; } }
@keyframes float { 50% { translate: 0 -6px; } }

/* You-are-here */
.me {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--gold);
    border: 3px solid #fff;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 60%, transparent);
    animation: ping 2s ease-out infinite;
}
@keyframes ping { to { box-shadow: 0 0 0 18px transparent; } }

/* Popups */
.brand-popup .maplibregl-popup-content {
    padding: 1.1rem 1.2rem 1.1rem;
    border-radius: 18px;
    background: var(--paper);
    color: var(--navy);
    font-family: var(--sans);
    box-shadow: 0 18px 40px -18px rgba(11, 28, 54, .55), 0 0 0 1px color-mix(in srgb, var(--mist) 50%, transparent);
}
.brand-popup .maplibregl-popup-tip { border-top-color: var(--paper); border-bottom-color: var(--paper); }
.brand-popup .maplibregl-popup-close-button { font-size: 1.2rem; padding: .2rem .55rem; color: var(--navy); }
.brand-popup h3 { font-size: 1.15rem; margin: 0 1.2rem .35rem 0; }
.brand-popup p { margin: 0 0 .5rem; font-size: .85rem; font-weight: 300; line-height: 1.45; }
.brand-popup .popup__internal {
    padding: .4rem .6rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--gold-soft) 70%, transparent);
    font-weight: 400;
}
.brand-popup .pill { margin-top: .3rem; }

.maplibregl-ctrl-group { border-radius: 14px !important; overflow: hidden; box-shadow: 0 6px 18px -8px rgba(11, 28, 54, .4) !important; }

/* ---------- Directions sheet ---------- */

.sheet {
    width: min(94vw, 420px);
    max-height: 92vh;
    margin: auto;
    padding: 1.8rem 1.6rem 1.4rem;
    border: 0;
    border-radius: 28px;
    background: var(--paper);
    color: var(--navy);
    box-shadow: 0 30px 80px -20px rgba(11, 28, 54, .6);
}
.sheet::backdrop { background: rgba(11, 28, 54, .55); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in .45s var(--ease-spring); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px) scale(.97); } }

.sheet__grip { display: none; }
.sheet .eyebrow { margin-bottom: .4rem; }
.sheet h2 { font-size: 1.8rem; margin-bottom: .3rem; }
.sheet__address { margin: 0 0 1.4rem; font-size: .9rem; font-weight: 300; }

.apps { display: grid; gap: .6rem; }
.app {
    display: flex;
    align-items: center;
    gap: .9rem;
    width: 100%;
    padding: .8rem 1rem;
    border: 1.5px solid color-mix(in srgb, var(--mist) 70%, transparent);
    border-radius: 18px;
    background: #fff;
    text-align: left;
    transition: border-color .25s, transform .3s var(--ease-spring), box-shadow .3s;
}
.app:hover { border-color: var(--navy); transform: translateY(-2px); box-shadow: 0 10px 20px -14px rgba(11, 28, 54, .6); }
.app__badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.6rem; height: 2.6rem;
    border-radius: 12px;
    font-family: var(--serif);
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
}
.app__badge--waze { background: #33ccff; color: #0b1c36; }
.app__badge--google { background: #34a853; }
.app__badge--apple { background: #1d1d1f; }
.app__badge--geo { background: var(--gold); color: var(--navy); }
.app__text { display: grid; line-height: 1.25; }
.app__text strong { font-weight: 600; }
.app__text small { font-size: .8rem; font-weight: 300; opacity: .75; }

.remember {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1.2rem 0 .4rem;
    font-size: .88rem;
    cursor: pointer;
}
.remember input { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); }

.sheet__cancel {
    width: 100%;
    margin-top: .6rem;
    padding: .8rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font-weight: 500;
    letter-spacing: .04em;
}
.sheet__cancel:hover { background: color-mix(in srgb, var(--mist) 25%, transparent); }

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 24px;
    width: max-content;
    margin-inline: auto;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: calc(100vw - 32px);
    padding: .75rem .9rem .75rem 1.3rem;
    border-radius: 999px;
    background: var(--navy);
    color: var(--cream);
    font-size: .9rem;
    box-shadow: 0 18px 40px -16px rgba(11, 28, 54, .7);
    transform: translateY(160%);
    transition: transform .45s var(--ease-spring);
}
.toast.is-in { transform: none; }
.toast button {
    flex: none;
    padding: .45em 1em;
    border: 0;
    border-radius: 999px;
    background: var(--gold);
    color: var(--navy);
    font-size: .8rem;
    font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .finder { display: flex; flex-direction: column; height: auto; }
    .map-wrap { order: -1; height: 52svh; min-height: 340px; padding: 10px; }
    .map-status { top: 22px; left: 22px; }
    .panel { overflow: visible; border-right: 0; padding-top: 1.8rem; }

    /* the picker becomes a bottom sheet */
    .sheet {
        width: 100%;
        max-width: 100%;
        margin: auto 0 0;
        padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
    }
    .sheet[open] { animation: sheet-up .45s var(--ease-out); }
    .sheet__grip {
        display: block;
        width: 44px; height: 5px;
        margin: -.6rem auto 1.2rem;
        border-radius: 99px;
        background: var(--mist);
    }
    @keyframes sheet-up { from { transform: translateY(100%); } }
}
