:root {
    --gold: #d4af37;
    --gold-dark: #b8860b;
    --gold-light: #f3e5ab;
    --black: #080808;
    --gray-dark: #121212;
    --gray-medium: #1a1a1a;
    --white: #ffffff;
    --text-muted: #a0a0a0;
    --tg-blue: #0088cc;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--black);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header - FIXED FOR PROPER SPACING */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

header.scrolled {
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(15px);
    padding: 10px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-box {
    background: radial-gradient(circle, #2a2a2a 0%, #080808 100%);
    padding: 5px 15px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
}

.main-logo { height: 60px; transition: var(--transition); }
header.scrolled .main-logo { height: 45px; }

.desktop-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.desktop-nav ul { 
    display: flex; 
    gap: 40px; 
}

.desktop-nav a {
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    white-space: nowrap;
}
.desktop-nav a:hover { color: var(--gold); }

.header-phone {
    flex-shrink: 0;
    text-align: right;
}

.header-phone a { font-weight: 800; font-size: 1.2rem; color: var(--gold); white-space: nowrap; }

.mobile-menu-btn { display: none; font-size: 1.8rem; cursor: pointer; color: var(--white); }

/* Hero Section */
.hero {
    min-height: 100vh;
    padding-top: 160px;
    padding-bottom: 80px;
    display: flex;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1619682817481-e994891cd1f5?q=80&w=1600') center/cover no-repeat;
    filter: brightness(0.3);
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(8,8,8,0.95) 0%, rgba(8,8,8,0.4) 50%, rgba(8,8,8,0.9) 100%);
    z-index: 2;
}

.hero-container-flex {
    position: relative;
    z-index: 10;
    width: 100%;
}

.hero-content-new {
    max-width: 800px;
    margin-top: 40px;
}

.hero-label {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 5px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 30px;
}

.hero-divider {
    width: 100px;
    height: 3px;
    background: var(--gold);
    margin-bottom: 35px;
}

.gold-gradient {
    background: linear-gradient(to right, #d4af37, #f3e5ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text {
    font-size: 1.3rem;
    color: var(--gray-light);
    margin-bottom: 50px;
    font-weight: 300;
    max-width: 600px;
}

.hero-action-btns {
    display: flex;
    gap: 25px;
    margin-bottom: 60px;
}

.btn-main {
    background: var(--gold);
    color: var(--black);
    padding: 18px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    display: inline-block;
}

.btn-sub {
    border: 2px solid var(--gold);
    color: var(--white);
    padding: 18px 40px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
    display: inline-block;
}

.hero-stats {
    display: flex;
    gap: 50px;
}

.stat-item { display: flex; flex-direction: column; }
.stat-num-box { display: flex; align-items: baseline; }
.stat-num { font-size: 2.5rem; font-weight: 900; color: var(--gold); min-width: 1.5ch; }
.stat-plus { font-size: 1.5rem; color: var(--gold); font-weight: 700; margin-left: 2px; }
.stat-lab { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

/* Services */
.services { padding: 120px 0; background-color: var(--black); position: relative; z-index: 20; }
.section-title-box { text-align: center; margin-bottom: 80px; }
.title-main { font-family: 'Playfair Display', serif; font-size: 3.5rem; margin-bottom: 20px; }
.title-line { width: 80px; height: 3px; background: var(--gold); margin: 0 auto; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--gray-dark);
    padding: 50px 40px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}
.service-card:hover { transform: translateY(-10px); border-color: var(--gold); }
.service-icon { font-size: 3rem; color: var(--gold); margin-bottom: 25px; }
.service-card h3 { font-size: 1.6rem; margin-bottom: 20px; font-family: 'Playfair Display', serif; }
.service-btn { color: var(--gold); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 10px; }

/* Portfolio */
.portfolio { padding: 120px 0; background: #050505; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 25px; }
.portfolio-item { position: relative; overflow: hidden; aspect-ratio: 16/10; border-radius: 4px; background: #1a1a1a; }
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.portfolio-item:hover img { transform: scale(1.1); }
.portfolio-hover {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    opacity: 0;
    transition: 0.4s;
}
.portfolio-item:hover .portfolio-hover { opacity: 1; }

/* About */
.about { padding: 120px 0; }
.about-flex { display: flex; gap: 80px; align-items: center; }
.about-img-box { position: relative; flex: 1; }
.about-img-box img { border-radius: 8px; box-shadow: 0 30px 60px rgba(0,0,0,0.5); }
.experience-card {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--gold);
    color: var(--black);
    padding: 25px;
    border-radius: 4px;
    text-align: center;
}
.experience-card .num { font-size: 2.5rem; font-weight: 900; display: block; line-height: 1; }
.experience-card .txt { font-weight: 700; text-transform: uppercase; font-size: 0.7rem; }
.about-content { flex: 1.2; }
.title-left { font-family: 'Playfair Display', serif; font-size: 3rem; margin-bottom: 30px; }
.feature-item { display: flex; gap: 20px; margin-top: 35px; }
.f-icon { font-size: 2rem; color: var(--gold); }
.f-text h4 { font-size: 1.3rem; margin-bottom: 5px; }

/* Contacts & Form */
.contacts { padding: 120px 0; background: var(--gray-dark); }
.contacts-grid-new { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; }
.c-item { display: flex; gap: 20px; font-size: 1.2rem; margin-top: 25px; }
.c-item i { color: var(--gold); }
.social-box { display: flex; gap: 20px; margin-top: 40px; }
.s-link { width: 50px; height: 50px; background: var(--gray-medium); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; border-radius: 50%; }
.s-link:hover { background: var(--gold); color: var(--black); transform: translateY(-5px); }

.form-card { background: var(--black); padding: 50px; border-radius: 8px; box-shadow: 0 30px 60px rgba(0,0,0,0.4); }
.form-card h3 { margin-bottom: 30px; font-size: 2rem; }
.form-card input, .form-card textarea {
    width: 100%;
    padding: 18px;
    margin-bottom: 20px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.05);
    color: #fff;
    font-family: inherit;
}

.policy-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 30px;
    text-align: left;
}
.policy-check input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.policy-check label { font-size: 0.85rem; color: var(--text-muted); cursor: pointer; line-height: 1.4; }
.policy-check label a { color: var(--gold); text-decoration: underline; }

.submit-btn {
    width: 100%;
    padding: 20px;
    background: var(--gold);
    border: none;
    color: var(--black);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
}
.submit-btn:hover { background: var(--gold-light); transform: translateY(-2px); }

/* Cookie Popup */
.cookie-popup {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(10px);
    padding: 25px;
    z-index: 5000;
    border-top: 1px solid var(--gold);
    transition: 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.cookie-popup.active { bottom: 0; }
.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}
.cookie-content p { font-size: 0.95rem; color: #eee; line-height: 1.5; }
.cookie-content a { color: var(--gold); text-decoration: underline; font-weight: 600; }
.btn-cookie {
    background: var(--gold);
    color: var(--black);
    padding: 12px 30px;
    border: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.3s;
}
.btn-cookie:hover { background: var(--white); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 6000;
    inset: 0;
    background: rgba(0,0,0,0.9);
    padding: 40px 20px;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--gray-dark);
    max-width: 800px;
    margin: 0 auto;
    padding: 50px;
    border-radius: 12px;
    border: 1px solid var(--gold);
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 50px 100px rgba(0,0,0,0.8);
}
.close-modal {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--gold);
    line-height: 1;
}
.modal-content h2 { margin-bottom: 30px; color: var(--gold); }
.modal-body p { margin-bottom: 20px; color: var(--gray-light); font-size: 1rem; line-height: 1.7; }

/* Floating Telegram */
.tg-fixed-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--tg-blue);
    padding: 15px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.4);
    transition: 0.3s;
}
.tg-fixed-btn:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0, 136, 204, 0.6); }
.tg-fixed-btn i { font-size: 1.5rem; }
.tg-fixed-btn span { font-weight: 700; }

/* Footer */
footer { padding: 80px 0; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-flex { display: flex; justify-content: space-between; align-items: center; }
.f-logo img { height: 50px; width: auto; opacity: 0.5; transition: 0.3s; }
.f-logo img:hover { opacity: 1; }
.f-copy { color: var(--text-muted); font-size: 0.9rem; }

/* Mobile Menu Overlay - FIXED FOR Z-INDEX AND DISPLAY */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--black);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: 0.5s;
}
.mobile-menu-overlay.active { transform: translateX(0); }
.mobile-menu-close { position: absolute; top: 40px; right: 40px; font-size: 3rem; color: var(--white); cursor: pointer; }
.mobile-nav li { margin-bottom: 30px; text-align: center; }
.mobile-nav a { font-family: 'Playfair Display', serif; font-size: 2.5rem; color: var(--white); }

/* Responsive */
@media (max-width: 992px) {
    .cookie-content { flex-direction: column; text-align: center; gap: 20px; }
    .hero-stats { gap: 30px; }
    .contacts-grid-new { gap: 40px; }
}

@media (max-width: 768px) {
    header { padding: 15px 0; }
    .main-logo { height: 50px; }
    .desktop-nav { display: none; } /* Ensure desktop nav hidden */
    .header-phone { display: none; } /* Hide phone on mobile header, use menu instead */
    .mobile-menu-btn { display: block; } /* Show burger */
    
    .hero { padding-top: 120px; }
    .hero-title { font-size: 2.8rem; }
    .hero-stats { flex-direction: column; align-items: flex-start; gap: 30px; }
    .stat-num { font-size: 2.2rem; }
    .footer-flex { flex-direction: column; gap: 30px; text-align: center; }
}

/* --- КРИТИЧЕСКИЕ ИСПРАВЛЕНИЯ МОБИЛЬНОЙ ВЕРСИИ --- */

@media (max-width: 768px) {
    /* 1. Исправление Hero кнопок и отступов */
    .hero {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 50px;
    }
    
    .hero-content-new {
        padding: 0 10px;
    }

    .hero-action-btns {
        flex-direction: column; /* Кнопки одна под другой */
        gap: 15px;
        width: 100%;
    }

    .btn-main, .btn-sub {
        width: 100%; /* Кнопки на всю ширину */
        text-align: center;
        padding: 16px 20px;
        font-size: 0.9rem;
    }

    /* 2. Исправление иконок в мобильном меню */
    .mobile-menu-overlay {
        justify-content: space-between;
        padding: 120px 20px 60px;
    }

    .mobile-nav ul {
        margin-bottom: 40px;
    }

    .mobile-nav a {
        font-size: 1.8rem; /* Чуть компактнее шрифт меню */
    }

    .mobile-contacts {
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .mobile-phone {
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--gold);
    }

    .mobile-social {
        display: flex;
        gap: 30px;
        justify-content: center;
    }

    .mobile-social .social-icon {
        width: 70px;  /* КРУПНЫЕ КНОПКИ */
        height: 70px;
        background: var(--gray-medium);
        border: 1px solid var(--gold);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem; /* Крупные иконки */
        color: var(--white);
    }

    .mobile-social .social-icon.tg { background: #0088cc; border: none; }
    .mobile-social .social-icon.wa { background: #25d366; border: none; }

    /* 3. Исправление секции Контакты и Формы */
    .contacts-grid-new {
        grid-template-columns: 1fr; /* Одна колонка */
        gap: 40px;
    }

    .form-card {
        padding: 30px 20px; /* Меньше отступы внутри формы */
        margin: 0 -10px; /* Чтобы форма не казалась слишком узкой */
    }

    .form-card h3 {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Исправление вылета за экран */
    .container {
        overflow: hidden;
    }

    .section-title-box .title-main {
        font-size: 2.2rem;
    }
}

/* --- ФИНАЛЬНЫЙ ФИКС ВЫЛЕТА ЗА ЭКРАН И ИКОНОК --- */

@media (max-width: 768px) {
    /* Принудительно скрываем любой горизонтальный скролл */
    body, html {
        overflow-x: hidden !important;
        position: relative;
        width: 100%;
    }

    /* Исправление кнопок в Hero (Обсудить в Max) */
    .hero-action-btns {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
        margin: 0 auto 40px !important;
        padding: 0 10px !important;
    }

    .btn-main, .btn-sub {
        width: 100% !important;
        max-width: 320px !important; /* Чтобы не были слишком огромными на планшетах */
        text-align: center !important;
        padding: 18px 20px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* Исправление иконок в мобильном меню (ТГ и WhatsApp) */
    .mobile-social {
        display: flex !important;
        justify-content: center !important;
        gap: 25px !important;
        margin-top: 30px !important;
    }

    .mobile-social .social-icon {
        width: 80px !important;  /* Еще больше - 80px */
        height: 80px !important;
        font-size: 2.5rem !important;
        background: var(--gray-medium) !important;
        border: 2px solid var(--gold) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: white !important;
    }

    /* Исправление вылета формы в Контактах */
    .contacts-grid-new {
        display: block !important; /* Уходим от гридов к блоку для надежности */
        width: 100% !important;
        padding: 0 !important;
    }

    .contacts-side {
        margin-bottom: 50px !important;
        text-align: center !important;
    }

    .form-side {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .form-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px 15px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border-radius: 0 !important; /* На мобилке лучше без закруглений по краям экрана */
    }

    /* Поля ввода тоже могут распирать */
    .form-card input, .form-card textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Исправляем контейнеры */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        overflow: hidden !important;
    }
}
