/* =========================================
   1. BASICS & VARIABLES
   ========================================= */
:root {
    --primary: #1C1C1E;
    --secondary: #8E8E93;
    --accent: #007AFF; /* Фирменный синий */
    --bg: #FAFAFA;
    --card-bg: #FFFFFF;
    --success: #34C759;
    --danger: #FF3B30;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--primary);
    line-height: 1.5;
    overflow-x: hidden; /* Скрываем горизонтальную прокрутку страницы */
    width: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.5px; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: 60px;
}

.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    height: 100%; display: flex; justify-content: space-between; align-items: center;
}

.logo { font-weight: 800; font-size: 20px; letter-spacing: -1px; }

.btn-small {
    padding: 8px 16px; background: var(--primary); color: white;
    border-radius: 20px; font-size: 13px; font-weight: 600;
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    height: 80vh; min-height: 500px;
    /* Фото на фоне (можно поменять ссылку) */
    background: url('https://images.unsplash.com/photo-1513519245088-0e12902e5a38?w=1200') center/cover no-repeat;
    position: relative; display: flex; align-items: center; justify-content: center;
    text-align: center; color: white;
}

.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
}

.hero-content { position: relative; z-index: 2; padding: 20px; max-width: 600px; }

.subtitle {
    text-transform: uppercase; letter-spacing: 2px; font-size: 12px;
    opacity: 0.9; display: block; margin-bottom: 10px; font-weight: 600;
}

.hero h1 { font-size: 42px; line-height: 1.1; margin-bottom: 20px; }
.hero p { font-size: 16px; opacity: 0.9; margin-bottom: 30px; }

.btn-hero {
    display: inline-block; padding: 14px 30px;
    background: white; color: black; font-weight: 600; border-radius: 30px;
    transition: transform 0.2s;
}
.btn-hero:active { transform: scale(0.95); }

/* =========================================
   4. MARQUEE (GALLERY FLOW) - MOBILE FIX
   ========================================= */
.gallery-flow {
    padding: 40px 0; background: white; overflow: hidden;
    position: relative; width: 100%;
}

.gallery-fade {
    position: absolute; inset: 0; pointer-events: none; z-index: 2;
    background: linear-gradient(to right, white 0%, transparent 15%, transparent 85%, white 100%);
}

.marquee-track {
    display: flex; gap: 16px; margin-bottom: 16px;
    width: max-content; /* ВАЖНО: ширина по содержимому */
    will-change: transform; /* Оптимизация для мобильных (GPU) */
}

/* Анимации движения */
.scroll-left { animation: scrollLeft 60s linear infinite; }
.scroll-right { animation: scrollRight 60s linear infinite; }

.marquee-group {
    display: flex; gap: 16px;
    flex-shrink: 0; /* ВАЖНО: Группа не сжимается */
}

.marquee-group img {
    height: 200px; width: 300px; 
    object-fit: cover; border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0; /* ВАЖНО: Фото не сжимаются */
    pointer-events: none; /* Убирает синее выделение при касании */
}

/* --- МОБИЛЬНЫЙ АДАПТИВ КАРУСЕЛИ --- */
@media (max-width: 768px) {
    .gallery-flow { padding: 25px 0; }
    
    .marquee-track { gap: 10px; margin-bottom: 10px; }
    .marquee-group { gap: 10px; }
    
    .marquee-group img {
        height: 130px; width: 180px; /* Уменьшаем размер для телефона */
        border-radius: 8px;
    }
}

@keyframes scrollLeft { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes scrollRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }


/* =========================================
   5. SCHEDULE (CARDS)
   ========================================= */
.section { padding: 60px 20px; }
.container { max-width: 1200px; margin: 0 auto; }
.section-title { font-size: 28px; margin-bottom: 30px; text-align: center; }

.grid-schedule {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg); border-radius: 20px; overflow: hidden;
    box-shadow: var(--shadow); transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); }

/* Слайдер внутри карточки */
.card-slider {
    height: 200px; overflow-x: auto; display: flex;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.card-slider::-webkit-scrollbar { display: none; }
.slide-img {
    min-width: 100%; height: 100%; object-fit: cover;
    scroll-snap-align: center;
}

.card-content { padding: 20px; display: flex; flex-direction: column; flex: 1; }

.badges-row { display: flex; justify-content: space-between; margin-bottom: 12px; }
.date-badge {
    background: #F2F2F7; padding: 4px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: #555; text-transform: uppercase;
}
.seats-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.seats-ok { background: #E8F5E9; color: #2E7D32; }
.seats-few { background: #FFEBEE; color: #C62828; }

.card-content h3 {
    font-size: 18px; line-height: 1.3;
    overflow-wrap: break-word; word-wrap: break-word; hyphens: auto;
}
.price-box { margin-bottom: 10px; font-size: 16px; font-weight: 600; }
.old-price { text-decoration: line-through; color: var(--secondary); font-size: 14px; margin-right: 6px; }
.time { font-size: 13px; color: var(--secondary); display: block; margin-bottom: 8px; }
.desc {
    font-size: 14px; color: #666; margin-bottom: 20px; flex: 1;
    overflow-wrap: break-word; word-wrap: break-word;
}

.btn-outline {
    width: 100%; padding: 12px; border: 1px solid var(--primary);
    background: transparent; border-radius: 12px; font-weight: 600; transition: 0.2s;
}
.btn-outline:active { background: var(--primary); color: white; }
.btn-disabled {
    width: 100%; padding: 12px; background: #eee; color: #999;
    border: none; border-radius: 12px; cursor: not-allowed;
}

/* =========================================
   6. MODALS
   ========================================= */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px);
    z-index: 2000; display: none; align-items: flex-end;
    opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.open { display: flex; opacity: 1; }

@media (min-width: 600px) {
    .modal-overlay { align-items: center; justify-content: center; }
    .modal-card { width: 450px; border-radius: 24px; }
}

.modal-card {
    background: white; width: 100%; border-radius: 24px 24px 0 0;
    padding: 24px; position: relative;
    max-height: 90vh; overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.close-btn {
    position: absolute; top: 16px; right: 16px;
    background: #F2F2F7; width: 32px; height: 32px; border-radius: 50%;
    border: none; font-size: 16px; display: flex; align-items: center; justify-content: center;
}

.modal-subtitle { color: var(--secondary); font-size: 14px; margin-bottom: 20px; }

/* Форма */
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: #555; }
.modal-input {
    width: 100%; padding: 14px; border-radius: 12px; border: 1px solid #eee;
    background: #F9F9F9; font-size: 16px; outline: none; transition: 0.2s;
}
.modal-input:focus { background: white; border-color: var(--accent); }

.guests-row { display: flex; gap: 15px; margin-bottom: 16px; }
.guest-col { flex: 1; }
.total-price { font-size: 20px; font-weight: 700; color: var(--accent); margin-top: 10px; }

/* Блок оплаты (Желтый) */
.payment-info {
    background: #FFF8E1; padding: 12px; border-radius: 10px;
    margin-bottom: 15px; border: 1px solid #FFE082; margin-top: 20px;
}
.card-number {
    display: flex; justify-content: space-between;
    font-family: monospace; font-size: 16px; font-weight: 700;
}
.copy-btn { border: none; background: none; font-size: 18px; }

.file-upload-box { position: relative; margin-bottom: 20px; }
.file-upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-name {
    display: block; padding: 14px; border: 1px dashed #ccc; border-radius: 12px;
    text-align: center; color: var(--secondary); font-size: 14px;
}

.main-btn {
    width: 100%; padding: 16px; background: var(--primary); color: white;
    border: none; border-radius: 14px; font-size: 16px; font-weight: 600;
}

/* Success Modal */
.success-mode .modal-card { text-align: center; padding: 40px 30px; }
.success-icon { font-size: 60px; margin-bottom: 20px; animation: popIn 0.5s; }
@keyframes popIn { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }

/* =========================================
   7. CHAT WIDGET
   ========================================= */
.faq-widget { position: fixed; bottom: 20px; right: 20px; z-index: 900; }
.faq-toggle {
    width: 56px; height: 56px; background: var(--primary); color: white;
    border-radius: 50%; border: none; font-size: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3); transition: transform 0.2s;
}
.faq-toggle:active { transform: scale(0.9); }

.chat-window {
    position: absolute; bottom: 70px; right: 0; width: 300px;
    background: white; border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none; flex-direction: column; overflow: hidden;
    transform-origin: bottom right; animation: scaleIn 0.2s;
}
.faq-widget.open .chat-window { display: flex; }
@keyframes scaleIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.chat-header { background: #F2F2F7; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.chat-title { display: flex; gap: 10px; align-items: center; }
.chat-close { background: none; border: none; font-size: 18px; color: #999; }

.chat-body { height: 250px; overflow-y: auto; padding: 16px; background: #fff; }
.message { padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; max-width: 80%; font-size: 14px; line-height: 1.4; }
.bot-msg { background: #F2F2F7; color: black; border-bottom-left-radius: 2px; }
.user-msg { background: var(--accent); color: white; align-self: flex-end; margin-left: auto; border-bottom-right-radius: 2px; }

.chat-options { padding: 10px; background: white; border-top: 1px solid #eee; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; background: #F2F2F7; border: none; border-radius: 16px; font-size: 12px; }
.chip.outline { border: 1px solid var(--accent); background: white; color: var(--accent); }

/* =========================================
   8. FOOTER
   ========================================= */
.bg-dark { background: #1C1C1E; color: white; }
.center-text { text-align: center; }

.social-links { display: flex; justify-content: center; gap: 20px; margin-top: 30px; }
.social-btn {
    width: 60px; height: 60px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 5px 15px rgba(255,255,255,0.1); transition: transform 0.2s;
}
.social-btn:hover { transform: translateY(-3px); }
.social-btn:active { transform: scale(0.9); }
.social-btn svg { width: 32px; height: 32px; }

/* Utils */
.hidden { display: none !important; }
.loading-skeleton { padding: 40px; text-align: center; color: #999; }