        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&display=swap');

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* ИСПРАВЛЕНИЕ: Правильная настройка высоты и прокрутки */
        html {
            height: 100%;
            font-family: 'Inter', sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        body {
            min-height: 100%;
            margin: 0;
            padding: 0;
            font-family: inherit;
            background: #ffffff;
            transition: background 0.6s ease;
            overflow-x: hidden;
            position: relative;
        }

        /* Desktop - фиксированный viewport */
        @media (min-width: 769px) {
            body {
                height: 100vh;
                overflow: hidden;
            }
        }

        /* Mobile - разрешаем прокрутку */
        @media (max-width: 768px) {
            body {
                overflow-y: auto;
                -webkit-overflow-scrolling: touch; /* Momentum scrolling для iOS */
                overscroll-behavior-y: contain; /* Предотвращаем pull-to-refresh */
            }
            
            /* Фикс для iOS Safari адресной строки */
            body {
                min-height: 100vh;
                min-height: -webkit-fill-available;
            }
        }

        /* Ночной режим - темный фон */
        body.night-mode {
            background: #0e1116;
        }

        /* Блокировка скролла при открытом меню или галерее */
        body.scroll-lock {
            overflow: hidden !important;
            position: fixed !important;
            width: 100% !important;
            height: 100% !important;
        }

        /* Grain effect */
        body::after {
            content: "";
            position: fixed;
            inset: 0;
            pointer-events: none;
            opacity: 0.04;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="100%" height="100%" filter="url(%23n)"/></svg>');
            z-index: 1;
        }

        /* Loading spinner */
        .page-loader {
            position: fixed;
            inset: 0;
            background: #ffffff;
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.3s ease;
        }

        body.night-mode .page-loader {
            background: #0e1116;
        }

        .page-loader.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(0, 0, 0, 0.1);
            border-top-color: rgba(0, 0, 0, 0.8);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        body.night-mode .spinner {
            border-color: rgba(255, 255, 255, 0.1);
            border-top-color: rgba(255, 255, 255, 0.8);
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Main container - ИСПРАВЛЕНО для мобильных */
        .main-container {
            position: relative;
            width: 100%;
            display: flex;
            gap: 4px;
            padding: 0;
            z-index: 2;
        }

        /* Desktop layout */
        @media (min-width: 769px) {
            .main-container {
                height: 100vh;
                flex-direction: row;
            }
        }

        /* Mobile layout - ИСПРАВЛЕНО */
        @media (max-width: 768px) {
            .main-container {
                min-height: 100vh;
                min-height: -webkit-fill-available; /* iOS Safari fix */
                height: auto;
                flex-direction: column;
            }
        }

        /* Building section */
        .building-section {
            position: relative;
            flex: 1;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            isolation: isolate;
        }

        /* Desktop building sections */
        @media (min-width: 769px) {
            .building-section {
                height: 100%;
            }
        }

        /* Mobile building sections - ИСПРАВЛЕНО */
        @media (max-width: 768px) {
            .building-section {
                width: 100%;
                flex: 0 0 auto; /* Не сжимаем секции */
                height: 25vh;
                height: 25dvh; /* Dynamic viewport height для новых браузеров */
                min-height: 200px;
            }
            
            /* Дополнительный отступ для последней секции */
            .building-section:last-child {
                margin-bottom: env(safe-area-inset-bottom, 20px);
            }
        }

        /* iOS Safari specific fixes */
        @supports (-webkit-touch-callout: none) {
            @media (max-width: 768px) {
                .main-container {
                    padding-bottom: env(safe-area-inset-bottom);
                }
                
                .building-section {
                    height: 25vh;
                    /* Fallback для старых версий iOS */
                    height: calc(25 * var(--vh, 1vh));
                }
            }
        }

        /* Snap scrolling для лучшего UX на мобильных (опционально) */
        @media (max-width: 768px) {
            @supports (scroll-snap-type: y mandatory) {
                html {
                    scroll-snap-type: y proximity; /* proximity вместо mandatory для более мягкой прокрутки */
                    scroll-behavior: smooth;
                }
                
                .building-section {
                    scroll-snap-align: start;
                }
            }
        }
        
        /* Premium transition effects */
        .section-image {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            transition: transform 0.6s ease, filter 0.8s ease;
            z-index: 0;
            filter: brightness(1) contrast(1);
        }
        
        /* Premium overlay with multiple layers for depth */
        .section-image-overlay {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            opacity: 0;
            transform: scale(1.08) translateZ(0);
            transition: all 1.4s cubic-bezier(0.22, 1, 0.36, 1);
            z-index: 1;
            pointer-events: none;
            will-change: opacity, transform, filter;
            filter: brightness(1.1) contrast(0.95) saturate(1.2);
        }
        
        .section-image-overlay.transitioning {
            opacity: 1;
            transform: scale(1) translateZ(0);
            filter: brightness(1) contrast(1) saturate(1);
        }
        
        /* Subtle light effect during transition - much more delicate */
        .building-section::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(
                135deg,
                transparent 40%,
                rgba(255, 255, 255, 0.02) 50%,
                transparent 60%
            );
            z-index: 2;
            opacity: 0;
            transform: translateX(-100%) translateY(-100%);
            transition: all 1.4s cubic-bezier(0.22, 1, 0.36, 1);
            pointer-events: none;
        }
        
        body.night-mode .building-section::before {
            background: linear-gradient(
                135deg,
                transparent 40%,
                rgba(147, 197, 253, 0.03) 50%,
                transparent 60%
            );
        }
        
        .building-section.transitioning::before {
            opacity: 1;
            transform: translateX(100%) translateY(100%);
        }
        
        /* Premium content animation with blur */
        .building-section.transitioning .section-content {
            animation: contentPremiumShift 1.4s cubic-bezier(0.22, 1, 0.36, 1);
        }
        
        @keyframes contentPremiumShift {
            0% {
                transform: translateY(0) scale(1);
                filter: blur(0px);
                opacity: 1;
            }
            40% {
                transform: translateY(10px) scale(0.98);
                filter: blur(2px);
                opacity: 0.6;
            }
            60% {
                transform: translateY(10px) scale(0.98);
                filter: blur(2px);
                opacity: 0.6;
            }
            100% {
                transform: translateY(0) scale(1);
                filter: blur(0px);
                opacity: 1;
            }
        }
        
        /* Chromatic aberration effect for premium feel */
        @keyframes chromaticShift {
            0%, 100% {
                text-shadow: 
                    0 2px 12px rgba(0,0,0,0.6), 
                    0 1px 3px rgba(0,0,0,0.8);
            }
            50% {
                text-shadow: 
                    -1px 2px 12px rgba(255,0,0,0.15),
                    1px 2px 12px rgba(0,255,255,0.15),
                    0 1px 3px rgba(0,0,0,0.8);
            }
        }
        
        .building-section.transitioning .building-main {
            animation: chromaticShift 1.4s ease;
        }
        
        /* Premium glow effect during transition */
        .section-glow {
            position: absolute;
            inset: 0;
            background: linear-gradient(
                45deg,
                transparent 30%,
                rgba(255, 255, 255, 0.015) 50%,
                transparent 70%
            );
            z-index: 3;
            opacity: 0;
            transform: translateX(-100%);
            transition: none;
            pointer-events: none;
        }
        
        body.night-mode .section-glow {
            background: linear-gradient(
                45deg,
                transparent 30%,
                rgba(147, 197, 253, 0.02) 50%,
                transparent 70%
            );
        }
        
        .building-section.transitioning .section-glow {
            animation: glowSweep 1.4s cubic-bezier(0.22, 1, 0.36, 1);
        }
        
        @keyframes glowSweep {
            0% {
                opacity: 0;
                transform: translateX(-100%);
            }
            50% {
                opacity: 1;
            }
            100% {
                opacity: 0;
                transform: translateX(100%);
            }
        }

        /* Lens flare effect */
        .building-section::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 2;
            background: linear-gradient(
                105deg,
                transparent 35%,
                rgba(255, 255, 255, 0.06) 45%,
                rgba(255, 255, 255, 0.08) 50%,
                rgba(255, 255, 255, 0.06) 55%,
                rgba(255, 255, 255, 0.04) 60%,
                transparent 70%
            );
        }

        body.night-mode .building-section::after {
            background: linear-gradient(
                105deg,
                transparent 35%,
                rgba(147, 197, 253, 0.06) 45%,
                rgba(165, 180, 252, 0.08) 50%,
                rgba(139, 172, 246, 0.06) 55%,
                rgba(147, 197, 253, 0.04) 60%,
                transparent 70%
            );
        }

        .building-section:hover::after {
            opacity: 0.8;
            animation: lensFlare 4s ease-in-out infinite;
            animation-delay: 0.5s;
        }

        @keyframes lensFlare {
            0% {
                left: -100%;
                opacity: 0;
            }
            10% {
                opacity: 1;
            }
            50% {
                left: 100%;
                opacity: 1;
            }
            51% {
                opacity: 0;
            }
            100% {
                left: 100%;
                opacity: 0;
            }
        }

        /* Увеличение картинки при наведении - только для десктопа */
        @media (min-width: 769px) {
            .building-section:hover .section-image {
                transform: scale(1.05);
            }
        }

        /* Content */
        .section-content {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 40px 30px;
            z-index: 3;
            transition: transform 0.4s ease;
        }

        .building-main {
            font-size: 22px;
            font-weight: 300;
            color: rgba(255, 255, 255, 0.95);
            letter-spacing: 0.5px;
            margin-bottom: 8px;
            transition: all 0.4s ease;
            text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.8);
        }

        .building-section:hover .building-main {
            transform: translateY(-5px);
        }

        .building-address {
            font-size: 16px;
            font-weight: 400;
            color: rgba(255, 255, 255, 0.8);
            letter-spacing: 0.3px;
            opacity: 0;
            transform: translateY(10px);
            transition: all 0.4s ease 0.1s;
            text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.8);
        }

        .building-section:hover .building-address {
            opacity: 1;
            transform: translateY(0);
        }

        /* Accent line */
        .accent-line {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 3px;
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
            z-index: 4;
        }

        .building-section[data-building="A"] .accent-line { background: #B5693E; }
        .building-section[data-building="B"] .accent-line { background: #D4B483; }
        .building-section[data-building="C"] .accent-line { background: #D4A373; }
        .building-section[data-building="D"] .accent-line { background: #E3C58F; }

        .building-section:hover .accent-line {
            transform: scaleX(1);
        }

        /* Shared styles for day/night toggles */
        .theme-toggle {
            position: fixed;
            top: 20px;
            right: 40px;
            z-index: 1500;
            width: 72px;
            height: 36px;
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(20px) saturate(150%);
            -webkit-backdrop-filter: blur(20px) saturate(150%);
            border-radius: 36px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            cursor: pointer;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            box-shadow: 
                0 4px 16px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
        }

        .theme-toggle:hover {
            transform: translateY(-1px);
            box-shadow: 
                0 6px 20px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
        }

        .theme-toggle.night-mode {
            background: linear-gradient(135deg, rgba(20, 20, 35, 0.4) 0%, rgba(40, 40, 70, 0.3) 100%);
            border-color: rgba(100, 120, 255, 0.15);
            box-shadow: 
                0 4px 16px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(100, 120, 255, 0.05);
        }

        .toggle-slider {
            position: absolute;
            top: 50%;
            left: 4px;
            width: 28px;
            height: 28px;
            background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
            border-radius: 50%;
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            transform: translateY(-50%);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        }

        .theme-toggle.night-mode .toggle-slider {
            transform: translateX(36px) translateY(-50%);
            background: linear-gradient(135deg, #2a2a3e 0%, #1e1e2e 100%);
        }

        /* Icons */
        .sun-icon, .moon-icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            transition: all 0.4s ease;
        }

        .sun-icon {
            width: 18px;
            height: 18px;
            opacity: 1;
        }

        .theme-toggle.night-mode .sun-icon {
            opacity: 0;
            transform: translate(-50%, -50%) rotate(180deg) scale(0.5);
        }

        .moon-icon {
            width: 14px;
            height: 14px;
            opacity: 0;
            transform: translate(-50%, -50%) rotate(-180deg) scale(0.5);
        }

        .theme-toggle.night-mode .moon-icon {
            opacity: 1;
            transform: translate(-50%, -50%) rotate(0deg) scale(1);
        }

        .sun-icon svg, .moon-icon svg {
            width: 100%;
            height: 100%;
        }

        .sun-icon svg circle {
            fill: #FFC107;
        }

        .sun-icon svg line {
            stroke: #FFC107;
            stroke-width: 2;
            stroke-linecap: round;
        }

        .moon-icon svg {
            fill: #b8b8d0;
        }

        /* Gallery specific toggle position */
        .gallery-theme-toggle {
            top: 33px;
            right: 110px;
            opacity: 0;
            visibility: hidden;
        }

        .gallery-overlay.active .gallery-theme-toggle {
            opacity: 1;
            visibility: visible;
        }

        /* Mobile styles - ОБНОВЛЕНО */
        @media (max-width: 768px) {
            .section-content {
                padding: 30px 20px;
            }

            .building-main {
                font-size: 18px;
            }

            .building-address {
                font-size: 14px;
            }

            /* Главный переключатель день/ночь на странице */
            .theme-toggle:not(.gallery-theme-toggle) {
                top: 18px;
                right: 75px;
                width: 60px;
                height: 30px;
            }

            /* ИСПРАВЛЕНО: Переключатель день/ночь в галерее остается на месте */
            .gallery-theme-toggle {
                top: 33px !important;
                right: 110px !important;
                width: 72px !important;
                height: 36px !important;
            }

            .toggle-slider {
                width: 22px;
                height: 22px;
            }

            /* Размер слайдера для галерейного переключателя на мобильных */
            .gallery-theme-toggle .toggle-slider {
                width: 28px !important;
                height: 28px !important;
            }

            .theme-toggle.night-mode .toggle-slider {
                transform: translateX(30px) translateY(-50%);
            }

            /* Позиция слайдера для галерейного переключателя */
            .gallery-theme-toggle.night-mode .toggle-slider {
                transform: translateX(36px) translateY(-50%) !important;
            }
        }

        /* Loading animation */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .building-section {
            animation: fadeIn 0.8s ease backwards;
        }

        .building-section:nth-child(1) { animation-delay: 0.1s; }
        .building-section:nth-child(2) { animation-delay: 0.2s; }
        .building-section:nth-child(3) { animation-delay: 0.3s; }
        .building-section:nth-child(4) { animation-delay: 0.4s; }

        /* ========================================
           FULLSCREEN GALLERY - IMPROVED
           ======================================== */
        
        .gallery-overlay {
            position: fixed;
            inset: 0;
            background: #0e1116;
            z-index: 10000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1), background 0.8s ease;
        }

        .gallery-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        body.night-mode .gallery-overlay {
            background: #0e1116;
        }
        
        body:not(.night-mode) .gallery-overlay {
            background: #ffffff;
        }

        /* Gallery container */
        .gallery-container {
            position: relative;
            width: 100%;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Main image */
        .gallery-image {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            opacity: 0;
            transition: opacity 0.8s ease;
        }

        .gallery-image.active {
            opacity: 1;
        }

        /* Image loading state */
        .gallery-image.loading {
            filter: blur(5px);
            transform: scale(1.02);
        }

        /* Navigation arrows */
        .gallery-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 60px;
            height: 60px;
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            z-index: 2;
            outline: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }

        .gallery-nav:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-50%) scale(1.1);
        }

        .gallery-nav:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .gallery-nav.prev {
            left: 40px;
        }

        .gallery-nav.next {
            right: 40px;
        }

        .gallery-nav svg {
            width: 24px;
            height: 24px;
            stroke: rgba(255, 255, 255, 0.9);
            stroke-width: 2;
            fill: none;
            transition: stroke 0.3s ease;
            pointer-events: none;
        }

        body.day-mode .gallery-nav {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.1);
        }

        body.day-mode .gallery-nav svg {
            stroke: rgba(0, 0, 0, 0.7);
        }

        /* Close button */
        .gallery-close {
            position: absolute;
            top: 26px;
            right: 40px;
            width: 48px;
            height: 48px;
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            z-index: 3;
            outline: none;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }

        .gallery-close:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: rotate(90deg);
        }

        .gallery-close svg {
            width: 20px;
            height: 20px;
            stroke: rgba(255, 255, 255, 0.9);
            stroke-width: 2;
            pointer-events: none;
        }

        body.day-mode .gallery-close {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.1);
        }

        body.day-mode .gallery-close svg {
            stroke: rgba(0, 0, 0, 0.7);
        }

        /* Building info */
        .gallery-info {
            position: absolute;
            bottom: 48px;
            right: 32px;
            z-index: 2;
            padding: 20px 24px;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px) saturate(150%);
            -webkit-backdrop-filter: blur(20px) saturate(150%);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 16px;
            transition: all 0.3s ease;
            user-select: none;
        }

        .gallery-info:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
        }

        .gallery-building {
            font-size: 20px;
            font-weight: 300;
            color: rgba(255, 255, 255, 0.95);
            letter-spacing: 0.5px;
            margin-bottom: 4px;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .gallery-address {
            font-size: 13px;
            font-weight: 400;
            color: rgba(255, 255, 255, 0.7);
            letter-spacing: 0.3px;
        }

        body.day-mode .gallery-info {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }

        body.day-mode .gallery-building {
            color: rgba(0, 0, 0, 0.9);
            text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
        }

        body.day-mode .gallery-address {
            color: rgba(0, 0, 0, 0.6);
        }

        /* Progress dots with counter */
        .gallery-dots {
            position: absolute;
            bottom: 48px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 12px;
            z-index: 2;
            padding: 12px 20px;
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 30px;
            user-select: none;
        }

        .gallery-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.3);
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            outline: none;
            -webkit-tap-highlight-color: transparent;
        }

        .gallery-dot:hover {
            background: rgba(255, 255, 255, 0.5);
            transform: scale(1.3);
        }

        .gallery-dot.active {
            width: 20px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.9);
        }

        /* Counter for more than 10 images */
        .gallery-counter {
            font-size: 13px;
            color: rgba(255, 255, 255, 0.7);
            font-weight: 500;
            margin-left: 8px;
            letter-spacing: 0.5px;
        }

        body.day-mode .gallery-dots {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }

        body.day-mode .gallery-dot {
            background: rgba(0, 0, 0, 0.3);
        }

        body.day-mode .gallery-dot.active {
            background: rgba(0, 0, 0, 0.8);
        }

        body.day-mode .gallery-counter {
            color: rgba(0, 0, 0, 0.6);
        }

        /* Gallery title */
        .gallery-hint {
            position: absolute;
            bottom: 52px;
            left: 60px;
            font-size: 44px;
            color: rgba(255, 255, 255, 0.9);
            letter-spacing: 1px;
            z-index: 2;
            font-weight: 300;
            text-transform: none;
            user-select: none;
        }

        body.day-mode .gallery-hint {
            color: rgba(0, 0, 0, 0.8);
        }

        /* Loading progress bar */
        .gallery-progress {
            position: absolute;
            top: 0;
            left: 0;
            width: 0%;
            height: 2px;
            background: linear-gradient(90deg, #B5693E, #D4B483);
            transition: width 0.3s ease;
            z-index: 4;
        }

        /* Mobile adjustments */
        @media (max-width: 768px) {
            .gallery-nav.prev { left: 20px; }
            .gallery-nav.next { right: 20px; }
            
            /* ИСПРАВЛЕНО: Кнопка закрытия остается на десктопной позиции */
            .gallery-close { 
                top: 26px !important; 
                right: 40px !important;
                width: 48px !important;
                height: 48px !important;
            }
            
            .gallery-info { 
                bottom: 32px;
                right: 20px;
                padding: 16px 20px;
            }
            .gallery-dots { bottom: 32px; }
            .gallery-hint { display: none; }
            
            .gallery-building {
                font-size: 18px;
            }
            
            .gallery-address {
                font-size: 12px;
            }
        }

        /* Loading state */
        .gallery-loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 3;
            text-align: center;
        }

        .gallery-loading-spinner {
            width: 40px;
            height: 40px;
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-top-color: rgba(255, 255, 255, 0.8);
            border-radius: 50%;
            animation: gallerySpinner 0.8s linear infinite;
            margin: 0 auto 16px;
        }

        .gallery-loading-text {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.6);
            letter-spacing: 0.5px;
        }

        body.day-mode .gallery-loading-spinner {
            border-color: rgba(0, 0, 0, 0.1);
            border-top-color: rgba(0, 0, 0, 0.8);
        }

        body.day-mode .gallery-loading-text {
            color: rgba(0, 0, 0, 0.6);
        }

        @keyframes gallerySpinner {
            to { transform: rotate(360deg); }
        }

        /* Smooth image transitions */
        @keyframes imageSlideIn {
            from {
                opacity: 0;
                transform: scale(1.05);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .gallery-image.active {
            animation: imageSlideIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        /* Error state */
        .gallery-error {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            padding: 40px;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
        }

        .gallery-error-icon {
            width: 48px;
            height: 48px;
            margin: 0 auto 16px;
            opacity: 0.6;
        }

        .gallery-error-text {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 8px;
        }

        .gallery-error-subtext {
            font-size: 14px;
            color: rgba(255, 255, 255, 0.5);
        }

        body.day-mode .gallery-error {
            background: rgba(0, 0, 0, 0.04);
            border-color: rgba(0, 0, 0, 0.08);
        }

        body.day-mode .gallery-error-text {
            color: rgba(0, 0, 0, 0.8);
        }

        body.day-mode .gallery-error-subtext {
            color: rgba(0, 0, 0, 0.5);
        }