/* =====================================================================
   book-map.css — Booking map picker, Rapido-style (mobile first)
   Loaded AFTER map.css / book.css / rapido.css on the Book page.

   - The confirm card is DOCKED under the map instead of floating over it,
     so the centre pin and the map are never hidden.
   - Address card shows the street address only (no lat/long, no
     "pinned location" text).
   - Pin colour follows the active target (pickup / drop / stop).
   ===================================================================== */

/* ---------- Picker = [ map stage ][ docked confirm card ] ---------- */
body[data-page="book"] .map-picker {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    background: var(--bk-card);
}
body[data-page="book"] .map-picker__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #CFE0F5;
}
body[data-page="book"] .map-picker__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* ---------- Centre pin (tip sits exactly on the map centre) ---------- */
body[data-page="book"] .map-picker__pin {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 0;
    height: 0;
    pointer-events: none;
    font-size: 2.6rem;
    line-height: 1;
    color: var(--map-drop, #E14B4B);
    text-shadow: none;
    transform: none;
    transition: none;
}
body[data-page="book"] .map-picker[data-kind="pickup"] .map-picker__pin { color: var(--map-pickup, #1FA97A); }
body[data-page="book"] .map-picker[data-kind="drop"] .map-picker__pin { color: var(--map-drop, #E14B4B); }
body[data-page="book"] .map-picker[data-kind="stop"] .map-picker__pin { color: #E0A72E; }
body[data-page="book"] .map-picker__pin > i {
    position: absolute;
    left: 0;
    bottom: 0;
    transform: translate(-50%, 0);
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
    transition: transform 0.16s ease;
}
body[data-page="book"] .map-picker__pin-shadow {
    position: absolute;
    left: 0;
    top: -2px;
    width: 14px;
    height: 5px;
    margin-left: -7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    transition: transform 0.16s ease, opacity 0.16s ease;
}
body[data-page="book"] .map-picker.is-dragging .map-picker__pin { transform: none; }
body[data-page="book"] .map-picker.is-dragging .map-picker__pin > i { transform: translate(-50%, -12px); }
body[data-page="book"] .map-picker.is-dragging .map-picker__pin-shadow { transform: scale(0.6); opacity: 0.6; }
body[data-page="book"] .map-picker.is-overview .map-picker__pin { display: none; }

/* ---------- Top bar ---------- */
body[data-page="book"] .map-picker__topbar { top: 12px; left: 12px; right: 12px; }
body[data-page="book"] .map-picker__targets button { min-height: 38px; padding: 0 16px; }
body[data-page="book"] .map-picker__targets button.is-active {
    background: var(--rp-ink, #101010);
    color: #fff;
}
[data-theme="dark"] body[data-page="book"] .map-picker__targets button.is-active {
    background: var(--rp-yellow, #FFD11A);
    color: #101010;
}
body[data-page="book"] .map-picker__search-btn { width: 44px; height: 44px; flex: 0 0 auto; }

/* Expand button: moved below the top bar so it no longer sits on the search button */
body[data-page="book"] .book-map-col__expand {
    top: 66px;
    right: 12px;
    width: 40px;
    height: 40px;
}

/* ---------- Locate button + saved chips (inside the stage, above the dock) ---------- */
body[data-page="book"] .map-picker__locate {
    right: 12px;
    bottom: 30px;
    width: 46px;
    height: 46px;
}
body[data-page="book"] .map-picker__chips { right: 70px; bottom: 30px; left: 12px; }

/* ---------- Location permission banner ---------- */
body[data-page="book"] .map-picker__geo-denied {
    top: 64px;
    left: 12px;
    right: 64px;
    transform: none;
    white-space: normal;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 10px 10px 12px;
    border-radius: 14px;
    background: #FFF1CC;
    color: #5A3B00;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
body[data-page="book"] .map-picker__geo-denied[hidden] { display: none; }
body[data-page="book"] .map-picker__geo-denied > i { margin-top: 2px; }
body[data-page="book"] .map-picker__geo-text { flex: 1 1 auto; min-width: 0; font-size: 0.8125rem; line-height: 1.35; color: inherit; }
body[data-page="book"] .map-picker__geo-retry {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: #101010;
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}
body[data-page="book"] .map-picker__geo-retry[hidden] { display: none; }
body[data-page="book"] .map-picker__geo-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

/* ---------- Docked confirm card ---------- */
body[data-page="book"] .map-picker__dock {
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bk-card);
    color: var(--bk-text);
    border-top: 1px solid var(--bk-line);
    border-radius: 20px 20px 0 0;
    margin-top: -16px;               /* tucks under the stage's rounded edge, never over the map centre */
    box-shadow: 0 -8px 24px rgba(11, 24, 70, 0.14);
}
body[data-page="book"] .map-picker__dock-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
body[data-page="book"] .map-picker__dock-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bk-soft);
    color: var(--map-drop, #E14B4B);
    font-size: 1rem;
}
body[data-page="book"] .map-picker[data-kind="pickup"] .map-picker__dock-icon { color: var(--map-pickup, #1FA97A); }
body[data-page="book"] .map-picker[data-kind="stop"] .map-picker__dock-icon { color: #E0A72E; }
body[data-page="book"] .map-picker__dock-body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
body[data-page="book"] .map-picker__dock-label {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bk-muted);
}
body[data-page="book"] .map-picker__dock-text {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--bk-text);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
body[data-page="book"] .map-picker__dock-sub {
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--bk-muted);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
body[data-page="book"] .map-picker__dock-sub:empty { display: none; }
body[data-page="book"] .map-picker__dock-skeleton {
    display: none;
    height: 14px;
    width: 72%;
    margin-top: 4px;
    border-radius: 7px;
    background: linear-gradient(90deg, var(--bk-soft), var(--bk-line), var(--bk-soft));
    background-size: 200% 100%;
    animation: bk-shimmer 1.1s linear infinite;
}
body[data-page="book"] .map-picker__dock.is-loading .map-picker__dock-skeleton { display: block; }
body[data-page="book"] .map-picker__dock.is-loading .map-picker__dock-text,
body[data-page="book"] .map-picker__dock.is-loading .map-picker__dock-sub { display: none; }
body[data-page="book"] .map-picker__dock.is-empty .map-picker__dock-text { font-weight: 600; color: var(--bk-muted); }
@keyframes bk-shimmer { to { background-position: -200% 0; } }

/* Yellow Rapido-style confirm button */
body[data-page="book"] .map-picker__confirm {
    flex: none;
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 16px;
    background: var(--rp-launch, linear-gradient(120deg, #FFD11A, #FFB300));
    color: var(--rp-ink, #101010);
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: var(--rp-glow, 0 10px 24px rgba(255, 177, 0, 0.4));
    cursor: pointer;
}
body[data-page="book"] .map-picker__confirm * { color: inherit; }
body[data-page="book"] .map-picker__confirm:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
body[data-page="book"] .map-picker__dock.is-loading .map-picker__confirm { pointer-events: none; }

/* ---------- Search sheet covers the whole picker ---------- */
body[data-page="book"] .map-search-sheet { z-index: 8; }

/* ---------- Map column sizing ---------- */
body[data-page="book"] .book-map-col { overflow: hidden; }

/* Phones & small tablets: big map, docked card, no overlap with the form sheet */
@media (max-width: 899px) {
    body[data-page="book"] .book-map-col {
        height: 74vh;
        height: 74dvh;
        min-height: 440px;
        max-height: 680px;
        border-radius: 0 0 24px 24px;
    }
    body[data-page="book"] .book-map-col.is-expanded { height: auto; max-height: none; min-height: 0; border-radius: 0; }
    body[data-page="book"] .book-form-col { margin-top: 0; border-radius: 0; padding-top: 14px; }
    body[data-page="book"] .book-container { padding-bottom: 170px; }

    /* After step 1 the map isn't needed: give the form the whole screen */
    body[data-book-step="2"][data-page="book"] .book-map-col,
    body[data-book-step="3"][data-page="book"] .book-map-col,
    body[data-book-step="4"][data-page="book"] .book-map-col { display: none; }
    body[data-book-step="2"][data-page="book"] .book-form-col,
    body[data-book-step="3"][data-page="book"] .book-form-col,
    body[data-book-step="4"][data-page="book"] .book-form-col { border-radius: 0; }
}

/* Short phones in landscape */
@media (max-width: 899px) and (max-height: 520px) {
    body[data-page="book"] .book-map-col { height: 100vh; height: 100dvh; min-height: 300px; }
}

/* Desktop: dock sits at the bottom of the sticky map card */
@media (min-width: 900px) {
    body[data-page="book"] .map-picker__dock { border-radius: 0; margin-top: 0; box-shadow: none; }
    body[data-page="book"] .book-map-col__expand { top: 66px; }
}

@media (prefers-reduced-motion: reduce) {
    body[data-page="book"] .map-picker__pin > i,
    body[data-page="book"] .map-picker__pin-shadow { transition: none; }
    body[data-page="book"] .map-picker__dock-skeleton { animation: none; }
}

/* =====================================================================
   Step 2 — "When & who": compact, Rapido-style
   ===================================================================== */
body[data-page="book"] .when-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--bk-card-2);
    border: 1.5px solid var(--bk-line);
    border-radius: 20px;
}
body[data-page="book"] .when-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body[data-page="book"] .when-pills::-webkit-scrollbar { display: none; }
body[data-page="book"] .when-pills .rp-pill { flex: 1 1 0; min-width: 0; padding: 0 10px; white-space: nowrap; color: var(--bk-text); border-color: var(--bk-line); }
body[data-page="book"] .when-pills .rp-pill.is-active { background: var(--rp-ink, #101010); border-color: var(--rp-ink, #101010); color: #fff; }
[data-theme="dark"] body[data-page="book"] .when-pills .rp-pill.is-active { background: var(--rp-yellow, #FFD11A); border-color: var(--rp-yellow, #FFD11A); color: #101010; }

body[data-page="book"] .when-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body[data-page="book"] .when-cell {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    background: var(--bk-card);
    border: 1.5px solid var(--bk-line);
    border-radius: 14px;
    cursor: pointer;
}
body[data-page="book"] .when-cell:focus-within { border-color: var(--bk-brand); }
body[data-page="book"] .when-cell__label { display: flex; align-items: center; gap: 6px; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bk-muted); }
body[data-page="book"] .when-cell__input {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bk-text);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    color-scheme: light;
}
[data-theme="dark"] body[data-page="book"] .when-cell__input { color-scheme: dark; }
body[data-page="book"] .when-cell__input:focus { outline: none; box-shadow: none; }

/* Passengers: one slim row — label on the left, compact stepper on the right */
body[data-page="book"] .pax-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 14px;
    background: var(--bk-card-2);
    border: 1.5px solid var(--bk-line);
    border-radius: 20px;
}
body[data-page="book"] .pax-row__icon { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--bk-soft); color: var(--bk-brand); }
body[data-page="book"] .pax-row__text { display: grid; flex: 1 1 auto; min-width: 0; gap: 1px; }
body[data-page="book"] .pax-row__text strong { font-size: 1rem; font-weight: 800; }
body[data-page="book"] .pax-row__text small { font-size: 0.75rem; color: var(--bk-muted); }
body[data-page="book"] .pax-row .stepper { flex: 0 0 auto; gap: 2px; padding: 4px; border-radius: 14px; background: var(--bk-card); }
body[data-page="book"] .pax-row .stepper__btn { width: 38px; height: 38px; min-width: 38px; border-radius: 11px; }
body[data-page="book"] .pax-row .stepper__value { min-width: 2.25rem; font-size: 1.125rem; }

/* Passenger count: typeable, no upper limit */
body[data-page="book"] .pax-row .stepper__value--input {
    width: 3.5rem;
    min-width: 3.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bk-text);
    font: inherit;
    font-size: 1.125rem;
    font-weight: 800;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
body[data-page="book"] .pax-row .stepper__value--input::-webkit-outer-spin-button,
body[data-page="book"] .pax-row .stepper__value--input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
body[data-page="book"] .pax-row .stepper__value--input:focus { outline: none; box-shadow: none; }

/* =====================================================================
   Action bar vs. bottom-nav centre button (phones)
   The FAB rises ~28px above the nav; the action bar now floats above it
   as a rounded card so the FAB is never covered.
   ===================================================================== */
@media (max-width: 767px) {
    body[data-page="book"] .book-actionbar {
        left: 12px;
        right: 12px;
        bottom: calc(64px + 38px + env(safe-area-inset-bottom, 0px));
        z-index: 54;                       /* below the nav (55) so the FAB always stays on top */
        padding: 10px;
        border: 1px solid var(--bk-line);
        border-radius: 20px;
        box-shadow: 0 10px 28px rgba(11, 24, 70, 0.22);
    }
    body[data-page="book"] .book-container { padding-bottom: 230px; }
}

/* ---------- Saved places chips (admin locations) — scrollable row over the map ---------- */
body[data-page="book"] .map-picker__chips[hidden] { display: none !important; }
body[data-page="book"] .map-picker__chips {
    position: absolute;
    left: 12px;
    right: 70px;
    bottom: 30px;
    z-index: 6;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    pointer-events: auto;
}
body[data-page="book"] .map-picker__chips::-webkit-scrollbar { display: none; }
body[data-page="book"] .map-picker__chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--bk-line);
    border-radius: 999px;
    background: var(--bk-card);
    color: var(--bk-text);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(11, 24, 70, 0.18);
}
body[data-page="book"] .map-picker__chip i { color: var(--map-pickup, #1FA97A); }
body[data-page="book"] .map-picker[data-kind="drop"] .map-picker__chip i { color: var(--map-drop, #E14B4B); }
body[data-page="book"] .map-picker[data-kind="stop"] .map-picker__chip i { color: #E0A72E; }
body[data-page="book"] .map-picker__chip:hover { background: var(--bk-soft); }
body[data-page="book"] .map-picker__chip:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; }
body[data-page="book"] .map-picker__chip.is-active { background: #2563EB; border-color: #2563EB; color: #fff; }
body[data-page="book"] .map-picker__chip.is-active i { color: #fff; }
body[data-page="book"] .map-picker__chip.is-busy { opacity: 0.6; pointer-events: none; }
body[data-page="book"] .map-picker__chip.is-missing { opacity: 0.55; border-style: dashed; }
