/* =====================================================
   BRAND VARIABLES
   ===================================================== */
   :root {
    --bb-primary: #0f172a;
    --bb-border: #e5e7eb;
    --bb-muted: #9ca3af;
    --bb-bg-soft: #f8fafc;
    --bb-blue: #3b82f6;
}

/* =====================================================
   OVERLAY
   ===================================================== */
.bb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
}
.bb-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================================================
   PANEL
   ===================================================== */
.bb-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 480px;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -4px 0 24px rgba(0,0,0,.18);
    transition: right .35s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
.bb-panel.open { right: 0; }

body.bb-modal-open { overflow: hidden; }

/* =====================================================
   HEADER
   ===================================================== */
.bb-header {
    padding: 24px 24px 18px;
    border-bottom: 1px solid var(--bb-border);
    text-align: center;
    position: relative;
}
.bb-close {
    position: absolute;
    top: 18px;
    left: 18px;
    font-size: 28px;
    background: #fff !important;
    border: 1px solid var(--bb-border);
    cursor: pointer;
    color: var(--bb-primary) !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background .2s;
}
.bb-close:hover {
    background: var(--bb-bg-soft);
}
.bb-progress-text {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-bottom: 6px;
}
.bb-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--bb-primary) !important;
    margin: 0;
    text-align: left !important;
}

/* =====================================================
   STEPS CONTAINER - All Visible
   ===================================================== */
.bb-steps-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.bb-step-section {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--bb-border);
    padding-bottom: 24px;
}

.bb-step-section.bb-hidden-step {
    display: none;
}

.bb-step-section:last-child {
    border-bottom: none;
}

.bb-step-title {
    font-size: 16px !important;
    font-weight: 600;
    color: var(--bb-primary);
    margin-bottom: 16px;
}


.bb-step-header-row{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}


/* =====================================================
   FIELD BOX (Date & Guests)
   ===================================================== */
.bb-field-box {
    height: 56px;
    padding: 0 15px;
    border: 1px solid var(--bb-border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s;
    position: relative;
    font-size: 14px;
    font-weight: 400;
}

.bb-field-box:hover {
    border-color: var(--bb-muted);
}

.bb-field-box.filled {
    border-color: var(--bb-blue);
}

#bb-date-box .bb-field-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--bb-muted);
}

#bb-date-box.filled .bb-field-label {
    color: var(--bb-primary);
}

.bb-date-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* =====================================================
   COLLAPSIBLE CONTENT (Duration/Time)
   ===================================================== */
.bb-collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 0;
}

.bb-collapsible-content.expanded {
    max-height: 800px;
    margin-top: 16px;
}

.bb-select-box {
    cursor: pointer;
}

.bb-select-box .bb-field-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--bb-muted);
}

.bb-select-box.filled .bb-field-label {
    color: var(--bb-primary);
}

/* =====================================================
   FLATPICKR CALENDAR POSITIONING
   ===================================================== */

.flatpickr-wrapper {
    position: absolute;
    left: -290px;
    margin-top: 50px;
}   

.flatpickr-calendar {
    border-radius: 14px;
    border: 1px solid var(--bb-border);
    box-shadow: 0 8px 28px rgba(0,0,0,.15);
    margin-top: 8px !important;
}

.flatpickr-calendar.inline {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 16px 0;
    box-shadow: none;
    border: 1px solid var(--bb-border);
}

.flatpickr-day.selected {
    background: var(--bb-primary) !important;
    border-color: var(--bb-primary) !important;
}

.flatpickr-day.today {
    border-color: var(--bb-blue);
}

/* =====================================================
   EXPANDABLE SECTIONS
   ===================================================== */
.bb-expandable-section {
    margin-bottom: 16px;
}

.bb-section-header {
    margin-bottom: 12px;
}

.bb-section-label {
    font-size: 14px !important;
    font-weight: 700;
    color: var(--bb-primary);
    margin: 0;
}

.bb-section-content {
    /* Always visible now */
}

/* =====================================================
   DURATION BUTTONS
   ===================================================== */
.bb-duration-buttons {
    display: flex;
    gap: 12px;
}

.bb-duration-btn {
    flex: 1;
    height: 52px;
    background: #fff !important;
    border: 1px solid var(--bb-border) !important;
    border-radius: 3px !important;
    font-size: 14px;
    font-weight: 400 !important;
    color: #000 !important;
    cursor: pointer;
    transition: all .2s;
}

.bb-duration-btn:hover {
    border-color: var(--bb-muted);
}

.bb-duration-btn.active {
    background: var(--bb-primary) !important;
    color: #fff !important;
    border-color: var(--bb-primary);
}

/* =====================================================
   TIME SLOTS
   ===================================================== */
.bb-times-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding: 2px;
}

.bb-time {
    height: 52px;
    border-radius: 3px !important;
    background: #fff !important;
    border: 1px solid var(--bb-border) !important;
    font-size: 14px;
    font-weight: 400 !important;
    color: var(--bb-primary) !important;
    cursor: pointer;
    transition: all .2s;
}

.bb-time:hover {
    border-color: var(--bb-muted);
}

.bb-time.active {
    background: var(--bb-primary) !important;
    color: #fff !important;
    border-color: var(--bb-primary);
}

/* =====================================================
   GUESTS SECTION
   ===================================================== */
.step3 {
    flex-direction: row;
    justify-content: space-between;
}


.bb-guests-box {
    border: none !important;
    display: flex;
    align-items: center;
    position: relative;
}


.bb-guests-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--bb-primary);
    text-align: center;
}


.bb-slider-wrapper {
    position: relative;
    width: 100%;
}

/* Slider */
.bb-guests-slider {
    width: 100%;
    height: 2px;
    appearance: none;
    background: #e5e7eb;
    cursor: pointer;
    border-radius: 999px;
    padding: 0px !important;
}

/* Filled track handled by JS */

/* Thumb */
.bb-guests-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #111;
    cursor: pointer;
}

.bb-guests-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #111;
    border: none;
    cursor: pointer;
}

/* Floating pill */
.bb-slider-value {
    position: absolute;
    top: -16px;
    transform: translateX(-50%);
    height: 34px;
    min-width: 56px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #60a5fa;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    pointer-events: auto;   /* ⬅ allow interaction */
    cursor: grab;
    user-select: none;
}

.bb-slider-value:active {
    cursor: grabbing;
}


.bb-guests-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}


/* =====================================================
   FOOTER
   ===================================================== */
.bb-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--bb-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.bb-price-section {
    flex: 1;
}

.bb-price-amount {
    font-size: 26px;
    font-weight: 800;
    color: var(--bb-primary);
    display: block;
}

.bb-price-label {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bb-price-dropdown {
    font-size: 10px;
}

/* =====================================================
   CONTINUE BUTTON
   ===================================================== */
.bb-continue-btn {
    height: 52px;
    padding: 0 32px;
    background: var(--bb-primary);
    color: #fff;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .8px;
    cursor: pointer;
    transition: opacity .2s;
    white-space: nowrap;
}

.bb-continue-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.bb-continue-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* =====================================================
   SCROLLBAR STYLING
   ===================================================== */
.bb-times-grid::-webkit-scrollbar {
    width: 6px;
}

.bb-times-grid::-webkit-scrollbar-track {
    background: var(--bb-bg-soft);
    border-radius: 3px;
}

.bb-times-grid::-webkit-scrollbar-thumb {
    background: var(--bb-border);
    border-radius: 3px;
}

.bb-times-grid::-webkit-scrollbar-thumb:hover {
    background: var(--bb-muted);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
/* =====================================================
   RESPONSIVE MOBILE FIX (Definitive)
   ===================================================== */
   @media (max-width: 768px) {
    .bb-panel {
        /* FIXED POSITIONING: Lock to all 4 corners */
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        width: 100% !important;
        
        /* HEIGHT: Use 100% as a fallback, 100dvh for modern browsers */
        height: 100% !important; 
        height: 100dvh !important; 
        
        /* DEFAULT STATE: Hidden to the right */
        right: -100% !important; 
        
        /* FLEX LAYOUT: This is crucial for the sticky footer */
        display: flex !important;
        flex-direction: column !important;
        
        background: #fff !important;
        z-index: 2147483647 !important; /* Maximum Z-Index to stay on top */
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        
        /* DISABLE OUTER SCROLL: Only the steps container should scroll */
        overflow: hidden !important; 
    }

    /* OPEN STATE: Slide it in */
    .bb-panel.open {
        right: 0 !important;
        left: 0 !important;
    }

    /* HEADER: Fixed height, doesn't shrink */
    .bb-header {
        flex: 0 0 auto; 
    }

    /* MIDDLE CONTENT: Grows to fill space, scrolls internally */
    .bb-steps-container {
        flex: 1 1 auto; 
        overflow-y: auto !important; /* Force scrollbar if content is long */
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iPhone */
        height: auto; 
        min-height: 0; /* CRITICAL: Allows flex child to shrink properly */
        padding-bottom: 40px; /* Extra padding so content isn't tight to footer */
    }

    /* FOOTER: Pinned to bottom, doesn't shrink */
    .bb-footer {
        flex: 0 0 auto; /* Prevent footer from collapsing */
        width: 100%;
        background: #fff;
        border-top: 1px solid var(--bb-border);
        
        /* SPACING */
        padding: 16px 24px;
        /* Handle iPhone X/11/12+ Home Bar (bottom safe area) */
        padding-bottom: calc(16px + env(safe-area-inset-bottom)); 
        
        position: relative;
        z-index: 20;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05); /* Slight shadow to separate from content */
        margin-bottom: 80px;
    }

    /* Ensure button is visible and full width */
    .bb-continue-btn {
        width: 100%;
        display: block;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

@media (max-width: 480px) {
    .bb-duration-buttons { 
        flex-direction: column; 
    }
    
    .bb-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .bb-continue-btn {
        width: 100%;
    }
    
    .bb-price-section {
        width: 100%;
        text-align: center;
    }
    .bb-price-label {
        justify-content: center;
    }
} 