/* Popup pemilih cabang + chip cabang di header */
html.bp-lock, html.bp-lock body { overflow: hidden; }

.bp-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 28, 48, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .22s ease;
}
.bp-overlay.is-open { opacity: 1; }
.bp-overlay[hidden] { display: none; }

.bp-dialog {
    position: relative;
    width: min(880px, 100%);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    background: var(--pub-surface, #fff);
    border-radius: 1.5rem;
    box-shadow: 0 30px 80px rgba(3, 20, 40, .35);
    padding: 2rem 1.75rem 1.5rem;
    transform: translateY(14px) scale(.98);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.bp-overlay.is-open .bp-dialog { transform: none; }

.bp-close {
    position: absolute;
    top: .9rem;
    right: .9rem;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    background: var(--pub-mist, #e0f2fe);
    color: var(--pub-ink, #0c4a6e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bp-close:hover { background: #cfe9fb; }

.bp-head { text-align: center; margin-bottom: 1.5rem; padding: 0 1.5rem; }
.bp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pub-accent, #f97316);
}
.bp-title {
    font-family: var(--pub-display, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: clamp(1.4rem, 3.2vw, 1.9rem);
    color: var(--pub-ink, #0c4a6e);
    margin: .35rem 0 .35rem;
}
.bp-sub { color: var(--pub-ink-muted, #475569); margin: 0; font-size: .95rem; }

.bp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}

.bp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 1.1rem;
    overflow: hidden;
    background: var(--pub-surface, #fff);
    border: 1px solid var(--pub-border, rgba(12, 74, 110, .1));
    box-shadow: 0 4px 18px rgba(2, 132, 199, .07);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    animation: bp-in .35s ease both;
    animation-delay: calc(var(--bp-i, 0) * 50ms + 80ms);
}
.bp-card:hover, .bp-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(2, 132, 199, .18);
    border-color: var(--pub-primary, #0284c7);
    color: inherit;
}
.bp-card.is-selected { border-color: var(--pub-primary, #0284c7); box-shadow: 0 0 0 3px rgba(2, 132, 199, .25), 0 14px 34px rgba(2, 132, 199, .16); }

@keyframes bp-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bp-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.bp-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.bp-card:hover .bp-card__media img { transform: scale(1.05); }
.bp-card__media--0 { background: linear-gradient(135deg, #0c4a6e, #0284c7); }
.bp-card__media--1 { background: linear-gradient(135deg, #9a3412, #f97316); }
.bp-card__media--2 { background: linear-gradient(135deg, #065f46, #10b981); }
.bp-card__media--3 { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.bp-card__initial {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pub-display, 'Outfit', sans-serif);
    font-size: 3.2rem;
    font-weight: 800;
    color: rgba(255, 255, 255, .88);
}

.bp-badge {
    position: absolute;
    top: .6rem;
    left: .6rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .92);
    color: var(--pub-ink, #0c4a6e);
}
.bp-badge--near { left: auto; right: .6rem; background: #16a34a; color: #fff; }
.bp-badge[hidden] { display: none; }

.bp-card__body { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 2.6rem .9rem .95rem; }
.bp-card__city {
    font-family: var(--pub-display, 'Outfit', sans-serif);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--pub-ink, #0c4a6e);
}
.bp-card__meta { font-size: .8rem; color: var(--pub-ink-muted, #475569); line-height: 1.35; }
.bp-card__check {
    position: absolute;
    right: .85rem;
    bottom: .95rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--pub-border, rgba(12, 74, 110, .18));
    color: transparent;
    font-size: .7rem;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.bp-card.is-selected .bp-card__check { background: var(--pub-primary, #0284c7); border-color: var(--pub-primary, #0284c7); color: #fff; }

.bp-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem 1rem;
    margin-top: 1.4rem;
}
.bp-status { font-size: .85rem; color: var(--pub-ink-muted, #475569); min-height: 1.2em; }
.bp-continue {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: .3em;
    padding: .7rem 1.4rem;
    border-radius: 999px;
    background: var(--pub-accent, #f97316);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(249, 115, 22, .3);
    transition: background .18s ease, transform .18s ease;
}
.bp-continue:hover { background: var(--pub-accent-hover, #ea580c); color: #fff; transform: translateY(-1px); }
.bp-close[hidden] { display: none; }

@media (max-width: 575.98px) {
    .bp-overlay { align-items: flex-end; padding: 0; }
    .bp-dialog { border-radius: 1.4rem 1.4rem 0 0; padding: 1.6rem 1rem 1.1rem; max-height: 92dvh; }
    .bp-head { padding: 0 1.25rem; margin-bottom: 1.1rem; }
    .bp-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .bp-card__body { padding: .6rem .7rem .75rem; }
    .bp-card__check { width: 1.35rem; height: 1.35rem; right: .6rem; bottom: .65rem; }
    .bp-card__city { font-size: 1rem; }
    .bp-card__meta { font-size: .72rem; }
    .bp-foot { flex-direction: column; align-items: stretch; text-align: center; gap: .6rem; }
    .bp-continue { margin-left: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .bp-card, .bp-dialog, .bp-overlay { animation: none; transition: none; }
}

[data-bs-theme="dark"] .bp-dialog { background: #0f172a; }
[data-bs-theme="dark"] .bp-card { background: #111c33; border-color: rgba(148, 163, 184, .18); }
[data-bs-theme="dark"] .bp-title, [data-bs-theme="dark"] .bp-card__city { color: #e2e8f0; }
[data-bs-theme="dark"] .bp-sub, [data-bs-theme="dark"] .bp-card__meta, [data-bs-theme="dark"] .bp-status { color: #94a3b8; }
[data-bs-theme="dark"] .bp-close { background: #1e293b; color: #e2e8f0; }

/* Chip cabang di header */
.mb-branch-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    padding: .2rem .65rem;
    margin-right: .5rem;
    background: rgba(255, 255, 255, .16);
    color: inherit;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.mb-branch-chip:hover { background: rgba(255, 255, 255, .28); }
.mb-branch-chip .fa-chevron-down { font-size: .6rem; opacity: .8; }
