/**
 * Booking Modal Styles
 * 2-step wizard modal
 */

/* Desktop: Center modal */
.km-booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

.km-booking-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    opacity: 1;
}

/* Mobile: Slide up from bottom (like uitkm-mobile-popup) */
@media (max-width: 768px) {
    .km-booking-modal {
        z-index: 10000 !important; /* Same as uitkm-mobile-popup */
    }
    
    .km-booking-modal.is-open {
        display: block !important; /* Use block instead of flex on mobile */
    }
}

.km-booking-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 0;
}

/* Desktop: Center content */
.km-booking-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Mobile: Slide up from bottom (like uitkm-mobile-popup) */
@media (max-width: 768px) {
    .km-booking-modal__content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        animation: km-booking-slideUp 0.3s ease-out;
    }
    
    @keyframes km-booking-slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* Mobile: Slide up from bottom */
@media (max-width: 768px) {
    .km-booking-modal__content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        animation: km-booking-slideUp 0.3s ease-out;
    }
    
    @keyframes km-booking-slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* Header */
.km-booking-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.km-booking-modal__back {
    position: absolute;
    margin: 0;
    left: 24px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #334155;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.km-booking-modal__back:hover {
    color: #2e438f;
}

.km-booking-modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    flex: 1;
    text-align: center;
}

.km-booking-modal__close {
    background: none;
    margin: 0;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    margin-left: auto;
}

.km-booking-modal__close:hover {
    color: #1e293b;
}

/* Body */
.km-booking-modal__body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}
button.km-booking-modal__time-chip span {
    text-transform: math-auto;
    letter-spacing: 0;
}
.km-booking-modal__section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.km-booking-modal__section-title i {
    font-size: 18px;
    color: #2e438f;
}

/* Date Selection */
/* Date Selection with Swiper */
.km-booking-modal__dates {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
}

.km-booking-modal__date-wrapper {
    flex: 1;
    overflow: hidden;
}

.km-booking-modal__date-grid {
    overflow: visible;
}

.km-booking-modal__date-grid .swiper-wrapper {
    display: flex;
}

.km-booking-modal__date-grid .swiper-slide {
    width: auto;
    flex-shrink: 0;
    height: auto;
}

.km-booking-modal__date-nav {
    width: 17px;
    height: 17px;
    min-width: 17px;
    min-height: 17px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0;
    font-size: 12px;
    box-shadow: 0 4px 12px 0 rgba(28, 30, 34, .08);
    border: none;
    padding: 0;
    box-sizing: border-box;
}

.km-booking-modal__date-nav:hover {
    background: #f8fafc;
}

.km-booking-modal__date-nav i {
    font-size: 12px;
    color: #64748b;
}

.km-booking-modal__date-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.km-booking-modal__date-item {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 0 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.km-booking-modal__date-item:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.km-booking-modal__date-item.is-selected {
    border-color: #2e438f;
    background: #f0f4ff;
}

.km-booking-modal__date-weekday {
    display: block;
    font-size: 13px;
    color: #64748b;
    background: linear-gradient(271.18deg, #ecf1ff 1.58%, #c7d1ed 98.18%);
    padding: 8px 4px 4px;
    margin-bottom: 10px;
    border-radius: 8px 8px 0px 0px;
}

.km-booking-modal__date-item.is-selected .km-booking-modal__date-weekday {
    background: linear-gradient(271.18deg, #2e438f 1.58%, #1e3268 98.18%);
    color: #ffffff;
}

.km-booking-modal__date-day {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: #475569;
}

.km-booking-modal__date-item.is-selected .km-booking-modal__date-day {
    color: #2e438f;
}

/* Time Selection with Swiper */
.km-booking-modal__times {
    display: flex;
    align-items: center;
    gap: 8px;
}

.km-booking-modal__time-wrapper {
    flex: 1;
    overflow: hidden;
}

.km-booking-modal__time-chips {
    overflow: visible;
}

.km-booking-modal__time-chips .swiper-wrapper {
    display: flex;
}

.km-booking-modal__time-chips .swiper-slide {
    width: auto;
    flex-shrink: 0;
    height: auto;
}

.km-booking-modal__time-nav {
    width: 17px;
    height: 17px;
    min-width: 17px;
    min-height: 17px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0;
    font-size: 12px;
    box-shadow: 0 4px 12px 0 rgba(28, 30, 34, .08);
    border: none;
    padding: 0;
    box-sizing: border-box;
}

.km-booking-modal__time-nav:hover {
    background: #f8fafc;
}

.km-booking-modal__time-nav i {
    font-size: 12px;
    color: #64748b;
}

.km-booking-modal__time-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.km-booking-modal__time-chip {
    padding: 0px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: rgba(51,65,85,.75);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
    margin: 0;
}

.km-booking-modal__time-chip i {
    font-size: 16px;
    color: inherit;
}

.km-booking-modal__time-chip:hover {
    border-color: #2e438f;
    background: #f8fafc;
}

.km-booking-modal__time-chip.is-selected {
    border-color: #2e438f;
    background: #2e438f;
    color: #ffffff;
}

.km-booking-modal__error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fee;
    border-radius: 6px;
    border: 1px solid #fcc;
}

/* Step 2: Contact Form */
.km-booking-modal__info-text {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0 0 24px;
    text-align: center;
}

.km-booking-modal__form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.km-booking-modal__field {
    position: relative;
    margin-bottom: 0;
}

.km-booking-modal__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 0;
}

.km-booking-modal__label .required {
    color: #E53935;
    margin-left: 2px;
}

.km-booking-modal__input {
    width: 100% !important;
    height: 48px !important;
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0 16px !important;
    color: #334155 !important;
    font-size: 14px !important;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    box-sizing: border-box !important;
}

.km-booking-modal__input:focus,
.km-booking-modal__input:focus-visible {
    border-color: #2e438f !important;
    box-shadow: 0 0 0 3px rgba(46, 67, 143, 0.1) !important;
    outline: none !important;
}

.km-booking-modal__input::placeholder {
    color: #94a3b8;
}

/* Error states */
.km-booking-modal__field.has-error .km-booking-modal__input {
    border-color: #E53935 !important;
}

.km-booking-modal__field.has-error .km-booking-modal__input:focus,
.km-booking-modal__field.has-error .km-booking-modal__input:focus-visible {
    border-color: #2e438f !important;
    box-shadow: 0 0 0 3px rgba(46, 67, 143, 0.1) !important;
}

/* Footer */
.km-booking-modal__footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
}

.km-booking-modal__btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.km-booking-modal__btn--primary {
    background: #2e438f;
    color: #ffffff;
    width: 100%;
}

.km-booking-modal__btn--primary:hover:not(:disabled) {
    background: #1e2f6f;
}

.km-booking-modal__btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.km-booking-modal__btn--full {
    width: 100%;
}

/* Steps */
.km-booking-modal__step {
    display: none;
}

.km-booking-modal__step.is-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Step 3: Success */
.km-booking-modal__body--success {
    text-align: center;
    padding: 48px 24px;
}

.km-booking-modal__success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
}

.km-booking-modal__success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
}

.km-booking-modal__success-text {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0;
}

/* Sidebar Integration */
.km-booking-sidebar {
    position: sticky;
    top: 100px;
}

.km-booking-sidebar__price {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 16px;
}

.km-booking-sidebar__price-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}

.km-booking-sidebar__price-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2e438f;
}

.km-booking-sidebar__date-strip {
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #334155;
}

/* Loading State */
.km-booking-modal__btn.is-loading {
    position: relative;
    color: transparent;
}

.km-booking-modal__btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: km-booking-spin 0.6s linear infinite;
}

@keyframes km-booking-spin {
    to {
        transform: rotate(360deg);
    }
}
.uitkm-lead-form{
    display: none;
}
/* Responsive */
@media (max-width: 767px) {
    .km-booking-modal__content {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        animation: slideUp 0.3s ease-out;
    }
    .uitkm-lead-form{
        display: block;
    }
    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .km-booking-modal__date-nav,
    .km-booking-modal__time-nav {
        width: 20px;
        height: 20px;
    }
    
    .km-booking-modal__date-item {
        padding: 0 0 8px;
    }
    
    .km-booking-modal__date-weekday {
        font-size: 11px;
        padding: 6px 4px 3px;
    }
    
    .km-booking-modal__date-day {
        font-size: 18px;
    }
    
    .km-booking-modal__time-chip {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }
    
    .km-booking-modal__time-chip i {
        font-size: 14px;
    }
}
