/* =====================================================================
   pw-widgets.css - site.css se nikale hue widgets (range calendar, airport
   picker modal, search-form behaviour) taake theme v3 pages site.css ke
   baghair chalein. Rang pw-theme.css ke vars se aate hain (teal/lime).
   ===================================================================== */

/* ============ range calendar (APB ka apb-range-cal, PW theme vars) ============ */
.apb-rcal {
    background: var(--apb-surface);
    border: 1px solid var(--apb-line);
    border-radius: 14px;
    box-shadow: 0 24px 55px rgba(9, 20, 40, 0.28);
    left: 50%;
    padding: 18px 20px 20px;
    position: absolute;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    width: 396px;
    z-index: 10050;
}

/* the question the next tap answers - the calendar tells you what it wants */
.apb-rcal-ask {
    color: var(--apb-muted);
    font-size: 0.92rem;
    margin: 2px 2px 12px;
}

.apb-rcal-ask b { color: var(--apb-heading); }

.apb-rcal-head {
    align-items: center;
    color: var(--apb-heading);
    display: flex;
    font-size: 1.05rem;
    font-weight: 700;
    justify-content: space-between;
    margin-bottom: 10px;
}

.apb-rcal-nav {
    background: var(--apb-soft);
    border: none;
    border-radius: 8px;
    color: var(--apb-primary);
    cursor: pointer;
    height: 34px;
    width: 34px;
}

.apb-rcal-nav:hover { background: #dcebfc; }
.apb-rcal-nav:disabled { color: #b9c4d4; cursor: default; }

.apb-rcal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 2px;
}

.apb-rcal-dow {
    color: var(--apb-muted);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 0 8px;
    text-align: center;
}

.apb-rcal-day {
    background: none;
    border: none;
    color: var(--apb-text);
    cursor: pointer;
    font-size: 0.97rem;
    font-weight: 500;
    height: 46px;
    /* pseudo-elements carry the circle and the band at negative z-index;
       isolate keeps them above the popup's white instead of behind it */
    isolation: isolate;
    position: relative;
}

.apb-rcal-day:hover:not(:disabled)::before {
    background: var(--apb-soft);
    border-radius: 50%;
    content: "";
    height: 42px;
    left: calc(50% - 21px);
    position: absolute;
    top: 2px;
    width: 42px;
    z-index: -1;
}

.apb-rcal-day:disabled { color: #c2cbd8; cursor: default; }

.apb-rcal-day.is-today { color: var(--apb-primary); font-weight: 800; }

/* the two ends: a true circle, drawn at a fixed size so a wide grid cell
   cannot stretch it into an egg */
.apb-rcal-day.is-start,
.apb-rcal-day.is-end {
    color: #ffffff;
    font-weight: 700;
}

.apb-rcal-day.is-start::before,
.apb-rcal-day.is-end::before {
    background: var(--apb-primary);
    border-radius: 50%;
    content: "";
    height: 42px;
    left: calc(50% - 21px);
    position: absolute;
    top: 2px;
    width: 42px;
    z-index: -1;
}

/* the stay itself: a soft stripe joining the two ends. The in-between days
   carry the full-width piece, each end carries its half, so the band runs
   edge to edge and dies exactly under the circles. */
.apb-rcal-day.in-band { color: var(--apb-heading); }

.apb-rcal-day.in-band::after,
.apb-rcal-day.is-start.has-range::after,
.apb-rcal-day.is-end::after {
    background: var(--apb-soft);
    bottom: 2px;
    content: "";
    position: absolute;
    top: 2px;
    z-index: -2;
}

.apb-rcal-day.in-band::after { left: 0; right: 0; }
.apb-rcal-day.is-start.has-range::after { left: 50%; right: 0; }
.apb-rcal-day.is-end::after { left: 0; right: 50%; }

/* "4 Days" over the hovered pick-up date - the count is inclusive, the same
   arithmetic the pricing runs, so the chip promises what checkout bills */
.apb-rcal-chip {
    background: var(--apb-navy);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(9, 20, 40, 0.3);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -100%);
    white-space: nowrap;
    z-index: 5;
}

/* the summary line's count, once both ends are picked - beside the dates on
   desktop, and never split in the middle ("7" up, "Days" down) */
.apb-rcal-ask .tally {
    background: var(--apb-soft);
    border-radius: 6px;
    color: var(--apb-primary);
    display: inline-block;
    font-weight: 700;
    margin-left: 8px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* the times live in the calendar now; the widget row outside is dates only */
.apb-rcal-times {
    border-top: 1px solid var(--apb-line);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
    padding-top: 12px;
}

.apb-rcal-times label {
    color: var(--apb-muted);
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.apb-rcal-times select {
    background: #ffffff;
    border: 1px solid #cdd7e4;
    border-radius: 8px;
    color: #1d2b42;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    height: 42px;
    padding: 0 10px;
    width: 100%;
}

.apb-rcal-done {
    background: var(--lime);
    border: none;
    border-radius: 8px;
    color: var(--teal);
    cursor: pointer;
    font: 600 1rem/1 var(--font-ui);
    letter-spacing: .02em;
    text-transform: uppercase;
    grid-column: 1 / -1;
    height: 44px;
    transition: background-color .15s;
}

/* theme v3 (owner, 7-Oct): Done = wahi lime CTA jo "Find your space" hai (pehle neela #0062c4 hover) */
.apb-rcal-done:hover, .apb-rcal-done:focus-visible { background: var(--lime-2); color: var(--teal); }
.apb-rcal-done:active { outline: 4px solid var(--lime); }

/* As a modal - on any phone-width screen, and always from inside the Park
   Here sheet (there is no field row there to hang under). The page dims
   behind it and a close sits top-right; apb-range-cal.js flips the class. */
.apb-rcal-overlay {
    background: rgba(11, 26, 52, 0.55);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 10085;
}

.apb-rcal-overlay:not([hidden]) { display: block; }

.apb-rcal.apb-rcal-modal {
    border-radius: 16px;
    left: 14px;
    margin: 0 auto;
    max-height: calc(100dvh - 32px);
    max-width: 396px;
    overflow-y: auto;
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    /* above the Park Here sheet (10070) - a calendar opened from the sheet
       must land on top of it, not behind it */
    z-index: 10090;
}

.apb-rcal-x { display: none; }

.apb-rcal-modal .apb-rcal-x {
    align-items: center;
    background: var(--apb-soft);
    border: none;
    border-radius: 50%;
    color: #111111;
    cursor: pointer;
    display: flex;
    font-size: 1.3rem;
    height: 34px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 34px;
    z-index: 6;
}

.apb-rcal-modal .apb-rcal-x:hover { background: #dcebfc; }

/* the close floats over the corner; the question must not run under it */
.apb-rcal-modal .apb-rcal-ask { padding-right: 44px; }

@media (max-width: 560px) {
    /* the narrow modal has no room beside the dates - the count drops below */
    .apb-rcal-ask .tally { display: block; margin: 6px 0 0; }
}

/* search form ke andar calendar ki jagah (pw-search.js .pwf-row .apb-rcal dhoondta hai) */


.pwsrch { position: relative; }
.pwf-in, .pwf-out { cursor: pointer; }

/* calendar: dates ki row ke neeche latke, card ke andar; button red/white hamesha */
.pwf-row { position: relative; }
.pwsrch .apb-rcal { top: calc(100% + 10px); }
.pwf-btn:disabled { background: var(--red); opacity: .7; color: #fff; }
/* mobile: calendar poori screen */
@media (max-width: 560px) {
    .apb-rcal.apb-rcal-modal { left: 0; right: 0; top: 0; bottom: 0; transform: none; max-height: none; max-width: none; border-radius: 0; height: 100dvh; padding-top: 22px; }
    .apb-rcal-modal .apb-rcal-times { position: sticky; bottom: 0; background: #fff; padding-bottom: 10px; }
}

/* calendar: compact + jis field par click, usi ke neeche (desktop) */
@media (min-width: 561px) {
    .pwsrch .apb-rcal { width: 340px; padding: 12px 14px 14px; transform: none; left: 0; }
    .pwsrch .apb-rcal.pw-cal-right { left: auto; right: 0; }
    .pwsrch .apb-rcal-ask { font-size: 0.82rem; margin: 0 0 6px; }
    .pwsrch .apb-rcal-head { font-size: 0.95rem; margin: 0 0 4px; }
    .pwsrch .apb-rcal-nav { width: 30px; height: 30px; }
    .pwsrch .apb-rcal-dow { font-size: 0.7rem; padding: 2px 0 4px; }
    .pwsrch .apb-rcal-grid { row-gap: 0; }
    .pwsrch .apb-rcal-day { height: 34px; line-height: 34px; font-size: 0.88rem; padding: 0; }
    .pwsrch .apb-rcal-times { margin-top: 8px; padding-top: 8px; gap: 8px; }
    .pwsrch .apb-rcal-times label { font-size: 0.68rem; }
    .pwsrch .apb-rcal-times select { font-size: 0.86rem; padding: 6px 8px; height: 36px; }
    .pwsrch .apb-rcal-done { font-size: 0.88rem; padding: 9px; margin-top: 8px; }
}


/* compact cells ke naap ke circles/band */

/* compact cells ke naap ke circles/band (APB 42px wale 34px cell se bahar nikalte the) */
@media (min-width: 561px) {
    .pwsrch .apb-rcal-day:hover:not(:disabled)::before,
    .pwsrch .apb-rcal-day.is-start::before,
    .pwsrch .apb-rcal-day.is-end::before { height: 30px; width: 30px; left: calc(50% - 15px); top: 2px; }
    .pwsrch .apb-rcal-day.in-band::after,
    .pwsrch .apb-rcal-day.is-start.has-range::after,
    .pwsrch .apb-rcal-day.is-end::after { top: 2px; bottom: 2px; }
}

/* tang layouts (airport hero / results bar) me date inputs apni intrinsic chaurai se row phaad dete the */
.pwf-row > .pwf { min-width: 0; }
.pwf-box .pwf-date, .pwf-combo input[type="text"] { flex: 1 1 auto; width: 100%; min-width: 0; }

/* ============ "Which airport?" picker modal (trip-type cards) ============ */
.pw-pick { position: fixed; inset: 0; z-index: 1300; background: rgba(11,22,40,.58); display: flex; align-items: center; justify-content: center; padding: 20px; }
.pw-pick[hidden] { display: none; }
.pw-pick-box { width: min(520px, 100%); background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.3); animation: pwpick .22s ease; }
@keyframes pwpick { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.pw-pick-head { display: flex; justify-content: space-between; align-items: center; background: var(--blue); color: #fff; padding: 16px 20px; }
.pw-pick-head h2 { color: #fff; font: 800 1.1rem/1.2 'Plus Jakarta Sans', 'Jakarta Fallback', sans-serif; margin: 0; }
.pw-pick-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 1rem; cursor: pointer; }
.pw-pick-x:hover { background: rgba(255,255,255,.28); }
.pw-pick-body { padding: 18px 20px 20px; }
.pw-pick-sub { color: var(--muted); font-size: .94rem; margin: 0 0 16px; }
.pw-pick-list { display: grid; gap: 10px; }
.pw-pick-opt { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; border: 1px solid #e6eaef; border-radius: 12px; padding: 12px 14px; color: inherit; transition: border-color .15s, background .15s, transform .15s; }
.pw-pick-opt:hover, .pw-pick-opt:focus-visible { border-color: var(--red); background: #fff6f6; transform: translateX(2px); outline: none; }
.pw-pick-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: var(--red); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.pw-pick-txt { display: grid; gap: 2px; min-width: 0; }
.pw-pick-txt b { color: var(--blue); font-size: .97rem; line-height: 1.3; }
.pw-pick-txt small { color: var(--muted); font-size: .83rem; }
.pw-pick-arrow { color: var(--muted); }
.pw-pick-opt:hover .pw-pick-arrow { color: var(--red); }



/* ---- theme v3 retint ---- */
.pwsrch .apb-rcal, .apb-rcal { border-radius: 8px; border-color: var(--line); box-shadow: var(--shadow-pop); font-family: var(--font); }
.pwf-btn:disabled { background: var(--lime); color: var(--teal); opacity: .6; }
.pwsrch.is-shake { animation: pwshake .35s ease; }
@keyframes pwshake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.pw-pick-box { border-radius: 8px; }
.pw-pick-head { background: var(--teal); }
.pw-pick-head h2 { font: 700 1.1rem/1.2 var(--font); text-transform: uppercase; }
.pw-pick-opt { border-radius: 8px; }
.pw-pick-opt:hover, .pw-pick-opt:focus-visible { border-color: var(--teal); background: var(--lime-tint); }
.pw-pick-ic { background: var(--lime-tint); color: var(--teal); border-radius: 8px; }
.pw-pick-txt b { color: var(--ink); }
.pw-pick-opt:hover .pw-pick-arrow { color: var(--teal); }


/* QA2 (7-Oct): chuna hua airport naam field se lamba ho to "…" (beech lafz me na kate);
   tang field me site.js chhota label ("Newark Liberty (EWR)") likh deta hai. Menu me 4 airports
   bina andar ke scroll ke aa jayen. Font 16px hi - us se chhota iOS par focus-zoom karta hai. */
.pwf-combo #airport-search { text-overflow: ellipsis; }
.pwsrch .pwf-menu { max-height: min(360px, 60vh); }
