/* ============================================================
   IBReservas — Booking Modal
   ============================================================ */

/* ---- Variables ---- */
:root {
    --ib-teal:          #0d9488;
    --ib-teal-dark:     #0f766e;
    --ib-teal-selected: #134e4a;
    --ib-teal-light:    #f0fdfa;
    --ib-teal-border:   #99f6e4;
    --ib-coral:         #f06c54;
    --ib-coral-dark:    #d9553d;
    --ib-disabled-bg:   #fff1f2;
    --ib-disabled-text: #fca5a5;
    --ib-text:          #1e293b;
    --ib-text-muted:    #64748b;
    --ib-border:        #e2e8f0;
    --ib-radius:        10px;
}

/* ---- Overlay ---- */
.ib-booking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    padding: 16px;
    box-sizing: border-box;
}
.ib-booking-overlay.ib-open {
    opacity: 1;
    pointer-events: all;
}

/* ---- Modal card ---- */
.ib-booking-modal {
    background: #fff;
    border-radius: 18px;
    width: 420px;
    max-width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    animation: ibSlideUp 0.22s ease;
    scrollbar-width: none;
}
.ib-booking-modal::-webkit-scrollbar { display: none; }

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

/* ---- Header ---- */
.ib-modal-header {
    display: flex;
    align-items: center;
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--ib-border);
    gap: 8px;
}
.ib-modal-title {
    flex: 1;
    margin: 0;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--ib-teal) !important;
    line-height: 1.2 !important;
    font-family: inherit !important;
}
.ib-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--ib-text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.ib-modal-close:hover { background: #f1f5f9; }
.ib-back-btn {
    background: none;
    border: 1.5px solid var(--ib-border);
    border-radius: 8px;
    font-size: 20px;
    color: var(--ib-text-muted);
    cursor: pointer;
    padding: 2px 10px;
    line-height: 1.4;
    transition: all 0.15s;
    flex-shrink: 0;
}
.ib-back-btn:hover { border-color: var(--ib-teal); color: var(--ib-teal); }

/* ---- Calendar nav ---- */
.ib-cal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px 6px;
}
.ib-cal-select {
    flex: 1;
    border: 1.5px solid var(--ib-border);
    border-radius: var(--ib-radius);
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ib-text);
    background: #fff;
    cursor: pointer;
    appearance: auto;
    outline: none;
}
.ib-cal-select:focus { border-color: var(--ib-teal); }
.ib-cal-arrows {
    display: flex;
    gap: 4px;
}
.ib-arrow-btn {
    border: 1.5px solid var(--ib-border);
    background: #fff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    color: var(--ib-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}
.ib-arrow-btn:hover { border-color: var(--ib-teal); color: var(--ib-teal); }
.ib-arrow-btn:disabled { opacity: 0.35; cursor: default; }

/* ---- Timezone badge ---- */
.ib-timezone-badge {
    margin: 4px 16px 10px;
    display: inline-block;
    background: #f1f5f9;
    color: var(--ib-text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

/* ---- Calendar grid ---- */
.ib-cal-grid {
    padding: 0 12px;
}
.ib-cal-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 3px;
}
.ib-cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
    position: relative;
    transition: all 0.12s;
    font-family: inherit;
    border: 1.5px solid transparent;
    line-height: 1;
    padding: 0;
    background: none;
}
.ib-cal-day-header {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    aspect-ratio: unset;
    height: 22px;
    border: none;
}
.ib-cal-empty {
    border: none;
}

/* Available day */
.ib-day-available {
    border-color: var(--ib-teal);
    color: var(--ib-teal);
    background: #fff;
    cursor: pointer;
}
.ib-day-available:hover {
    background: var(--ib-teal-light);
    border-color: var(--ib-teal-dark);
}

/* Disabled / past day */
.ib-day-disabled {
    background: var(--ib-disabled-bg);
    color: var(--ib-disabled-text);
    border-color: transparent;
}

/* Other-month days (trailing) */
.ib-day-other {
    background: #f8fafc;
    color: #cbd5e1;
    border-color: transparent;
}

/* Today indicator */
.ib-day-today .ib-day-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ib-teal);
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

/* Selected day */
.ib-day-selected,
.ib-day-selected:hover {
    background: var(--ib-teal-selected) !important;
    border-color: var(--ib-teal-selected) !important;
    color: #fff !important;
}
.ib-day-selected .ib-day-dot { background: #fff; }

/* ---- Selected date label ---- */
.ib-selected-date-label {
    padding: 10px 16px 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ib-text);
    min-height: 28px;
}

/* ---- Time slots ---- */
.ib-time-slots-wrap {
    padding: 0 12px 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.ib-time-slot-btn {
    border: 1.5px solid var(--ib-teal);
    border-radius: 8px;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ib-teal);
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
    font-family: inherit;
    line-height: 1.3;
}
.ib-time-slot-btn:hover { background: var(--ib-teal-light); }
.ib-time-slot-btn.ib-slot-selected {
    background: var(--ib-teal);
    color: #fff;
    border-color: var(--ib-teal);
}
.ib-no-slots {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ib-text-muted);
    font-size: 13px;
    padding: 10px 0;
}

/* ---- CTA Button ---- */
.ib-btn-cta {
    display: block;
    width: calc(100% - 32px);
    margin: 12px 16px 20px;
    padding: 14px;
    background: var(--ib-coral);
    color: #fff;
    border: none;
    border-radius: var(--ib-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.2px;
}
.ib-btn-cta:hover:not(:disabled) { background: var(--ib-coral-dark); }
.ib-btn-cta:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* ---- Step 2 form ---- */
.ib-booking-summary {
    margin: 12px 16px 16px;
    background: var(--ib-teal-light);
    border: 1.5px solid var(--ib-teal-border);
    border-radius: var(--ib-radius);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ib-teal-dark);
}
.ib-form-body { padding: 0 16px; }
.ib-form-group { margin-bottom: 14px; }
.ib-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ib-text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.ib-required { color: var(--ib-coral); }
.ib-input {
    display: block;
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--ib-border);
    border-radius: var(--ib-radius);
    font-size: 14px;
    color: var(--ib-text);
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}
.ib-input:focus { border-color: var(--ib-teal); }
.ib-input.ib-input-error { border-color: #ef4444; }
.ib-form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 12px;
}

/* ---- Step 3 success ---- */
.ib-success-wrap {
    padding: 36px 24px 28px;
    text-align: center;
}
.ib-success-icon {
    width: 64px;
    height: 64px;
    background: var(--ib-teal);
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.ib-success-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--ib-text) !important;
    margin: 0 0 10px !important;
    font-family: inherit !important;
}
.ib-success-desc {
    font-size: 15px;
    font-weight: 700;
    color: var(--ib-teal-dark);
    margin: 0 0 8px;
}
.ib-success-note {
    font-size: 13px;
    color: var(--ib-text-muted);
    margin: 0 0 24px;
}
.ib-success-wrap .ib-btn-cta {
    width: auto;
    display: inline-block;
    padding: 12px 32px;
    margin: 0;
}

/* Availability error shown before CFU submit */
.ib-availability-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 4px solid #EF4444;
    color: #B91C1C;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 8px;
}

/* Error inside the modal when a slot is already taken */
.ib-slot-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-left: 4px solid #EF4444;
    color: #B91C1C;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* Hide the ib-service field injected for CFU email detection */
.wpcfu-form-field:has(input[name="ib-service"]) {
    display: none !important;
}
