/* styles.css
   Стили для визитки риелтора.
   Палитра: светлый фон, золотой акцент (#b8860b), тёмный текст.
   Шрифты: Playfair Display (заголовки) + Inter (основной текст). */

/* Подключаем Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ===== CSS-ПЕРЕМЕННЫЕ ===== */
:root {
    --bg-primary: #f7f8fc;
    --bg-secondary: #eef0f7;
    --bg-card: #ffffff;
    --accent-gold: #b8860b;
    --accent-gold-light: #d4a017;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8888a8;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* плавная прокрутка при нажатии на якорные ссылки */
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* растягиваем body на всю высоту экрана */
}

/* Контент между хедером и футером заполняет доступное место */
main, .page-main {
    flex: 1;
}

/* Для страниц без <main> — секция с карточками растягивается */
.section:last-of-type {
    flex: 1;
}

.footer {
    margin-top: auto; /* прижимаем футер к низу */
}

/* ===== НАВИГАЦИЯ ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(247, 248, 252, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(184, 134, 11, 0.15);
}

/* Логотип — золотой текст */
.navbar .logo {
    font-family: 'Playfair Display', serif;
    color: var(--accent-gold);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}

/* Ссылки навигации */
.navbar .nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.navbar .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    color: var(--accent-gold);
}

/* Золотая подчёркивающая линия на активной ссылке */
.navbar .nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gold);
}

/* ===== СЕКЦИЯ «ОБО МНЕ» (ГЕРОЙ) ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 40px 80px;
    background: radial-gradient(ellipse at top, #e8ecf8 0%, #f7f8fc 70%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1100px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    gap: 50px;
    text-align: left;
}

/* Заглушка аватара — золотая рамка, фиксированный размер */
.avatar-placeholder {
    width: 140px;
    height: 140px;
    min-width: 140px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.hero-content .subtitle {
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-bottom: 25px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-content .description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Контактные кнопки */
.contact-info {
    margin-top: 25px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-info a {
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.25);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px; /* расстояние между иконкой и текстом */
}

.contact-info a:hover {
    background: rgba(184, 134, 11, 0.15);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.15);
}

/* ===== ОБЩИЕ СТИЛИ СЕКЦИЙ ===== */
.section {
    padding: 80px 40px;
}

/* Заголовок секции + кнопка */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Кнопка «Смотреть все» — золотой контур */
.see-all-btn {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 22px;
    border: 1.5px solid var(--accent-gold);
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.see-all-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.25);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 50px;
    font-size: 1rem;
}

/* Альтернативный фон секции (чуть светлее) */
.section-alt {
    background: var(--bg-secondary);
    border-radius: 0;
    padding: 80px 40px;
    max-width: 100%;
}


/* ===== КОМПОНЕНТ КАРУСЕЛИ ===== */
.carousel {
    position: relative;
    display: flex;
    align-items: center;
}

/* Лента карточек */
.carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 15px 5px;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

/* Карточка внутри карусели */
.carousel-track .card {
    min-width: 300px;
    max-width: 320px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* Кнопки-стрелки карусели — скрыты по умолчанию, JS показывает если нужно */
.carousel-btn {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-gold);
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-gold);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: var(--accent-gold);
    color: #fff;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-left {
    left: -20px;
}

.carousel-btn-right {
    right: -20px;
}

/* ===== КАРТОЧКИ ОБЪЕКТОВ ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 300px);
    gap: 28px;
    justify-content: start; /* карточки выравниваются влево, не растягиваются */
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(184, 134, 11, 0.2);
    box-shadow: 0 12px 30px rgba(184, 134, 11, 0.08), 0 4px 15px rgba(0, 0, 0, 0.06);
}

/* Золотая полоска сверху карточки при наведении */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before {
    opacity: 1;
}

/* ===== ХЭШТЕГИ НА КАРТОЧКЕ ===== */
.card-hashtags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.card-hashtag {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.card:hover .card-hashtag {
    color: var(--accent-gold);
}

/* ===== ЗАЧЁРКНУТАЯ ЦЕНА ===== */
.card-price-block {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-price-old {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.card-price-new {
    color: #e74c3c;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ===== РЕАЛЬНОЕ ФОТО В КАРТОЧКЕ ===== */
/* Реальное фото в карточке — фиксированная высота, обрезается по центру */
.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover; /* масштабирует фото чтобы заполнить область, обрезая лишнее */
    display: block;
}

/* Заглушка изображения (если фото нет) */
.card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e8ecf8 0%, #dde2f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Текст карточки */
.card-body {
    padding: 16px 18px 18px;
}

.card-body h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Квадратура и адрес */
.card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.card-area {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 500;
}

.card-address {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Цена */
.card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* ===== ЗАГОЛОВОК ВНУТРЕННИХ СТРАНИЦ ===== */
.page-header {
    padding: 150px 40px 70px;
    background: radial-gradient(ellipse at top, #e8ecf8 0%, #f7f8fc 70%);
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.page-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* ===== ПОДВАЛ ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
    padding: 30px;
}

/* Иконки-ссылки в футере — в ряд по центру */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--accent-gold);
    transform: scale(1.2);
}

/* ===== МОДАЛЬНОЕ ОКНО (ПОПАП) ===== */
/* Затемнённый фон на весь экран — появляется поверх страницы */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;                    /* скрыто по умолчанию */
    pointer-events: none;          /* не перехватывает клики пока скрыто */
    transition: opacity 0.3s ease;
}

/* Когда модалка открыта — показываем overlay */
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Само окно модалки — по центру экрана */
.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

/* Анимация появления окна */
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Кнопка закрытия (×) — правый верхний угол */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-gold);
    transform: rotate(90deg);
}

/* Иконка типа недвижимости — большой значок вверху */
.modal-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 20px;
}

/* Заголовок объекта */
.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-align: center;
}

/* Характеристики (площадь, район и т.д.) */
.modal-features {
    color: var(--accent-gold);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Описание объекта */
.modal-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 25px;
    text-align: center;
}

/* Цена */
.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 25px;
}

/* Кнопка «Связаться» внизу модалки */
.modal-contact-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.modal-contact-btn:hover {
    background: var(--accent-gold-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

/* Курсор-указатель на карточках чтобы было понятно что они кликабельны */
.card {
    cursor: pointer;
}

/* ===== БУРГЕР-МЕНЮ (мобильное) ===== */
/* Кнопка-бургер — видна только на мобильных */
.burger-btn {
    display: none; /* скрыта на десктопе */
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    z-index: 1100;
}

/* ===== СЕКЦИЯ «ЦИФРЫ И ФАКТЫ» ===== */
/* Горизонтальная полоса с числовыми показателями для доверия */
.stats-section {
    padding: 60px 40px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.stats-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* Один блок с цифрой */
.stat-item {
    text-align: center;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== ПЛАВАЮЩАЯ КНОПКА WHATSAPP ===== */
/* Фиксирована в правом нижнем углу, всегда видна */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25d366; /* официальный зелёный WhatsApp */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform 0.3s, box-shadow 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

/* Пульсирующий эффект чтобы привлечь внимание */
.whatsapp-float::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25d366;
    z-index: -1;
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ===== АНИМАЦИИ ПРИ СКРОЛЛЕ ===== */
/* Элементы с классом animate-on-scroll начинают невидимыми и сдвинутыми вниз */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Когда JS добавляет класс "visible" — элемент плавно появляется */
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Задержки для каскадного эффекта (карточки появляются одна за другой) */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* ===== АДАПТИВ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    /* Навигация — горизонтальная с бургером */
    .navbar {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 14px 20px;
    }

    /* Показываем кнопку-бургер */
    .burger-btn {
        display: block;
    }

    /* Скрываем ссылки по умолчанию */
    .navbar .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(247, 248, 252, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 8px 0;
        gap: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    /* Каждый пункт меню — полная строка с разделителем */
    .navbar .nav-links li {
        list-style: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .navbar .nav-links li:last-child {
        border-bottom: none;
    }

    .navbar .nav-links a {
        display: block;
        padding: 14px 20px;
        font-size: 0.95rem;
        border-radius: 0;
        background: none;
    }

    /* Когда меню открыто */
    body.nav-open .navbar .nav-links {
        display: flex;
    }

    /* Светлая тема */
    body.light-theme .navbar .nav-links {
        background: rgba(247, 248, 252, 0.97);
    }

    .navbar .nav-links li {
        border-bottom-color: rgba(0,0,0,0.05);
    }

    .hero {
        padding: 100px 20px 60px;
    }

    /* На мобилке — обратно вертикально (фото сверху, текст снизу) */
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content .subtitle {
        font-size: 0.9rem;
    }

    .contact-info {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .contact-info a {
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .section {
        padding: 50px 20px;
    }

    .section-alt {
        padding: 50px 20px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
    }

    .carousel-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .carousel-btn-left {
        left: -8px;
    }

    .carousel-btn-right {
        right: -8px;
    }

    .carousel-track .card {
        min-width: 260px;
    }

    .page-header {
        padding: 120px 20px 50px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    /* Карточки в сетке — адаптивно по ширине */
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    /* Футер — иконки компактнее */
    .footer-links {
        gap: 20px;
        flex-wrap: nowrap;
    }

    .footer-links a svg {
        width: 20px;
        height: 20px;
    }

    /* «Объекты скоро появятся» — по центру */
    .carousel + p,
    .cards-grid + p {
        text-align: center;
        width: 100%;
    }
}
