/* ============================================
   Celox Digital — Booking Widget
   ============================================ */

/* ── Overlay ──────────────────────────────────── */
.booking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.booking-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal ────────────────────────────────────── */
.booking-modal {
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.booking-overlay.is-open .booking-modal {
    transform: translateY(0) scale(1);
}

/* ── Header ───────────────────────────────────── */
.booking-header {
    padding: 28px 28px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.booking-header-text h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.booking-header-text p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.booking-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.booking-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Steps indicator ──────────────────────────── */
.booking-steps {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.booking-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.booking-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.booking-step-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.booking-step.active .booking-step-num {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-color: transparent;
    color: #fff;
}

.booking-step.active .booking-step-label {
    color: #fff;
}

.booking-step.done .booking-step-num {
    background: rgba(52, 211, 153, 0.15);
    border-color: #34d399;
    color: #34d399;
}

.booking-step.done .booking-step-label {
    color: rgba(255, 255, 255, 0.6);
}

.booking-step-sep {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 8px;
    max-width: 40px;
}

/* ── Body ─────────────────────────────────────── */
.booking-body {
    padding: 24px 28px 28px;
}

/* ── Step panels ──────────────────────────────── */
.booking-panel {
    display: none;
}

.booking-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Calendar ─────────────────────────────────── */
.booking-calendar {
    user-select: none;
}

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

.cal-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #fff;
}

.cal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cal-month {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

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

.cal-day-label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    padding: 4px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.cal-day:hover:not(.disabled):not(.empty) {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.cal-day.today {
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

.cal-day.selected {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-weight: 600;
    border-color: transparent;
}

.cal-day.disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.cal-day.empty {
    cursor: default;
}

/* ── Time slots ───────────────────────────────── */
.slots-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.slots-title strong {
    color: #fff;
}

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

.slot-btn {
    padding: 10px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.slot-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #fff;
}

.slot-btn.selected {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.slots-empty {
    text-align: center;
    padding: 32px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.slots-loading {
    text-align: center;
    padding: 32px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.slots-loading::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    margin: 12px auto 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Form ─────────────────────────────────────── */
.booking-recap {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
}

.booking-recap svg {
    color: #6366f1;
    flex-shrink: 0;
}

.booking-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.bf-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bf-group.full {
    grid-column: 1 / -1;
}

.bf-group label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bf-group input,
.bf-group textarea,
.bf-group select {
    background: #1a1a25;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 11px 14px;
    color: #fff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
    width: 100%;
}

.bf-group input:focus,
.bf-group textarea:focus,
.bf-group select:focus {
    outline: none;
    border-color: #6366f1;
}

.bf-group input.error,
.bf-group textarea.error {
    border-color: #f87171;
}

.bf-group textarea {
    resize: vertical;
    min-height: 80px;
}

.bf-error {
    font-size: 11px;
    color: #f87171;
    display: none;
}

.bf-group.has-error .bf-error {
    display: block;
}

/* ── Buttons ──────────────────────────────────── */
.booking-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.btn-booking-back {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-booking-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-booking-next,
.btn-booking-submit {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-booking-next:hover,
.btn-booking-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-booking-next:disabled,
.btn-booking-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-booking-submit.loading {
    position: relative;
    color: transparent;
}

.btn-booking-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite;
}

/* ── API error ────────────────────────────────── */
.booking-api-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 8px;
    padding: 12px 14px;
    color: #fca5a5;
    font-size: 13px;
    margin-top: 14px;
    display: none;
}

/* ── Success state ────────────────────────────── */
.booking-success {
    text-align: center;
    padding: 16px 0;
}

.booking-success-icon {
    width: 64px;
    height: 64px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #34d399;
}

.booking-success h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.booking-success p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto 24px;
}

.booking-success-date {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 10px 20px;
    color: #a5b4fc;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
}

.btn-booking-done {
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-booking-done:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 480px) {
    .booking-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .booking-modal {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
    }

    .booking-form-grid {
        grid-template-columns: 1fr;
    }

    .slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .booking-step-label {
        display: none;
    }
}
