/* ===== BOOKING OVERLAY & MODAL ===== */
.bkg-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    /* prevents ALL hit-testing when hidden */
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s 0.4s;
    /* delay visibility until opacity finishes */
}

.bkg-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s;
    /* instant visibility on open */
}

.bkg-window {
    width: 90%;
    max-width: 960px;
    height: auto;
    min-height: 400px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bkg-backdrop.active .bkg-window {
    transform: translateY(0) scale(1);
}

/* --- Left Branding Panel --- */
.bkg-brand-side {
    width: 40%;
    background: #000000;
    color: #ffffff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.booking-logo {
    height: 36px;
    width: auto;
    display: block;
}

.booking-brand-text h2 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.booking-brand-text p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* --- Right Flow Panel --- */
.bkg-flow-side {
    width: 60%;
    position: relative;
    background: #ffffff;
    overflow: hidden;
}

/* Close button on Left Panel */
.booking-close {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    z-index: 1000;
    transition: opacity 0.2s;
    padding: 10px;
    pointer-events: auto;
    /* larger hit area */
}

.booking-close:hover {
    opacity: 0.5;
}

/* ── Logo in Left Panel ── */
.modal-left-logo {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    height: 38px;
    width: auto;
    max-width: 80%;
    z-index: 10;
    pointer-events: none;
    opacity: 0.9;
    object-fit: contain;
}

/* Flow Container tracks sliding steps */
.booking-flow-container {
    width: 300%;
    /* 3 steps = 300% width */
    height: 100%;
    display: flex;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.booking-step {
    width: 33.3333%;
    height: 100%;
    padding: 2.5rem 3rem;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.booking-step.active {
    opacity: 1;
    pointer-events: auto;
}

.booking-step-header {
    margin-bottom: 2rem;
}

.booking-step-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.25rem;
}

.booking-step-header span {
    font-size: 0.85rem;
    color: #666;
}

.booking-back {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.booking-back:hover {
    text-decoration: underline;
}

/* --- Custom Calendar Grid --- */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.calendar-month-year {
    font-weight: 600;
    font-size: 1.1rem;
}

.calendar-nav button {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #000;
}

.calendar-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    margin-bottom: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    background: #f9f9f9;
    border: 1px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
    min-height: 40px;
    /* Ensure days don't squash too small */
}

.cal-day:hover:not(.disabled) {
    border-color: #10b981;
    background: #e6fcf5;
}

.cal-day.disabled {
    color: #ef4444;
    /* red text or tint */
    background: rgba(239, 68, 68, 0.08);
    /* light red background */
    cursor: not-allowed;
    border-color: rgba(239, 68, 68, 0.2);
}

.cal-day.selectable {
    background: rgba(16, 185, 129, 0.1);
    /* light green background */
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #047857;
    /* dark green text */
}

.cal-day.selectable:hover,
.cal-day.selected {
    background: #10b981;
    /* solid green */
    color: #fff;
    border-color: #10b981;
}

/* --- Time Slots Grid --- */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.time-slot {
    padding: 1rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    transition: all 0.2s;
}

.time-slot:hover {
    border-color: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.time-slot.selected {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* --- Form --- */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
}

.form-input,
.booking-form input {
    padding: 0.9rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #f9f9f9;
    transition: all 0.2s;
}

.booking-form input:focus {
    outline: none;
    border-color: #000;
    background: #fff;
}

.booking-submit-btn {
    margin-top: 1rem;
    background: #000 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    padding: 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.booking-submit-btn:hover {
    background: #222;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* --- Responsive --- */
@media (max-width: 800px) {
    .bkg-window {
        flex-direction: column;
        height: 90vh;
        overflow-y: auto;
    }

    .bkg-brand-side {
        width: 100%;
        padding: 2rem;
        flex: 0 0 auto;
    }

    .bkg-flow-side {
        width: 100%;
        flex: 1 1 auto;
    }

    .booking-step {
        padding: 2rem;
    }

    .time-slots-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== LIGHT MODE FORCE OVERRIDES ===== */
/* Since light-mode.css forces a lot of text colors to dark grey, we specifically override the booking modal text */

html.light-mode .bkg-brand-side h2,
html.light-mode .bkg-brand-side p {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html.light-mode .bkg-flow-side h3,
html.light-mode .bkg-flow-side span,
html.light-mode .bkg-flow-side label,
html.light-mode .cal-day {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
}

html.light-mode .cal-day.selectable:hover,
html.light-mode .cal-day.selected,
html.light-mode .time-slot.selected {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: #000 !important;
}

/* Force backgrounds explicitly just in case */
html.light-mode .bkg-backdrop {
    background: rgba(0, 0, 0, 0.6) !important;
}

html.light-mode .bkg-window {
    background: #fff !important;
}

html.light-mode .bkg-brand-side {
    background: #000 !important;
}

html.light-mode .bkg-flow-side {
    background: #fff !important;
}