/* =========================================================================
 * css/bw-v2.css  (Phase 6B Phase 2.9)
 * -------------------------------------------------------------------------
 * Clean-room rewrite. Owns the booking widget rendered by
 *   site/resources/views/shared/guest/booking-widget.blade.php
 * and the floating sticky button + modal injected by js/bw-sticky.js.
 *
 * Apple-style visuals. Variant `.bw-v2--hero` is the anchor that
 * bw-sticky.js queries to enable its sticky/modal behaviour.
 * =========================================================================*/

/* ---------- tokens ---------- */
.bw-v2,
.bw-v2-sticky,
.bw-v2-overlay {
    --bw-radius: 14px;
    --bw-gap: 12px;
    --bw-pad: 18px;
    --bw-bg: #ffffff;
    --bw-bg-muted: #f5f5f7;
    --bw-border: #d2d2d7;
    --bw-border-focus: #0071e3;
    --bw-text: #1d1d1f;
    --bw-text-muted: #6e6e73;
    --bw-accent: #0071e3;
    --bw-accent-hover: #0077ed;
    --bw-shadow: 0 10px 40px rgba(0,0,0,.08);
    --bw-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- wrapper ---------- */
.bw-v2 {
    box-sizing: border-box;
    width: 100%;
    font-family: var(--bw-font);
    color: var(--bw-text);
    -webkit-font-smoothing: antialiased;
}

.bw-v2 *,
.bw-v2 *::before,
.bw-v2 *::after { box-sizing: border-box; }

.bw-v2--hero {
    background: var(--bw-bg);
    border-radius: var(--bw-radius);
    padding: var(--bw-pad);
    box-shadow: var(--bw-shadow);
    border: 1px solid rgba(0,0,0,.04);
}

.bw-v2--inline { background: transparent; padding: 0; }

/* ---------- form ---------- */
.bw-v2__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bw-v2__title {
    margin: 0 0 4px 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--bw-text);
}

/* ---------- grid: 6 fields in 2 rows of 3 (loc wider than date/time) ---------- */
.bw-v2__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--bw-gap);
    align-items: end;
}

.bw-v2__field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bw-v2__label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--bw-text-muted);
    margin: 0 0 6px 2px;
}

.bw-v2__control { position: relative; }

/* tablet: collapse to 2-col grid (loc stays wider) */
@media (max-width: 1023px) {
    .bw-v2__grid {
        grid-template-columns: 1fr 1fr;
    }
    .bw-v2__field--pickup-location,
    .bw-v2__field--dropoff-location {
        grid-column: 1 / -1;
    }
}

/* mobile: single column */
@media (max-width: 640px) {
    .bw-v2__grid { grid-template-columns: 1fr; }
    .bw-v2__field--pickup-location,
    .bw-v2__field--dropoff-location { grid-column: auto; }
}

/* ---------- neo-select + neo-datepicker (Apple-style) ----------
 * Neo framework exposes three shadow parts on both components:
 *   wrapper â flex container that holds field + icon
 *   field   â the <input> inside
 *   icon    â the svg (chevron for select, calendar for datepicker)
 * Neo applies :host styles (bg, border, padding, flex-wrap) from inside
 * the shadow root; external class selectors override those. We treat
 * the HOST itself as the control surface (44px pill with Apple border),
 * and clear the internal part defaults so field + icon sit flush inside.
 * -------------------------------------------------------------------*/
.bw-v2__select,
.bw-v2__date {
    /* layout */
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    gap: 0 !important;
    box-sizing: border-box;
    /* visuals */
    background: var(--bw-bg) !important;
    border: 1px solid var(--bw-border) !important;
    border-radius: 10px !important;
    color: var(--bw-text) !important;
    font-family: var(--bw-font);
    font-size: 15px;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.bw-v2__select:hover,
.bw-v2__date:hover {
    border-color: #a1a1a6 !important;
}

.bw-v2__select:focus-within,
.bw-v2__date:focus-within {
    border-color: var(--bw-border-focus) !important;
    box-shadow: 0 0 0 3px rgba(0,113,227,.18) !important;
    outline: none;
}

/* wrapper: inner flex row */
.bw-v2__select::part(wrapper),
.bw-v2__date::part(wrapper) {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 14px;
    overflow: hidden;
}

/* field: the actual input / displayed text */
.bw-v2__select::part(field),
.bw-v2__date::part(field) {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background: transparent;
    border: 0;
    outline: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: var(--bw-text);
    letter-spacing: inherit;
    box-shadow: none;
    width: 100%;
}

.bw-v2__select::part(field)::placeholder,
.bw-v2__date::part(field)::placeholder {
    color: var(--bw-text-muted);
    opacity: 1;
}

/* icon: chevron / calendar */
.bw-v2__select::part(icon),
.bw-v2__date::part(icon) {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-right: 12px;
    color: var(--bw-text-muted);
    pointer-events: none;
}

/* ===========================================================================
 * Apple-style OPEN-state popups (neo-datepicker + neo-select)
 *
 * Both components emit shadow parts:
 *   modal          â full-screen backdrop (fixed overlay)
 *   close-trigger  â backdrop dismiss region (tap-outside-to-close)
 *   close-icon     â visible close button
 *   content        â the actual popup card
 *   control        â header bar (datepicker: month/year nav; select: title)
 *   trigger        â back/forward arrow buttons (datepicker)
 *   content-icon   â chevron icons inside control arrows
 *   display        â "Month Year" text in datepicker header
 *   month          â month name in header (clickable for month-picker)
 *   year           â year in header (clickable for year-picker)
 *   day            â weekday labels row (S M T W T F S)
 *   date           â individual date cells (repeated for each day)
 *   items          â scrollable list container (select dropdown)
 * --------------------------------------------------------------------------*/

/* =====================================================================
 * DATEPICKER â centered-modal overlay (calendar is big, needs backdrop)
 * ===================================================================== */
.bw-v2__date::part(modal) {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.28) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    animation: bw-v2-fade-in .18s ease;
}

@keyframes bw-v2-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bw-v2__date::part(content) {
    position: relative !important;
    background: #fff !important;
    color: var(--bw-text) !important;
    border: 1px solid rgba(0,0,0,.06) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.08) !important;
    padding: 14px !important;
    width: min(340px, 100%) !important;
    max-width: 340px !important;
    max-height: calc(100vh - 32px);
    overflow: auto;
    font-family: var(--bw-font) !important;
    letter-spacing: -0.01em;
    animation: bw-v2-pop-in .2s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes bw-v2-pop-in {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bw-v2__date::part(close-trigger) {
    position: absolute !important;
    inset: 0 !important;
    background: transparent !important;
    border: 0 !important;
    cursor: default;
    z-index: 0;
}

.bw-v2__date::part(close-icon) {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 28px !important;
    height: 28px !important;
    color: var(--bw-text-muted) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    cursor: pointer;
    z-index: 2;
    transition: background .15s ease, color .15s ease;
}

.bw-v2__date::part(close-icon):hover {
    background: rgba(0,0,0,.05) !important;
    color: var(--bw-text) !important;
}

/* =====================================================================
 * SELECT â anchored dropdown (drops under its field, scrollable)
 * =====================================================================
 * We reset the centered-overlay behaviour neo uses by default and
 * reposition the modal to sit absolutely directly below the control.
 * The host (.bw-v2__select) already has position:relative so this
 * positions against the field itself. The close-trigger is pulled
 * out to a viewport-fixed invisible layer BEHIND the dropdown so
 * tap-outside-to-close still works without covering the popup.
 * --------------------------------------------------------------------*/
.bw-v2__select::part(modal) {
    /* inset shorthand must come BEFORE individual top/right/bottom/left
       so those longhand values win; otherwise inset:auto wipes them out */
    inset: auto !important;
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100% !important;
    min-width: 220px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 1000 !important;
    display: block !important;
    animation: bw-v2-pop-in .15s cubic-bezier(.2,.9,.3,1.2);
}

.bw-v2__select::part(content) {
    position: relative !important;
    background: #fff !important;
    color: var(--bw-text) !important;
    border: 1px solid rgba(0,0,0,.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.08) !important;
    padding: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-family: var(--bw-font) !important;
    letter-spacing: -0.01em;
    animation: none;
}

/* tap-outside-to-close: fullscreen invisible layer BEHIND the popup */
.bw-v2__select::part(close-trigger) {
    position: fixed !important;
    inset: 0 !important;
    background: transparent !important;
    border: 0 !important;
    cursor: default;
    z-index: -1 !important;
}

/* no explicit close button needed â tap outside closes it */
.bw-v2__select::part(close-icon) {
    display: none !important;
}

/* header / nav bar (month-year + prev/next arrows) */
.bw-v2__date::part(control) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 6px 4px 12px !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 0 !important;
    color: var(--bw-text) !important;
    font-weight: 600;
}

.bw-v2__select::part(control) {
    padding: 4px 4px 8px !important;
    background: transparent !important;
    border: 0 !important;
    color: var(--bw-text) !important;
    font-weight: 600;
    font-size: 15px;
}

/* prev / next triggers */
.bw-v2__date::part(trigger),
.bw-v2__select::part(trigger) {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,.04) !important;
    color: var(--bw-text) !important;
    border: 0 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    cursor: pointer;
    transition: background .15s ease;
}

.bw-v2__date::part(trigger):hover,
.bw-v2__select::part(trigger):hover {
    background: rgba(0,0,0,.08) !important;
}

.bw-v2__date::part(content-icon),
.bw-v2__select::part(content-icon) {
    width: 14px !important;
    height: 14px !important;
    color: var(--bw-text) !important;
}

/* month / year labels in header â make them feel tappable */
.bw-v2__date::part(display) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    color: var(--bw-text) !important;
}

.bw-v2__date::part(month),
.bw-v2__date::part(year) {
    padding: 4px 8px !important;
    border-radius: 8px !important;
    cursor: pointer;
    color: var(--bw-text) !important;
    background: transparent !important;
    transition: background .15s ease;
}

.bw-v2__date::part(month):hover,
.bw-v2__date::part(year):hover {
    background: rgba(0,0,0,.05) !important;
}

/* weekday label row (S M T W T F S) */
.bw-v2__date::part(day) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 26px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    color: var(--bw-text-muted) !important;
    background: transparent !important;
    border: 0 !important;
}

/* individual date cells */
.bw-v2__date::part(date) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    margin: 2px !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--bw-text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    cursor: pointer;
    transition: background .12s ease, color .12s ease, transform .08s ease;
}

.bw-v2__date::part(date):hover {
    background: rgba(0,0,0,.06) !important;
}

.bw-v2__date::part(date active),
.bw-v2__date::part(date selected),
.bw-v2__date::part(date current) {
    background: var(--bw-accent) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.bw-v2__date::part(date disabled),
.bw-v2__date::part(date inactive) {
    color: rgba(0,0,0,.22) !important;
    cursor: default;
    pointer-events: none;
}

/* items container (neo-select dropdown list) */
.bw-v2__select::part(items) {
    max-height: 280px !important;
    overflow-y: auto !important;
    padding: 4px !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    scrollbar-width: thin;
}

.bw-v2__select::part(items)::-webkit-scrollbar { width: 6px; }
.bw-v2__select::part(items)::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 3px;
}

/* ---------- dropdown menu (neo-select-item rows) ----------
 * neo-select items are in the light DOM as <neo-select-item>. They
 * pop into a positioned layer when the select is expanded. Style
 * them directly.
 * ------------------------------------------------------------*/
neo-select-item {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--bw-font);
    color: var(--bw-text);
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: -0.01em;
    margin: 2px 0;
}

neo-select-item:hover,
neo-select-item[hover] {
    background: var(--bw-bg-muted);
}

neo-select-item[active],
neo-select-item[selected] {
    background: rgba(0,113,227,.10);
    color: var(--bw-accent);
    font-weight: 500;
}

/* ---------- submit ---------- */
.bw-v2__submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.bw-v2__btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bw-accent);
    color: #fff;
    border: 0;
    border-radius: 980px;
    height: 44px;
    padding: 0 28px;
    font-family: var(--bw-font);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background .15s ease, transform .08s ease;
}

.bw-v2__btn:hover { background: var(--bw-accent-hover); }
.bw-v2__btn:active { transform: translateY(1px); }
.bw-v2__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,113,227,.30);
}

@media (max-width: 640px) {
    .bw-v2__submit { justify-content: stretch; }
    .bw-v2__btn { width: 100%; padding: 0 20px; }
}

/* =========================================================================
 * Floating sticky button + modal (injected by js/bw-sticky.js)
 *   .bw-v2-anchor    â placeholder inserted before the hero widget
 *   .bw-v2-sticky    â the floating "Book a car" button
 *   .bw-v2-overlay   â modal overlay containing a copy of the form
 *   .bw-v2-close     â close button inside the modal
 * =========================================================================*/

/* floating Book button */
.bw-v2-sticky {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 9998;
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 48px;
    padding: 0 22px;
    background: #1d1d1f;
    color: #fff;
    border: 0;
    border-radius: 980px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
   cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    transition: background .15s ease, transform .15s ease, opacity .2s ease;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.bw-v2-sticky[data-visible="true"],
.bw-v2-sticky.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.bw-v2-sticky:hover { background: #000; transform: translateY(-1px); }
.bw-v2-sticky:active { transform: translateY(0); }

@media (max-width: 640px) {
    .bw-v2-sticky { right: 12px; bottom: 76px; height: 44px; padding: 0 18px; font-size: 14px; }
}

/* Modal overlay */
.bw-v2-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.bw-v2-overlay[data-open="true"],
.bw-v2-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* the hero widget copy inside the overlay */
.bw-v2-overlay > .bw-v2 {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--bw-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.30);
    padding: 24px;
    transform: translateY(8px);
    transition: transform .2s ease;
}

.bw-v2-overlay[data-open="true"] > .bw-v2,
.bw-v2-overlay.is-open > .bw-v2 {
    transform: translateY(0);
}

/* close button */
.bw-v2-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #f5f5f7;
    color: #1d1d1f;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .15s ease;
}

.bw-v2-close:hover { background: #e8e8ed; }

/* anchor is invisible ONLY when empty (JS-injected sentinel). Airport
 * Blade templates wrap the hero widget in a div with this class, so we
 * must NOT hide it when it has children â only the empty placeholder. */
.bw-v2-anchor:empty { display: none; }

/* modal on small screens */
@media (max-width: 640px) {
    .bw-v2-overlay { padding: 12px; }
    .bw-v2-overlay > .bw-v2 { padding: 18px; border-radius: 14px; }
}

/* =========================================================================
 * Floating WhatsApp button (paired with the sticky book button)
 *   .bw-v2-whatsapp  â anchor <a> that js/bw-sticky.js injects
 * =========================================================================*/
.bw-v2-whatsapp {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(37,211,102,.35);
    transition: transform .15s ease, background .15s ease;
}

.bw-v2-whatsapp:hover { background: #1fbe58; transform: translateY(-2px); }
.bw-v2-whatsapp svg { width: 26px; height: 26px; fill: currentColor; }

@media (max-width: 640px) {
    .bw-v2-whatsapp { right: 12px; bottom: 14px; width: 46px; height: 46px; }
    .bw-v2-whatsapp svg { width: 24px; height: 24px; }
}
