/* ============================================
   СТИЛИ МОДУЛЯ БРОНИРОВАНИЯ
   ============================================ */

/* Booking Preview Section */
.booking-preview {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.booking-teaser {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.booking-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    position: relative;
    overflow: hidden;
}

/* Декоративные элементы */
.booking-decoration {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.booking-decoration-1 {
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.booking-decoration-2 {
    bottom: -30px;
    left: -30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--danger));
}

.booking-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.booking-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.booking-description {
    font-size: 18px;
    color: var(--gray-600);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Преимущества бронирования */
.booking-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.booking-feature {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
}

.booking-feature-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.booking-feature-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.booking-feature-subtitle {
    font-size: 12px;
    color: var(--gray-600);
}

/* Кнопка бронирования с эффектом шиммера */
.booking-btn {
    font-size: 18px;
    padding: 16px 32px;
    position: relative;
    overflow: hidden;
}

.booking-btn-text {
    position: relative;
    z-index: 2;
}

.booking-btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.booking-btn:hover .booking-btn-shimmer {
    left: 100%;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО БРОНИРОВАНИЯ
   ============================================ */

.booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.booking-modal.show {
    opacity: 1;
}

.booking-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.booking-modal.show .booking-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

/* Заголовок модального окна */
.booking-modal-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 24px 40px;
    border-radius: 24px 24px 0 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-modal-header-content h2 {
    margin: 0;
}

.booking-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.booking-modal-subtitle {
    opacity: 0.9;
    margin: 0;
}

.booking-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.booking-modal-body {
    padding: 40px;
}

/* ============================================
   ШАГИ БРОНИРОВАНИЯ
   ============================================ */

.booking-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.step {
    text-align: center;
    padding: 20px;
    border-radius: 16px;
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    position: relative;
    transition: all 0.3s ease;
}

.step.active {
    border-color: var(--primary);
    background: var(--gray-50);
}

.step-number {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-300);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary);
}

.step-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.step-title {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 16px;
    transition: all 0.3s ease;
}

.step.active .step-title {
    color: var(--primary);
}

/* ============================================
   ШАГ 1: КАЛЕНДАРЬ И ВРЕМЯ
   ============================================ */

.booking-step {
    animation: fadeInUp 0.5s ease-out;
}

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

.booking-calendar-time-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.booking-section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Календарь */
.calendar-container {
    background: var(--gray-50);
    border-radius: 16px;
    padding: 24px;
}

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

.calendar-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.calendar-nav {
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    font-weight: bold;
}

.calendar-nav:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

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

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--gray-600);
    padding: 8px;
    font-size: 14px;
}

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

.calendar-day {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid transparent;
}

.calendar-day.past {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
}

.calendar-day.busy {
    background: #9ca3af;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.calendar-day.available {
    background: var(--secondary);
    color: white;
}

.calendar-day.available:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.calendar-day.selected {
    background: var(--primary) !important;
    border-color: var(--dark);
    transform: scale(1.15);
    animation: pulse 2s infinite;
}

/* Легенда календаря */
.calendar-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color-available {
    background: var(--secondary);
}

.legend-color-busy {
    background: #9ca3af;
    opacity: 0.6;
}

.legend-color-selected {
    background: var(--primary);
}

.legend-item span {
    color: var(--gray-600);
}

/* ============================================
   ВЫБОР ВРЕМЕНИ
   ============================================ */

.selected-date-info {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-date-info span {
    color: var(--gray-500);
    font-style: italic;
}

.selected-date-info .selected {
    color: var(--primary);
    font-weight: 600;
    font-style: normal;
}

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

.time-slot {
    padding: 14px 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.time-slot.available {
    background: var(--secondary);
    color: white;
}

.time-slot.available:hover {
    background: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.time-slot.busy {
    background: #9ca3af;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot.selected {
    background: var(--primary) !important;
    border-color: var(--dark);
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    animation: pulse 2s infinite;
}

/* Легенда времени */
.time-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    font-size: 12px;
}

/* Действия шага */
.booking-step-actions {
    text-align: center;
    margin-top: 32px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

#dateTimeNextBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-400) !important;
}

#dateTimeNextBtn:not(:disabled) {
    opacity: 1;
    cursor: pointer;
    background: var(--gradient-primary);
}

/* ============================================
   ШАГ 2: КОНТАКТНЫЕ ДАННЫЕ
   ============================================ */

.booking-step-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--dark);
    text-align: center;
}

/* Сводка бронирования */
.booking-summary {
    background: linear-gradient(135deg, var(--gray-50) 0%, #e8f2ff 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    border: 2px solid var(--primary);
}

.booking-summary-title {
    margin-bottom: 16px;
    color: var(--dark);
    text-align: center;
    font-size: 18px;
}

.booking-summary-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: center;
}

.booking-summary-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.booking-summary-label {
    color: var(--gray-600);
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.booking-summary-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
}

/* Поля формы */
.booking-form-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.booking-form-fields .form-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: var(--dark);
}

.booking-form-fields .form-input::placeholder {
    color: var(--gray-500);
}

.booking-form-fields .form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Валидация полей */
.form-input.valid {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ============================================
   АНИМАЦИИ
   ============================================ */

/* Пульсация для выбранных элементов */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .booking-modal-content {
        width: 98% !important;
        max-height: 95vh !important;
        border-radius: 16px !important;
    }
    
    .booking-modal-header {
        padding: 20px !important;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .booking-modal-body {
        padding: 24px !important;
    }
    
    .booking-steps {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .booking-calendar-time-container {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    
    .calendar-grid {
        font-size: 12px !important;
    }
    
    .calendar-day {
        height: 40px !important;
        font-size: 13px !important;
    }
    
    .time-slots {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .time-slot {
        padding: 12px 8px !important;
        font-size: 13px !important;
    }
    
    .booking-summary {
        padding: 20px !important;
    }
    
    .booking-summary-details {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .booking-form-fields {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .calendar-legend,
    .time-legend {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        text-align: center !important;
    }

    .booking-step-actions {
        flex-direction: column;
        align-items: center;
    }

    .booking-step-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .booking-features {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

@media (max-width: 480px) {
    .booking-modal-title {
        font-size: 20px !important;
    }
    
    .booking-modal-subtitle {
        font-size: 14px !important;
    }
    
    .calendar-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    .time-slots {
        grid-template-columns: 1fr !important;
    }
    
    .booking-card {
        padding: 24px 20px !important;
    }
    
    .booking-title {
        font-size: 24px !important;
    }
    
    .booking-description {
        font-size: 16px !important;
    }

    .booking-modal-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .calendar-container {
        padding: 16px;
    }

    .selected-date-info {
        padding: 12px;
        min-height: 50px;
    }

    .booking-section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
}

/* ============================================
   СКРОЛЛБАР ДЛЯ МОДАЛЬНОГО ОКНА
   ============================================ */

.booking-modal-content::-webkit-scrollbar {
    width: 4px;
}

.booking-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.booking-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.booking-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Фокус для элементов календаря */
.calendar-day:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.time-slot:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Улучшенная видимость для пользователей с ограниченными возможностями */
@media (prefers-reduced-motion: reduce) {
    .booking-step,
    .calendar-day,
    .time-slot,
    .booking-btn-shimmer {
        animation: none !important;
        transition: none !important;
    }
}

/* Высокий контраст */
@media (prefers-contrast: high) {
    .calendar-day.available,
    .time-slot.available {
        border: 2px solid var(--dark);
    }
    
    .calendar-day.selected,
    .time-slot.selected {
        border: 3px solid var(--dark);
    }
}