/* ==========================================================================
   Park on King – EMA-Style Booking Form
   ========================================================================== */

/* ── Scope & Reset ─────────────────────────────────────────────────────────── */
.pok-bf-wrap *,
.pok-bf-wrap *::before,
.pok-bf-wrap *::after {
    box-sizing: border-box;
}

/* Popup and backdrop also need box-sizing since they're on <body> */
.pok-bf-popup *,
.pok-bf-popup *::before,
.pok-bf-popup *::after {
    box-sizing: border-box;
}

.pok-bf-wrap {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    font-family: 'Inter', 'Montserrat', system-ui, sans-serif;
    font-size: 15px;
}

/* ── Booking Bar ──────────────────────────────────────────────────────────── */
.pok-bf-bar {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 60px;
    box-shadow: 0 8px 36px rgba(0, 60, 90, 0.18);
    overflow: hidden;
    min-height: 74px;
}

/* ── Field (Entry / Exit) ─────────────────────────────────────────────────── */
.pok-bf-field {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    padding: 14px 24px;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}

.pok-bf-field:hover  { background: #f4fafc; }
.pok-bf-field.is-active { background: #ebf6fa; }

.pok-bf-field-inner {
    flex: 1;
    min-width: 0;
}

.pok-bf-field-label {
    font-size: 11px;
    font-weight: 800;
    color: #016a97;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.pok-bf-field-value {
    font-size: 15px;
    font-weight: 600;
    color: #163848;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pok-bf-field-value.placeholder {
    color: #9ab5c0;
    font-weight: 400;
}

/* Icons on right of each field */
.pok-bf-field-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    flex-shrink: 0;
}

.pok-bf-icon-check {
    display: none;
    color: #5fbcc8;
    width: 22px;
    height: 22px;
}

.pok-bf-field.has-value .pok-bf-icon-check { display: block; }

.pok-bf-icon-cal {
    color: #9ab5c0;
    width: 22px;
    height: 22px;
}

.pok-bf-field.has-value .pok-bf-icon-cal { color: #016a97; }

/* Vertical separator between fields */
.pok-bf-sep {
    width: 1px;
    background: #dae8ee;
    flex-shrink: 0;
    margin: 18px 0;
}

/* ── Book Now Button ──────────────────────────────────────────────────────── */
.pok-bf-book-btn {
    flex-shrink: 0;
    margin: 8px 10px 8px 10px;
    padding: 0 30px;
    background: #016a97;
    color: #fff;
    border: none;
    border-radius: 40px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, transform 0.12s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pok-bf-book-btn:hover { background: #015b80; transform: scale(1.03); }
.pok-bf-book-btn:active { transform: scale(0.98); }
.pok-bf-book-btn svg { width: 18px; height: 18px; }

/* ── Popup ────────────────────────────────────────────────────────────────── */
.pok-bf-popup {
    /* Fixed so JS can position it purely in viewport coords on desktop.
       JS moves it to <body>; on mobile CSS overrides to bottom-sheet.   */
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(3, 47, 97, 0.18), 0 2px 8px rgba(3, 47, 97, 0.08);
    z-index: 2147483647; /* max int — sits above Zendesk, Klaviyo, Google Store */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    touch-action: pan-y; /* allow drag-to-scroll on the popup (mobile bottom-sheet) */
    font-family: 'Inter', 'Montserrat', system-ui, sans-serif;
    /* Hide scrollbar track on all browsers while keeping scroll functionality */
    scrollbar-width: none;        /* Firefox */
}
.pok-bf-popup::-webkit-scrollbar {
    display: none;                /* Chrome, Safari, Edge */
}

.pok-bf-popup.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ── Popup Header (tabs + close) ──────────────────────────────────────────── */
.pok-bf-popup-header {
    display: flex;
    align-items: center;
    padding: 14px 24px 12px;
    border-bottom: 1px solid #e8eef2;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-radius: 16px 16px 0 0;
}

.pok-bf-tabs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
}

.pok-bf-tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #b0c4ce;
    cursor: pointer;
    padding: 2px 0;
    line-height: 1;
    transition: color 0.15s;
}

.pok-bf-tab-btn.is-active { color: #016a97; }
.pok-bf-tab-btn:hover:not(.is-active) { color: #5fbcc8; }

.pok-bf-tab-sep {
    color: #d8e5eb;
    margin: 0 14px;
    font-size: 22px;
    line-height: 1;
    font-weight: 200;
}

.pok-bf-popup-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #6b8fa0;
    font-size: 20px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    margin-left: 8px;
    flex-shrink: 0;
}

.pok-bf-popup-close:hover { background: #f0f7fa; color: #016a97; }

/* ── Range Display ────────────────────────────────────────────────────────── */
.pok-bf-range-display {
    padding: 6px 24px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #016a97;
    border-bottom: 1px solid #e8eef2;
    min-height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: sticky;
    top: 58px; /* sits just below the sticky header (~58px tall) */
    background: #fff;
    z-index: 2;
}

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.pok-bf-cal {
    padding: 10px 20px 12px;
    user-select: none;
}

.pok-bf-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pok-bf-cal-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f0f7fa;
    border-radius: 50%;
    cursor: pointer;
    color: #016a97;
    font-size: 22px;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}

.pok-bf-cal-nav-btn:hover:not([disabled]) { background: #dceef5; }
.pok-bf-cal-nav-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.pok-bf-cal-title {
    font-size: 16px;
    font-weight: 700;
    color: #016a97;
}

/* Day-of-week header row + day cells share the same grid */
.pok-bf-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
}

.pok-bf-cal-dow {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #016a97;
    padding: 2px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pok-bf-cal-day {
    height: 36px;
    width: 36px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 300;
    color: #016a97; /* theme dark blue */
    cursor: pointer;
    border: 2px solid transparent;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
    line-height: 1;
}

.pok-bf-cal-day.is-empty {
    cursor: default;
    pointer-events: none;
}

.pok-bf-cal-day.is-past {
    color: #c8d8de;
    cursor: not-allowed;
    pointer-events: none;
}

.pok-bf-cal-day.is-today {
    border-color: #5fbcc8;
    font-weight: 600;
}

.pok-bf-cal-day:hover:not(.is-past):not(.is-empty) {
    background: #e6f4f8;
    color: #016a97;
}

.pok-bf-cal-day.is-selected {
    background: #016a97;
    color: #fff;
    font-weight: 600;
    border-color: #016a97;
}

.pok-bf-cal-day.is-selected:hover {
    background: #015b80;
    border-color: #015b80;
}

.pok-bf-cal-day.is-in-range {
    background: #d5eef5;
    border-radius: 0;
    border-color: transparent;
}

/* ── Time Picker – single column, EMA-style ───────────────────────────────── */
.pok-bf-time {
    /* no extra padding – slots fill edge to edge */
}

.pok-bf-time-grid {
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow-y: auto;
    /* Explicit vertical pan so touch drag-to-scroll fires immediately on mobile */
    touch-action: pan-y;
    /* Hide scrollbar track — scroll still works via mouse wheel / touch */
    scrollbar-width: none;        /* Firefox */
}
.pok-bf-time-grid::-webkit-scrollbar {
    display: none;                /* Chrome, Safari, Edge */
}

.pok-bf-time-grid::-webkit-scrollbar { width: 4px; }
.pok-bf-time-grid::-webkit-scrollbar-track { background: transparent; }
.pok-bf-time-grid::-webkit-scrollbar-thumb { background: #c8dce3; border-radius: 4px; }

.pok-bf-time-slot {
    border: none;
    border-bottom: 1px solid #e8eef2;
    border-radius: 0;
    background: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    color: #016a97; /* theme dark blue */
    padding: 16px 24px;
    cursor: pointer;
    text-align: center;
    transition: background 0.12s, color 0.12s;
    width: 100%;
    line-height: 1;
}

.pok-bf-time-slot:last-child {
    border-bottom: none;
}

.pok-bf-time-slot:hover:not([disabled]) {
    background: #e6f4f8;
    color: #016a97;
}

.pok-bf-time-slot.is-selected {
    background: #016a97;
    color: #fff;
    font-weight: 600;
}

.pok-bf-time-slot.is-selected:hover {
    background: #015b80;
}

.pok-bf-time-slot[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Backdrop ─────────────────────────────────────────────────────────────── */
.pok-bf-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 47, 97, 0.4);
    z-index: 2147483646; /* one below popup */
}

.pok-bf-backdrop.is-active { display: block; }

/* Prevent scroll behind bottom-sheet on mobile only */
@media (max-width: 768px) {
    body.pok-popup-open { overflow: hidden; }
}

/* ── Responsive: Tablet ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pok-bf-book-btn {
        padding: 0 22px;
        font-size: 14px;
    }
    .pok-bf-field { padding: 14px 18px; }
}

/* ── Responsive: Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pok-bf-bar {
        flex-direction: column;
        border-radius: 18px;
        gap: 0;
    }

    .pok-bf-field {
        padding: 16px 20px;
    }

    .pok-bf-field:first-child {
        border-bottom: 1px solid #dae8ee;
    }

    /* Horizontal separator becomes full-width line (hidden via flex column) */
    .pok-bf-sep { display: none; }

    .pok-bf-book-btn {
        margin: 10px 14px 14px;
        justify-content: center;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* ── Bottom sheet popup on mobile ── */
    .pok-bf-popup {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(20px) !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .pok-bf-popup.is-open {
        transform: translateY(0) !important;
    }

    /* Pull handle on mobile */
    .pok-bf-popup::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #d0dde2;
        border-radius: 4px;
        margin: 12px auto 4px;
    }

    /* Calendar fills full width */
    .pok-bf-cal {
        padding: 10px 12px 16px;
    }

    .pok-bf-cal-day {
        font-size: 15px;
    }

    .pok-bf-time-slot {
        font-size: 15px;
        padding: 14px 20px;
    }
}

/* ── Very small screens ───────────────────────────────────────────────────── */
@media (max-width: 360px) {
    .pok-bf-cal-title { font-size: 15px; }
}
