/* Public map block with several branches. Today's single map styles stay in public-blocks.css. */

.slb-branches {
    --slm-soft: color-mix(in srgb, var(--text-h) 72%, transparent);
    --slm-fill: color-mix(in srgb, var(--text-h) 5%, transparent);
    --slm-line: color-mix(in srgb, var(--text-h) 14%, transparent);
    --slm-tint: color-mix(in srgb, var(--accent) 14%, transparent);
    --slm-radius: min(calc(var(--radius-card) * 0.6), 16px);
    --slm-open: #1f9d55;
    --slm-shut: color-mix(in srgb, var(--text-h) 42%, transparent);
    --slm-wa: #25d366;
    --slm-wa-ink: #062e16;
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
}

.slb-title + .slb-branches {
    padding-top: 4px;
}

.slb-branches[data-layout="simple"] {
    border: 1px solid var(--border);
    border-radius: min(var(--radius-card), 28px);
    background: var(--bg-card);
}

.slb-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.slb-branches svg,
.slb-sheet svg {
    display: block;
    width: 100%;
    height: 100%;
}

.slb-pin {
    display: grid;
    flex: none;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 50%;
    background: var(--slm-tint);
    color: var(--text-h);
}

/* Picker */

.slb-picker {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.slb-picker-count {
    margin: 0;
    color: var(--slm-soft);
    font-size: 13px;
}

.slb-picker-btn {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 66px;
    padding: 10px 12px;
    border: 1px solid var(--slm-line);
    border-radius: var(--slm-radius);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
    color: var(--text-h);
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.slb-picker-btn:hover,
.slb-picker-btn[aria-expanded="true"] {
    border-color: var(--accent);
}

.slb-picker-text,
.slb-opt-text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.slb-picker-name {
    overflow: hidden;
    color: var(--text-h);
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slb-picker-addr,
.slb-opt-addr {
    overflow: hidden;
    color: var(--slm-soft);
    font-size: 13px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slb-picker-chev {
    width: 20px;
    height: 20px;
    color: var(--slm-soft);
    transition: transform var(--transition);
}

.slb-picker-btn[aria-expanded="true"] .slb-picker-chev {
    transform: rotate(180deg);
}

/* Two branches */

.slb-seg {
    display: flex;
    gap: 4px;
    min-width: 0;
    padding: 4px;
    border-radius: var(--slm-radius);
    background: var(--slm-fill);
}

.slb-seg-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 6px 10px;
    border: 1.5px solid transparent;
    border-radius: min(calc(var(--radius-card) * 0.5), 12px);
    background: transparent;
    color: var(--text-h);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}

.slb-seg-tab[aria-selected="true"] {
    border-color: var(--accent);
    background: var(--slm-tint);
}

/* The list */

.slb-sheet {
    position: fixed;
    inset: auto;
    width: min(420px, 92vw);
    max-width: none;
    max-height: 420px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--slm-line, var(--border));
    border-radius: min(var(--radius-card), 18px);
    background: linear-gradient(var(--bg-card), var(--bg-card)), var(--bg);
    color: var(--text-h);
    font-family: inherit;
    box-shadow: var(--slm-lift);
    --slm-lift: 0 18px 44px rgba(0, 0, 0, 0.22);
    --slm-soft: color-mix(in srgb, var(--text-h) 72%, transparent);
    --slm-line: color-mix(in srgb, var(--text-h) 14%, transparent);
    --slm-tint: color-mix(in srgb, var(--accent) 14%, transparent);
    --slm-open: #1f9d55;
    --slm-shut: color-mix(in srgb, var(--text-h) 42%, transparent);
}

/* Browsers without <dialog> treat it as a plain element. */
.slb-sheet:not([open]) {
    display: none;
}

.slb-sheet[open] {
    z-index: var(--sl-z-modal);
    animation: slb-sheet-pop 0.16s ease-out;
}

.slb-sheet::backdrop {
    background: transparent;
}

.slb-sheet-in {
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.slb-sheet-grab,
.slb-sheet-title {
    display: none;
}

.slb-opts {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    outline: none;
}

.slb-opt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 20px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
}

.slb-opt + .slb-opt {
    margin-top: 2px;
}

.slb-opt.is-active {
    background: color-mix(in srgb, var(--text-h) 6%, transparent);
    box-shadow: inset 0 0 0 1px var(--slm-line);
}

.slb-opt[aria-selected="true"] {
    background: var(--slm-tint);
}

.slb-opt-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.slb-opt-name {
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slb-opt-meta {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.slb-opt-tag:not(:empty) {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--slm-tint);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.slb-opt-dist {
    color: var(--slm-soft);
    font-size: 13px;
    white-space: nowrap;
}

.slb-opt-check {
    width: 20px;
    height: 20px;
    visibility: hidden;
}

.slb-opt[aria-selected="true"] .slb-opt-check {
    visibility: visible;
}

.slb-sheet-foot {
    margin: 0;
    padding: 8px 16px 10px;
    border-top: 1px solid var(--slm-line);
    color: var(--slm-soft);
    font-size: 13px;
}

.slb-sheet-foot[hidden] {
    display: none;
}

@media (max-width: 520px) {
    .slb-sheet {
        inset: auto 0 0 0;
        width: 100%;
        max-height: 78vh;
        border-width: 1px 0 0;
        border-radius: 20px 20px 0 0;
    }

    .slb-sheet[open] {
        animation: slb-sheet-up 0.22s ease-out;
    }

    .slb-sheet::backdrop {
        --slm-shade: rgba(0, 0, 0, 0.45);
        background: var(--slm-shade);
    }

    .slb-sheet-in {
        max-height: 78vh;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .slb-sheet-grab {
        display: block;
        flex: none;
        width: 40px;
        height: 4px;
        margin: 10px auto 2px;
        border-radius: 2px;
        background: var(--slm-line);
    }

    .slb-sheet-title {
        display: block;
        flex: none;
        margin: 6px 0 2px;
        padding-inline: 16px;
        font-weight: 800;
    }
}

@keyframes slb-sheet-pop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes slb-sheet-up {
    from {
        transform: translateY(100%);
    }
}

/* Estimate or result, and the location action */

.slb-loc {
    display: grid;
    gap: 2px;
    min-width: 0;
    margin-top: -4px;
}

.slb-loc-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    min-height: 44px;
    min-width: 0;
}

.slb-chip {
    display: flex;
    align-items: center;
    min-width: 0;
    border-radius: 14px;
    color: var(--text-h);
}

.slb-chip.is-on {
    gap: 4px;
    padding-block: 5px;
    padding-inline: 7px 9px;
    background: var(--slm-tint);
}

.slb-chip-pin {
    display: none;
    flex: none;
    width: 14px;
    height: 14px;
}

.slb-chip.is-on .slb-chip-pin {
    display: block;
}

.slb-chip-text {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.slb-near-link {
    margin: 0;
    font-size: 13px;
}

.slb-near-link[hidden] {
    display: none;
}

.slb-near-link a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-h);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.slb-loc-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    position: relative;
    gap: 5px;
    margin-inline-start: auto;
    padding-block: 5px;
    padding-inline: 7px 9px;
    border: 0;
    border-radius: 14px;
    background: var(--slm-tint);
    color: var(--text-h);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* The pill matches the chip beside it; the tap target stays 44px tall. */
.slb-loc-btn::after {
    content: "";
    position: absolute;
    inset: -8px 0;
}

.slb-chip.is-on,
.slb-loc-btn {
    min-height: 30px;
}

/* Both pills share one line on a 360px phone. */
@media (max-width: 400px) {
    .slb-loc-row {
        column-gap: 4px;
    }

    .slb-chip.is-on,
    .slb-loc-btn {
        gap: 3px;
        padding-inline: 5px 7px;
    }
}

/* Alone on the line it reads better under the picker's text than off at the far end. */
.slb-chip:not(.is-on) ~ .slb-near-link[hidden] ~ .slb-loc-btn {
    margin-inline-start: 0;
}

.slb-loc-btn:hover:not(:disabled) [data-map-locate-label] {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
}

.slb-loc-btn:disabled {
    cursor: default;
}

[data-preview] .slb-loc-btn:disabled {
    opacity: 0.6;
}

.slb-loc-icon {
    width: 16px;
    height: 16px;
}

.slb-spin {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid var(--slm-line);
    border-top-color: var(--text-h);
    border-radius: 50%;
    animation: slb-spin 0.7s linear 100;
}

.slb-loc-btn.is-busy .slb-spin {
    display: block;
}

.slb-loc-btn.is-busy .slb-loc-icon {
    display: none;
}

@keyframes slb-spin {
    to {
        transform: rotate(360deg);
    }
}

.slb-loc-note {
    margin: 0;
    color: var(--slm-soft);
    font-size: 13px;
    line-height: 1.45;
}

.slb-loc-note.is-error {
    color: var(--text-h);
}

/* Open now, for a branch linked to the business */

.slb-dot {
    display: inline-block;
    position: relative;
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--slm-shut);
}

.slb-dot[data-open="1"],
[data-open="1"] > .slb-dot {
    background: var(--slm-open);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--slm-open) 22%, transparent);
}

.slb-dot[hidden],
.slb-state[hidden] {
    display: none;
}

.slb-seg-tab .slb-dot {
    margin-inline-end: 7px;
    vertical-align: 0.08em;
}

.slb-hours {
    display: grid;
    min-width: 0;
    padding: 10px 12px 4px;
    border: 1px solid var(--slm-line);
    border-radius: var(--slm-radius);
    color: var(--text-h);
}

.slb-state {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
}

.slb-today {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 10px;
    min-width: 0;
}

.slb-today-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.slb-today-k {
    color: var(--slm-soft);
}

.slb-today-v {
    font-weight: 700;
    unicode-bidi: isolate;
}

.slb-week-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-height: 44px;
    margin-inline-start: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-h);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: pointer;
}

.slb-week-chev {
    display: block;
    flex: none;
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
}

.slb-week-btn[aria-expanded="true"] .slb-week-chev {
    transform: rotate(180deg);
}

.slb-week {
    display: grid;
    gap: 2px;
    margin: 0 0 8px;
    padding: 6px 0 0;
    border-top: 1px solid var(--slm-line);
    list-style: none;
}

.slb-week[hidden] {
    display: none;
}

.slb-week li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
}

.slb-week li > span:last-child {
    color: var(--slm-soft);
    text-align: end;
    unicode-bidi: isolate;
}

.slb-week li.is-today {
    background: var(--slm-tint);
    font-weight: 800;
}

.slb-week li.is-today > span:last-child {
    color: var(--text-h);
}

/* Directions, WhatsApp and call: one row when there is room, directions alone on top when not. */

.slb-acts {
    min-width: 0;
    container-type: inline-size;
}

.slb-acts-in {
    display: grid;
    grid-auto-columns: auto;
    grid-auto-flow: column;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.slb-branches a.slb-act {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 52px;
    padding: 8px 18px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-btn);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: filter var(--transition), background var(--transition);
}

.slb-act svg {
    flex: none;
    width: 20px;
    height: 20px;
}

.slb-branches a.slb-act--wa {
    background: var(--slm-wa);
    color: var(--slm-wa-ink);
}

.slb-branches a.slb-act--wa:hover {
    filter: brightness(0.95);
}

.slb-branches a.slb-act--call {
    border-color: var(--text-h);
    background: transparent;
    color: var(--text-h);
}

.slb-branches a.slb-act--call:hover {
    background: var(--slm-fill);
}

@container (max-width: 430px) {
    .slb-acts-in {
        grid-auto-flow: row;
        grid-template-columns: 1fr 1fr;
    }

    .slb-acts-in > .slb-branch-go,
    .slb-acts-in > .slb-act:nth-child(2):last-child {
        grid-column: 1 / -1;
    }
}

/* Cards */

.slb-branch-panels {
    display: grid;
    min-width: 0;
}

.slb-branch {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.slb-branch[hidden] {
    display: none;
}

.slb-branches[data-mode="all"] .slb-branch + .slb-branch {
    padding-top: 14px;
    border-top: 1px solid var(--slm-line);
}

.slb-branch-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.slb-branch-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.slb-branch-name {
    margin: 0;
    color: var(--text-h);
    font-weight: 800;
    line-height: 1.35;
}

.slb-branch-addr {
    margin: 0;
    color: var(--slm-soft);
    font-size: 13px;
    line-height: 1.4;
}

.slb-branch-slot {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--slm-radius);
    aspect-ratio: 16 / 10;
    background: color-mix(in srgb, var(--text-h) 7%, transparent);
    animation: slb-skeleton 1.1s ease-in-out 16 alternate;
}

/* A frame still waiting for its address has nothing to paint, so the slot's skeleton shows through. */
.slb-branch-slot .slb-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

@keyframes slb-skeleton {
    to {
        background: color-mix(in srgb, var(--text-h) 12%, transparent);
    }
}

@media (max-width: 520px) {
    .slb-branch-slot {
        aspect-ratio: 4 / 3;
    }
}

.slb-branches a.slb-branch-go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    justify-self: stretch;
    min-height: 52px;
    padding: 8px 16px;
    border-radius: var(--radius-btn);
    background: var(--btn-solid);
    box-shadow: var(--btn-shadow);
    color: var(--btn-solid-ink);
    font-weight: 800;
    text-decoration: none;
    transition: filter var(--transition);
}

.slb-branches a.slb-branch-go:hover {
    filter: brightness(0.95);
}

.slb-branch-go svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.slb-branch-fallback {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.slb-branch-fallback a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-h);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.slb-branches a:focus-visible,
.slb-branches button:focus-visible {
    outline: 3px solid var(--text-h);
    outline-offset: 2px;
}

.slb-opts:focus-visible .slb-opt.is-active {
    outline: 3px solid var(--text-h);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .slb-sheet[open],
    .slb-branch-slot {
        animation: none;
    }

    .slb-picker-chev,
    .slb-week-chev,
    .slb-seg-tab,
    .slb-picker-btn {
        transition: none;
    }

    .slb-spin {
        animation-duration: 2s;
    }
}

/* No script: nothing here can switch, and a frame waiting for its address stays empty. */
@media (scripting: none) {
    .slb-loc,
    .slb-seg,
    .slb-week-btn,
    .slb-picker-chev,
    .slb-picker-count,
    .slb-branch-slot .slb-frame:not([src]) {
        display: none;
    }

    .slb-picker-btn {
        grid-template-columns: auto minmax(0, 1fr);
        pointer-events: none;
    }

    .slb-week[hidden] {
        display: grid;
    }

    .slb-branch-slot:has(.slb-frame:not([src])):not(:has(noscript)) {
        display: none;
    }
}
