/* Полный сброс отступов */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0a0a 0%, #2c2c2c 100%);
    color: #ffffff;
    font-family: 'Montserrat', sans-serif; /* Изменили шрифт для всего сайта */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* --- ЛОГИКА ПЕРЕХОДОВ --- */
.hidden {
    display: none !important;
}

.page-container {
    width: 100%;
    height: 100vh;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 1;
    transform: scale(1);
    position: absolute; 
    top: 0;
    left: 0;
}

.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Анимация для Галереи */
.gallery-container {
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease;
    background: #0a0a0a;
    overflow: hidden;
    z-index: 30;
}

.gallery-container.slide-up {
    transform: translateY(0);
}

/* --- ФОНОВЫЙ СЛОЙ --- */
.main-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: flex;
    justify-content: center; 
    align-items: center;
    padding: 0;
    pointer-events: none;
    overflow: hidden;
}

.estate-image, .estate-image picture {
    display: block;
    width: 100%;
    height: 100%;
}

.estate-image img {
    height: 100vh; 
    width: 100vw;
    object-fit: cover; 
    object-position: center;
}

/* --- ВЕРХНИЙ СЛОЙ И ЦЕНТРИРОВАНИЕ --- */
.content-wrapper {
    position: relative;
    width: 100%;
    max-width: 1400px; 
    margin: 0 auto;
    height: 100vh;
    z-index: 10;
    pointer-events: none; 
}

.header {
    position: absolute;
    top: 6vh; 
    left: 20%; 
    display: flex;
    flex-direction: column; 
    gap: 30px; 
    pointer-events: auto; 
    padding: 0;
}

.logo img {
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0px 15px 20px rgba(0, 0, 0, 0.8)); 
}

/* --- НАВИГАЦИЯ (Десктоп) --- */
.nav-menu {
    display: flex;
    flex-direction: column; 
    gap: 15px; 
    margin: 0;
    width: 250px; 
}

.nav-btn {
    width: 100%;
    text-align: left; 
    background: rgba(30, 30, 30, 0.6); 
    color: #e0e0e0;
    border: 2px solid #8B6508; 
    padding: 14px 22px; 
    cursor: pointer;
    
    /* СТИЛИЗАЦИЯ ТЕКСТА КНОПОК */
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;                 /* Чуть уменьшили размер, так как шрифт сам по себе шире */
    font-weight: 600;                /* Сделали буквы более выразительными */
    text-transform: uppercase;       /* Все буквы заглавные (добавляет строгости) */
    letter-spacing: 1.5px;           /* Стильный разряд между буквами */
    
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6); 
}

.nav-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #D4AF37;
    border-color: #D4AF37;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(212, 175, 55, 0.2);
}

.nav-btn:active {
    transform: scale(0.98);
}

/* --- ВЫПАДАЮЩЕЕ МЕНЮ --- */
.dropdown-wrapper {
    position: relative;
    width: 100%;
}

.dropdown-menu {
    position: absolute; 
    bottom: -15px;      
    left: 100%;         
    margin-left: 15px;  
    width: max-content; 
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideUpRight 0.3s ease forwards; 
    z-index: 50;        
}

.sub-nav-btn {
    background: rgba(15, 15, 15, 0.933);
    color: #cccccc;
    border: 1px solid #8B6508;
    border-left: 4px solid #8B6508; 
    padding: 12px 20px;
    cursor: pointer;
    
    /* СТИЛИЗАЦИЯ ПОДМЕНЮ */
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    text-align: left;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.sub-nav-btn:hover {
    background: #4b3900c8; /* Плотный золотой цвет без прозрачности */
    color: #ffffff;      /* Текст становится черным для максимального контраста */
    border-left-color: #ffffff; /* По желанию: левая полоска подсветится белым */
    transform: translateX(8px); /* Легкий аккуратный сдвиг вправо при наведении */
}

/* Анимации */
@keyframes slideUpRight {
    from { opacity: 0; transform: translate(-15px, 15px); }
    to { opacity: 1; transform: translate(0, 0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ЭКРАНЫ: ЗАГЛУШКА И ГАЛЕРЕЯ --- */
#stub-page {
    z-index: 20;
    display: flex;
    flex-direction: column;
}
#stub-page:not(.hidden) { display: flex !important; }

.header-stub {
    padding: 20px 40px;
    position: relative;
    z-index: 10;
}
.stub-logo img { max-width: 80px; }

.stub-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.back-btn {
    font-size: 24px;          
    padding: 20px 80px;       
    border: 3px solid #D4AF37; 
    text-align: center;
    width: auto;
}

/* --- ЛЕНТА ГАЛЕРЕИ --- */
.gallery-scroll-view {
    width: 100%;
    height: calc(100vh - 120px); 
    overflow-y: auto;
    padding: 20px;
}

.gallery-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px; 
    padding-bottom: 60px;
}

.gallery-feed img {
    max-width: calc(100% - 40px); 
    height: auto;
    object-fit: contain;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* --- МОБИЛЬНАЯ ВЕРСИЯ (ДО 768px) --- */
@media (max-width: 768px) {
    .header {
        position: relative; 
        top: 0;
        left: 0; 
        padding: 20px;
        gap: 30px;
        align-items: center; 
    }

    .logo img {
        max-width: 200px;
    }

    .nav-menu {
        width: 100%;
        max-width: 320px; 
    }

    .nav-btn {
        padding: 12px 20px; 
        font-size: 13px;
    }

    .dropdown-menu {
        position: relative;
        left: 0;
        bottom: auto; 
        margin-left: 20px;
        margin-top: 10px;
        width: auto;
        animation: slideDown 0.3s ease forwards;
    }

    .header-stub {
        padding: 20px;
    }

    .stub-logo img {
        max-width: 60px;
    }

    #gallery-page .back-btn, #stub-page .back-btn {
        margin: 0 !important;
        font-size: 14px;
        padding: 10px 20px;
    }

    .gallery-scroll-view {
        height: calc(100vh - 80px);
    }
}