/* =======================================================
   1. БАЗА
   ======================================================= */
html, body {
    margin: 0; padding: 0;
    background-color: #111;
    font-family: 'Manrope', sans-serif;
    color: white;
    height: 100%;
    overflow: hidden; 
}

/* =======================================================
   2. ФОН
   ======================================================= */
.background-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
}
.bg-video { width: 100%; height: 100%; object-fit: cover; }
.bg-image {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 1; opacity: 1;
    transition: opacity 2.0s ease-in-out; 
}
.bg-image.hidden { opacity: 0; pointer-events: none; }

/* =======================================================
   3. ЛЕВАЯ ПАНЕЛЬ (СТЕКЛО)
   ======================================================= */
.glass-sidebar {
    position: absolute; top: 0; left: 0; width: 45%; height: 100%; z-index: 10;
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    padding: 60px; box-sizing: border-box;
    display: flex; flex-direction: column; overflow-y: auto; 
}
/* Скроллбар панели */
.glass-sidebar::-webkit-scrollbar { width: 6px; }
.glass-sidebar::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
.glass-sidebar::-webkit-scrollbar-thumb { background-color: #FF5E00; border-radius: 4px; }

/* =======================================================
   ЭЛЕМЕНТЫ ПАНЕЛИ
   ======================================================= */
.back-btn {
    position: absolute; top: 40px; right: 40px; z-index: 20;
    display: flex; align-items: center; justify-content: center; gap: 12px; 
    padding: 12px 28px; border-radius: 50px;
    text-decoration: none; color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.2);
    transition: 0.3s all ease; cursor: pointer;
}
.back-text { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.back-icon { font-size: 1.2rem; line-height: 1; position: relative; top: -1px; }
.back-btn:hover { background: #FF5E00; border-color: #FF5E00; color: white; }

.logo { text-decoration: none; color: white; display: block; margin-bottom: 60px; margin-top: 10px; }
.logo-main { font-size: 3.5rem; font-weight: 800; line-height: 0.8; text-transform: uppercase; margin-left: -3px; }
.logo span { display: block; font-size: 1rem; font-weight: 400; letter-spacing: 16px; margin-top: 10px; margin-left: 4px; color: rgba(255,255,255,0.65); }

.date { font-size: 0.9rem; color: rgba(255,255,255,0.6); margin-bottom: 20px; letter-spacing: 1px; }
h1 { font-size: 3rem; font-weight: 600; line-height: 1.1; margin: 0 0 20px 0; text-transform: uppercase; }
.subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.8); margin-bottom: 40px; }
.list-block { margin-bottom: 50px; font-size: 0.95rem; line-height: 1.8; color: rgba(255,255,255,0.9); }
.list-block ul { padding-left: 20px; margin: 0; }
.list-block li { margin-bottom: 5px; }

.slogan { font-size: 1rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; color: #FF5E00; }
.description { font-size: 0.95rem; line-height: 1.6; color: rgba(255,255,255,0.8); margin-bottom: 60px; max-width: 95%; }

.buttons-row { display: flex; gap: 15px; margin-top: auto; padding-bottom: 20px; }
.action-btn {
    padding: 12px 35px; border-radius: 50px;
    text-decoration: none; font-size: 0.9rem; font-weight: 600; text-transform: uppercase;
    transition: 0.3s; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.3); color: white;
}
.action-btn:hover { background: #FF5E00; color: white; border-color: #FF5E00; }


/* =======================================================
   4. ВИДЕО МОДАЛКА
   ======================================================= */
.video-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.98); z-index: 3000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.video-modal.active { opacity: 1; pointer-events: auto; }

.video-close {
    position: absolute; top: 40px; right: 40px; width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2);
    color: white; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s; z-index: 3010;
}
.video-close:hover { background: #FF5E00; border-color: #FF5E00; transform: rotate(90deg); }

.video-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.video-container iframe { width: 80%; height: 80%; max-width: 1280px; max-height: 720px; border-radius: 8px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.8); }


/* =======================================================
   5. ГАЛЕРЕЯ (MODAL)
   ======================================================= */
.gallery-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #111; z-index: 3000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.gallery-modal.active { opacity: 1; pointer-events: auto; }

/* Кнопка Закрыть */
.gallery-close {
    position: absolute; top: 40px; right: 40px;
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s; z-index: 3010;
}
.gallery-close:hover { background: #FF5E00; border-color: #FF5E00; transform: rotate(90deg); }

/* КОНТРОЛЛЕРЫ (ЛЕВЫЙ ВЕРХНИЙ УГОЛ) */
.gallery-controls {
    position: absolute; top: 40px; left: 40px;
    display: flex; flex-direction: column; gap: 15px; 
    z-index: 3005;
}

.toggle-switch { width: 110px; height: 50px; border-radius: 50px; position: relative; cursor: pointer; overflow: hidden; border: 1px solid rgba(255,255,255,0.2); transition: transform 0.2s; }
.toggle-bg { width: 100%; height: 100%; position: absolute; top: 0; left: 0; transition: background 0.4s ease; }
.bg-day { background: #d4bda5; } .bg-night { background: #2c3e50; } .bg-summer { background: #557c55; } .bg-winter { background: #89a9c2; }
.toggle-circle { width: 44px; height: 44px; background: white; border-radius: 50%; position: absolute; top: 2px; left: 3px; transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.toggle-switch.active .toggle-circle { transform: translateX(58px); }
.icon-box { position: absolute; top: 0; height: 100%; width: 50%; display: flex; align-items: center; justify-content: center; z-index: 1; pointer-events: none; opacity: 0.7; transition: opacity 0.3s; }
.toggle-switch.active .icon-box { opacity: 1; }
.icon-box.left { left: 0; color: #333; } .icon-box.right { right: 0; color: white; }
.icon-box svg { width: 22px; height: 22px; }

/* ОБЛАСТЬ ПРОСМОТРА */
.gallery-viewport {
    width: 100%; height: 100%; 
    position: relative;
    display: flex; align-items: center; justify-content: center;
    z-index: 3001; overflow: hidden;
}

.image-stack {
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
}

.gallery-image {
    position: absolute; 
    width: 100%; height: 100%; 
    object-fit: contain; 
    
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.6s ease;
    z-index: 1; will-change: transform, opacity;
}
.gallery-image.visible { opacity: 1; z-index: 10; transform: translate(0, 0) scale(1); filter: blur(0); }

/* Анимации (Desktop) */
.slide-left { transform: translateX(-100px) !important; opacity: 0 !important; }
.slide-right { transform: translateX(100px) !important; opacity: 0 !important; }
.blur { filter: blur(20px) !important; opacity: 0 !important; transform: scale(1.05) !important; }

/* --- ТОЧКИ (PAGINATION) --- */
.gallery-pagination {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 10px; z-index: 3010;
}
.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer; transition: all 0.3s ease;
}
.dot:hover { background: rgba(255, 255, 255, 0.5); transform: scale(1.2); }
.dot.active { background: #ffffff; transform: scale(1.2); box-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* Стрелки */
.nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s; z-index: 4000; color: white;
}
.nav-arrow:hover { background: #FF5E00; border-color: #FF5E00; transform: translateY(-50%) scale(1.1); }
.nav-arrow svg { width: 32px; height: 32px; stroke-width: 2; }
.nav-arrow.prev { left: 40px; } 
.nav-arrow.next { right: 40px; }

.loader { width: 40px; height: 40px; border: 3px solid #FF5E00; border-bottom-color: transparent; border-radius: 50%; position: absolute; animation: spin 1s linear infinite; display: none; z-index: 50; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =======================================================
   ФИКС ДЛЯ НОУТБУКОВ С МАСШТАБОМ 125-150-175%
   (Экстремально малая высота экрана: 600px - 900px)
   ======================================================= */
@media (min-width: 1024px) and (max-height: 900px) {
    .glass-sidebar { padding: 30px 40px; overflow-y: auto; }
    .logo { margin-bottom: 30px; margin-top: 0; }
    .logo-main { font-size: 2.5rem; } 
    .logo span { font-size: 0.8rem; letter-spacing: 12px; }
    .back-btn { top: 30px; right: 30px; }
    .date { margin-bottom: 10px; }
    h1 { font-size: 2.2rem; margin-bottom: 15px; line-height: 1.1; }
    .subtitle { margin-bottom: 20px; font-size: 1rem; }
    .list-block { margin-bottom: 20px; line-height: 1.4; font-size: 0.85rem; }
    .list-block ul { padding-left: 15px; }
    .slogan { margin-bottom: 15px; font-size: 0.9rem; }
    .description { margin-bottom: 30px; line-height: 1.4; font-size: 0.85rem; max-width: 100%; }
    .buttons-row { padding-bottom: 10px; margin-top: 10px; gap: 10px; }
    .action-btn { padding: 10px 25px; font-size: 0.8rem; }
    
    .gallery-controls { top: 20px; left: 30px; gap: 10px; transform: scale(0.9); transform-origin: top left; }
    .gallery-close { top: 20px; right: 30px; }
    .nav-arrow { width: 50px; height: 50px; }
    .nav-arrow.prev { left: 30px; }
    .nav-arrow.next { right: 30px; }
    .gallery-pagination { bottom: 20px; }
}

/* =======================================================
   АДАПТАЦИЯ (RESPONSIVE)
   ======================================================= */

/* --- 1. ПЛАНШЕТЫ И НОУТБУКИ (от 769px до 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
    .glass-sidebar { width: 100%; padding: 60px 30px; background: rgba(0,0,0,0.85); }
    .back-btn { top: 30px; right: 30px; }
    .gallery-viewport { width: 100%; height: 100%; }
    .image-stack { width: 100%; height: 100%; }
    .gallery-controls { scale: 0.9; top: 30px; left: 30px; gap: 15px; }
    .nav-arrow { width: 50px; height: 50px; }
    .nav-arrow.prev { left: 20px; }
    .nav-arrow.next { right: 20px; }
    .video-container iframe { width: 95%; height: 60%; }
}

/* ФИКС ДЛЯ МАСШТАБА WINDOWS 150% - 175% */
@media (min-width: 1024px) and (max-height: 700px) {
    .glass-sidebar { padding: 20px 30px !important; overflow-y: auto !important; justify-content: flex-start !important; }
    .logo { margin-top: 0 !important; margin-bottom: 20px !important; }
    .logo-main { font-size: 2rem !important; }
    .logo span { letter-spacing: 8px !important; font-size: 0.7rem !important; }
    .date { font-size: 0.8rem !important; margin-bottom: 5px !important; }
    h1 { font-size: 1.8rem !important; line-height: 1.1 !important; margin-bottom: 10px !important; }
    .subtitle { font-size: 0.9rem !important; margin-bottom: 15px !important; }
    .list-block { font-size: 0.8rem !important; line-height: 1.3 !important; margin-bottom: 15px !important; }
    .slogan { font-size: 0.85rem !important; margin-bottom: 10px !important; }
    .description { font-size: 0.8rem !important; line-height: 1.4 !important; margin-bottom: 20px !important; }
    .buttons-row { margin-top: 10px !important; padding-bottom: 20px !important; }
    .action-btn { padding: 8px 20px !important; font-size: 0.8rem !important; }
    .back-btn { top: 20px !important; right: 20px !important; padding: 8px 20px !important; }
}

/* --- 2. МОБИЛЬНЫЕ ВЕРТИКАЛЬНО (Portrait) --- */
@media (max-width: 768px) {
    
    /* 1. ОТКЛЮЧАЕМ ВИДЕО И ВКЛЮЧАЕМ КАРТИНКУ */
    .bg-video {
        display: none !important;
    }
    .bg-image {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* 2. ПАНЕЛЬ НА ВЕСЬ ЭКРАН */
    .glass-sidebar {
        width: 100%; 
        height: 100%;
        /* Делаем фон темнее для читаемости */
        background: rgba(0, 0, 0, 0.65); 
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 90px 20px 100px 20px;
    }

    /* 3. ИСПРАВЛЕНИЕ НАСЛОЕНИЯ КНОПКИ И ЛОГОТИПА */
    .back-btn {
        top: 25px;
        right: 20px; 
        padding: 8px 20px;
        background: rgba(0,0,0,0.5); 
    }
    
    .logo {
        margin-top: 0; 
        margin-bottom: 30px;
    }

    .logo-main { font-size: 2.8rem; }
    h1 { font-size: 2.2rem; line-height: 1.1; }

    /* 4. АДАПТАЦИЯ ТЕКСТА */
    .description { max-width: 100%; font-size: 0.95rem; }
    
    /* Кнопки действий */
    .buttons-row { flex-direction: column; width: 100%; }
    .action-btn { width: 100%; text-align: center; padding: 15px 0; }

    /* 5. ГАЛЕРЕЯ (ИСПРАВЛЕНА!) */
    .gallery-viewport {
        width: 100%;
        height: 100%;
        margin-top: 0;
        position: relative; 
    }
    
    .gallery-image {
        /* НОВОЕ ЦЕНТРИРОВАНИЕ (не ломается скриптом) */
        position: absolute;
        top: 0; bottom: 0; left: 0; right: 0;
        margin: auto !important;
        
        /* Размеры */
        width: auto !important;
        height: auto !important;
        max-width: 100%;
        max-height: 50vh; 
        
        object-fit: contain; 
        opacity: 0;
        transition: opacity 0.5s ease, transform 0.5s ease;
    }
    
    .gallery-image.visible { 
        opacity: 1 !important; 
        transform: scale(1); 
    }

    /* Анимации без translateY */
    .gallery-image.slide-left { 
        transform: translateX(-50px) !important; 
        opacity: 0 !important; 
    }
    .gallery-image.slide-right { 
        transform: translateX(50px) !important; 
        opacity: 0 !important; 
    }
    .gallery-image.blur { 
        transform: scale(1.05) !important; 
        opacity: 0 !important;
    }
    
    /* Управление кнопками */
    .gallery-controls { 
        top: auto;
        bottom: 100px;
        left: 50%; 
        transform: translateX(-50%) scale(0.8); 
        flex-direction: row; 
        gap: 15px;
        width: max-content; 
    }
    
    .gallery-pagination { bottom: 30px; }
    
    .nav-arrow { width: 40px; height: 40px; background: rgba(0,0,0,0.5); }
    .nav-arrow.prev { left: 10px; }
    .nav-arrow.next { right: 10px; }
}

/* --- 3. МОБИЛЬНЫЕ ГОРИЗОНТАЛЬНО (Landscape) --- */
@media (max-height: 500px) and (orientation: landscape) {
    
    .gallery-modal { 
        flex-direction: row; 
        padding: 0; 
        background: #000;
        align-items: center; justify-content: center;
    }
    
    .gallery-controls {
        position: absolute !important; left: 20px !important; top: 20px !important;
        transform: scale(0.7) !important; transform-origin: top left !important;
        flex-direction: column !important; gap: 10px !important;
        width: auto !important; margin: 0 !important; z-index: 3010 !important;
    }
    .toggle-switch { margin: 0 !important; }

    .gallery-viewport { 
        width: 100% !important; height: 100vh !important;
        margin: 0 !important; padding: 0 !important; box-sizing: border-box !important;
    }
    
    .gallery-image {
        width: 100% !important; height: 100% !important;
        object-fit: cover !important; 
        top: 0 !important; left: 0 !important; transform: none !important;
    }
    
    .gallery-image.visible { transform: scale(1) !important; }
    .gallery-image.slide-left { transform: translateX(-100px) !important; }
    .gallery-image.slide-right { transform: translateX(100px) !important; }

    .gallery-close, .video-close { 
        top: 20px !important; right: 20px !important; width: 40px; height: 40px; z-index: 3020;
    }
    
    .nav-arrow { 
        top: 50%; transform: translateY(-50%); z-index: 3005;
        width: 45px; height: 45px; background: rgba(0,0,0,0.5);
    }
    .nav-arrow.prev { left: 20px; right: auto; } 
    .nav-arrow.next { right: 20px; left: auto; }
    
    .gallery-pagination { bottom: 15px; left: 50%; transform: translateX(-50%); z-index: 3020; }
}