/**
 * MFV Booking Form — modal + form styles.
 *
 * @package MFV_Booking
 */

/* ── Body lock when modal open ────────────────────────────────── */
body.mfv-booking-body-lock {
    overflow: hidden !important;
}

/* ── Modal overlay ────────────────────────────────────────────── */
.mfv-booking-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.mfv-booking-modal--open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mfv-booking-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: mfvFadeIn 0.2s ease;
}

.mfv-booking-modal__dialog {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: mfvSlideUp 0.3s ease;
}

.mfv-booking-modal__content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    overflow-y: auto;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* ── Close button ─────────────────────────────────────────────── */
.mfv-booking-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--mfv-slate-100, #f1f5f9);
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: var(--mfv-slate-500, #64748b);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}

.mfv-booking-modal__close:hover {
    background: var(--mfv-slate-200, #e2e8f0);
    color: var(--mfv-slate-800, #1e293b);
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes mfvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes mfvSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Quick-actions trigger button ─────────────────────────────── */
/* Animated booking trigger — gradient border glow */
.mfv-booking-trigger a {
    position: relative !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--mfv-secondary, #7c3aed) 0%, var(--mfv-primary, #0e7490) 100%) !important;
    border-radius: 100px !important;
    padding: 10px 22px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap;
    box-shadow: 0 0 0 0 rgba(var(--mfv-secondary-rgb, 124, 58, 237), 0.4),
                0 2px 8px rgba(var(--mfv-primary-rgb, 14, 116, 144), 0.25) !important;
    animation: mfvBookPulse 2.5s ease-in-out infinite !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    z-index: 1 !important;
}
.mfv-booking-trigger a:hover,
.mfv-booking-trigger a:focus {
    color: #fff !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 16px rgba(var(--mfv-secondary-rgb, 124, 58, 237), 0.5),
                0 4px 14px rgba(var(--mfv-primary-rgb, 14, 116, 144), 0.3) !important;
    animation: none !important;
}
.quick-listing-actions > ul > li.mfv-booking-trigger > a > span,
.quick-listing-actions > ul > li.mfv-booking-trigger > a > i,
.quick-listing-actions > ul > li.mfv-booking-trigger > a:hover > span,
.quick-listing-actions > ul > li.mfv-booking-trigger > a:hover > i {
    color: #fff !important;
}
.mfv-booking-trigger a i {
    margin-right: 5px;
    font-size: 16px;
    vertical-align: middle;
}

@keyframes mfvBookPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--mfv-secondary-rgb, 124, 58, 237), 0.35), 0 2px 8px rgba(var(--mfv-primary-rgb, 14, 116, 144), 0.2); }
    50%      { box-shadow: 0 0 0 6px rgba(var(--mfv-secondary-rgb, 124, 58, 237), 0), 0 2px 12px rgba(var(--mfv-primary-rgb, 14, 116, 144), 0.35); }
}

/* ── Mobile floating CTA ─────────────────────────────────────── */
.mfv-booking-fab {
    display: none;
}

@media (max-width: 767px) {
    .mfv-booking-fab {
        display: block;
        position: fixed;
        bottom: 80px;
        right: 16px;
        z-index: 9999;
    }

    .mfv-booking-fab__btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 12px 22px;
        background: linear-gradient(135deg, var(--mfv-secondary, #7c3aed) 0%, var(--mfv-primary, #0e7490) 100%);
        color: #fff;
        border: none;
        border-radius: 50px;
        font-size: 14px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(var(--mfv-secondary-rgb, 124, 58, 237), 0.35);
        animation: mfvBookPulse 2.5s ease-in-out infinite;
        transition: transform 0.15s;
    }

    .mfv-booking-fab__btn:hover {
        animation: none;
        box-shadow: 0 4px 20px rgba(var(--mfv-secondary-rgb, 124, 58, 237), 0.5);
    }

    .mfv-booking-fab__btn:active {
        transform: scale(0.96);
    }

    .mfv-booking-fab__btn svg {
        flex-shrink: 0;
    }

    /* Hide FAB when modal is open */
    body.mfv-booking-body-lock .mfv-booking-fab {
        display: none;
    }
}

/* ── Header ───────────────────────────────────────────────────── */
.mfv-booking__header {
    text-align: center;
    margin-bottom: 24px;
}

.mfv-booking__title {
    font-family: var(--mfl-font-heading, 'Poppins', sans-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--mfv-slate-800, #1e293b);
    margin: 0 0 4px;
}

.mfv-booking__subtitle {
    font-size: 14px;
    color: var(--mfv-slate-500, #64748b);
    margin: 0;
}

/* ── Step indicators ──────────────────────────────────────────── */
.mfv-booking__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 10px;
}

.mfv-booking__step {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.mfv-booking__step--active,
.mfv-booking__step--done {
    opacity: 1;
}

.mfv-booking__step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--mfv-slate-200, #e2e8f0);
    color: var(--mfv-slate-500, #64748b);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s, color 0.3s;
}

.mfv-booking__step--active .mfv-booking__step-num {
    background: var(--mfv-primary, #0e7490);
    color: #fff;
}

.mfv-booking__step--done .mfv-booking__step-num {
    background: #10b981;
    color: #fff;
}

.mfv-booking__step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--mfv-slate-600, #475569);
    white-space: nowrap;
}

.mfv-booking__step-line {
    flex: 1;
    height: 2px;
    background: var(--mfv-slate-200, #e2e8f0);
    margin: 0 12px;
    min-width: 30px;
    transition: background 0.3s;
}

.mfv-booking__step-line--done {
    background: #10b981;
}

/* ── Panels ───────────────────────────────────────────────────── */
.mfv-booking__panel {
    display: none;
}

.mfv-booking__panel--active {
    display: block;
    animation: mfvPanelIn 0.3s ease;
}

/* ── Step 1: Services ─────────────────────────────────────────── */
.mfv-booking__services {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mfv-booking__service {
    cursor: pointer;
    display: block;
}

.mfv-booking__service-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mfv-booking__service-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border: 2px solid var(--mfv-slate-200, #e2e8f0);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    background: #fff;
}

.mfv-booking__service-card:hover {
    border-color: var(--mfv-primary, #0e7490);
    background: #f0fdfa;
}

.mfv-booking__service--selected .mfv-booking__service-card {
    border-color: var(--mfv-primary, #0e7490);
    box-shadow: 0 0 0 3px rgba(var(--mfv-primary-rgb, 14, 116, 144), 0.12);
    background: #f0fdfa;
}

.mfv-booking__service-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.mfv-booking__service-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--mfv-slate-800, #1e293b);
}

.mfv-booking__service-desc {
    font-size: 13px;
    color: var(--mfv-slate-500, #64748b);
    line-height: 1.4;
}

.mfv-booking__service-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 16px;
}

.mfv-booking__service-duration {
    font-size: 12px;
    color: var(--mfv-slate-400, #94a3b8);
    font-weight: 500;
}

.mfv-booking__service-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--mfv-primary, #0e7490);
}

/* ── Step 2: Date & Time ──────────────────────────────────────── */
.mfv-booking__datetime {
    display: flex;
    gap: 24px;
}

.mfv-booking__date-col {
    flex: 0 0 auto;
}

.mfv-booking__time-col {
    flex: 1;
    min-width: 0;
}

.mfv-booking__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--mfv-slate-600, #475569);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* jQuery UI Datepicker overrides */
.mfv-booking-modal .ui-datepicker {
    width: 100% !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    padding: 8px;
    box-shadow: none;
}

.mfv-booking-modal .ui-datepicker .ui-datepicker-header {
    background: var(--mfv-primary, #0e7490);
    color: #fff;
    border: none;
    border-radius: 6px 6px 0 0;
    padding: 8px;
}

.mfv-booking-modal .ui-datepicker .ui-datepicker-title {
    color: #fff;
}

.mfv-booking-modal .ui-datepicker td a.ui-state-default {
    border: none;
    background: transparent;
    text-align: center;
    border-radius: 6px;
    padding: 6px;
    transition: background 0.15s;
}

.mfv-booking-modal .ui-datepicker td a.ui-state-default:hover {
    background: #f0fdfa;
    color: var(--mfv-primary, #0e7490);
}

.mfv-booking-modal .ui-datepicker td a.ui-state-active {
    background: var(--mfv-primary, #0e7490);
    color: #fff;
}

.mfv-booking-modal .ui-datepicker td a.ui-state-highlight {
    background: #e0f2fe;
    color: var(--mfv-primary, #0e7490);
}

.mfv-booking-modal .ui-datepicker .ui-datepicker-prev,
.mfv-booking-modal .ui-datepicker .ui-datepicker-next {
    cursor: pointer;
    top: 8px;
}

.mfv-booking-modal .ui-datepicker .ui-datepicker-prev span,
.mfv-booking-modal .ui-datepicker .ui-datepicker-next span {
    display: none;
}

.mfv-booking-modal .ui-datepicker .ui-datepicker-prev::after {
    content: '\2039';
    font-size: 22px;
    color: #fff;
    display: block;
    text-align: center;
    line-height: 1;
}

.mfv-booking-modal .ui-datepicker .ui-datepicker-next::after {
    content: '\203A';
    font-size: 22px;
    color: #fff;
    display: block;
    text-align: center;
    line-height: 1;
}

/* ── Time slots ───────────────────────────────────────────────── */
.mfv-booking__slots {
    min-height: 160px;
}

.mfv-booking__slots-hint,
.mfv-booking__slots-empty,
.mfv-booking__slots-loading,
.mfv-booking__slots-error {
    color: var(--mfv-slate-400, #94a3b8);
    font-size: 14px;
    text-align: center;
    padding: 30px 10px;
    margin: 0;
}

.mfv-booking__slots-error {
    color: var(--mfv-error-light, #ef4444);
}

.mfv-booking__slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
}

.mfv-booking__slot {
    padding: 10px 4px;
    border: 2px solid var(--mfv-slate-200, #e2e8f0);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.mfv-booking__slot:hover {
    border-color: var(--mfv-primary, #0e7490);
    background: #f0fdfa;
    color: var(--mfv-primary, #0e7490);
}

.mfv-booking__slot--selected {
    border-color: var(--mfv-primary, #0e7490);
    background: var(--mfv-primary, #0e7490);
    color: #fff;
}

.mfv-booking__slot--selected:hover {
    background: #0c6b84;
    color: #fff;
}

.mfv-booking__slot--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Spinner */
.mfv-booking__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--mfv-slate-200, #e2e8f0);
    border-top-color: var(--mfv-primary, #0e7490);
    border-radius: 50%;
    animation: mfvSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ── Step 3: Summary ──────────────────────────────────────────── */
.mfv-booking__summary {
    margin-bottom: 20px;
}

.mfv-booking__summary-inner {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    padding: 14px 18px;
}

.mfv-booking__summary-row {
    font-size: 14px;
    color: #334155;
    padding: 3px 0;
}

.mfv-booking__summary-row strong {
    color: var(--mfv-primary, #0e7490);
    font-weight: 600;
    min-width: 80px;
    display: inline-block;
}

/* ── Step 3: Form fields ──────────────────────────────────────── */
.mfv-booking__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.mfv-booking__fields .mfv-booking__field:nth-child(3),
.mfv-booking__fields .mfv-booking__field:nth-child(4) {
    grid-column: 1 / -1;
}

.mfv-booking__req {
    color: var(--mfv-error-light, #ef4444);
}

.mfv-booking__input,
.mfv-booking__textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--mfv-slate-300, #cbd5e1);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--mfv-slate-800, #1e293b);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.mfv-booking__input:focus,
.mfv-booking__textarea:focus {
    outline: none;
    border-color: var(--mfv-primary, #0e7490);
    box-shadow: 0 0 0 3px rgba(var(--mfv-primary-rgb, 14, 116, 144), 0.1);
}

.mfv-booking__textarea {
    resize: vertical;
    min-height: 60px;
}

/* ── Navigation buttons ───────────────────────────────────────── */
.mfv-booking__nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--mfv-slate-100, #f1f5f9);
}

.mfv-booking__btn {
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.mfv-booking__btn:active {
    transform: scale(0.97);
}

.mfv-booking__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mfv-booking__btn--back {
    background: var(--mfv-slate-100, #f1f5f9);
    color: var(--mfv-slate-600, #475569);
}

.mfv-booking__btn--back:hover {
    background: var(--mfv-slate-200, #e2e8f0);
}

.mfv-booking__btn--next,
.mfv-booking__btn--submit {
    background: var(--mfv-primary, #0e7490);
    color: #fff;
    margin-left: auto;
}

.mfv-booking__btn--next:hover,
.mfv-booking__btn--submit:hover {
    background: #0c6b84;
}

.mfv-booking__btn--next:disabled:hover,
.mfv-booking__btn--submit:disabled:hover {
    background: var(--mfv-primary, #0e7490);
}

/* ── Messages ─────────────────────────────────────────────────── */
.mfv-booking__message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.mfv-booking__message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.mfv-booking__message--success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.mfv-booking__message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.mfv-booking__message--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 767px) {
    .mfv-booking-modal__dialog {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100%;
    }

    .mfv-booking-modal__content {
        border-radius: 0;
        max-height: 100vh;
        padding: 20px 16px;
    }

    .mfv-booking__title {
        font-size: 19px;
    }

    .mfv-booking__steps {
        padding: 0;
        margin-bottom: 20px;
    }

    .mfv-booking__step-label {
        display: none;
    }

    .mfv-booking__step-line {
        min-width: 20px;
    }

    .mfv-booking__datetime {
        flex-direction: column;
        gap: 20px;
    }

    .mfv-booking__date-col {
        flex: 1;
    }

    .mfv-booking__fields {
        grid-template-columns: 1fr;
    }

    .mfv-booking__fields .mfv-booking__field:nth-child(3),
    .mfv-booking__fields .mfv-booking__field:nth-child(4) {
        grid-column: auto;
    }

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

    .mfv-booking__nav {
        flex-direction: column;
    }

    .mfv-booking__btn {
        width: 100%;
        text-align: center;
    }

    .mfv-booking__btn--next,
    .mfv-booking__btn--submit {
        margin-left: 0;
        order: -1;
    }
}
