/* =====================================================================
   1. ОБЩИЕ НАСТРОЙКИ И СБРОС СТАНДАРТНЫХ СТИЛЕЙ БРАУЗЕРА
   ===================================================================== */

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

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

body {
    font-family: 'Montserrat', sans-serif;
    background: #0f0f0f;
    color: #fff;
    overflow-x: hidden; /* убирает горизонтальный скролл */
}

/* Цветовые переменные — меняешь тут, меняется на всём сайте */
:root {
    --orange: #ff8c00;
    --orange-light: #ffb347;
    --dark: #111111;
    --gray: #bcbcbc;
    --white: #ffffff;
    --shadow: 0 15px 40px rgba(0, 0, 0, .45);
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: auto; /* центрирует контент по ширине страницы */
}

section {
    padding: 110px 0;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3 {
    font-weight: 700;
}


/* =====================================================================
   2. ШАПКА САЙТА (HEADER) И ГЛАВНОЕ МЕНЮ (NAV)
   ===================================================================== */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 10, .72);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

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

nav {
    display: flex;
    gap: 38px;
}

nav a {
    color: white;
    font-weight: 600;
    position: relative;
    transition: .3s;
}

/* Оранжевая полоска под пунктом меню при наведении/активности */
nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 2px;
    background: var(--orange);
    transition: .35s;
}

nav a:hover {
    color: var(--orange);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a.active {
    color: var(--orange);
}

/* Логотип в шапке */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 56px;
    width: auto;
    display: block;
    transition: .3s ease;
}

.logo img:hover {
    transform: scale(1.08);
}

/* На широких экранах логотип чуть крупнее */
@media (min-width: 992px) {
    .logo img {
        height: 72px;
        width: auto;
        transition: .3s;
    }
}


/* =====================================================================
   3. БУРГЕР-МЕНЮ (МОБИЛЬНАЯ КНОПКА-ГАМБУРГЕР) И ЗАТЕМНЕНИЕ ФОНА
   ===================================================================== */

.mobile-title {
    display: none; /* название компании в шапке на мобильных, скрыто на десктопе */
}

.burger {
    display: none; /* сама кнопка-гамбургер, показывается только в мобильной версии */
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1101;
}

.burger span {
    width: 30px;
    height: 3px;
    background: #fff;
    border-radius: 5px;
    transition: .35s;
}

/* Анимация превращения гамбургера в крестик при открытии меню */
.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Полупрозрачная подложка позади открытого мобильного меню */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: .35s;
    z-index: 999;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* =====================================================================
   4. ГЛАВНЫЙ ЭКРАН (HERO) — БОЛЬШОЙ БЛОК С ФОНОВОЙ КАРТИНКОЙ
   ===================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: url("../images/background.jpg");
    /* современный формат webp подключается через image-set, jpg — запасной вариант */
    background: image-set(
        url("../images/background.webp") type("image/webp"),
        url("../images/background.jpg") type("image/jpeg")
    );
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed; /* фон "прибит" к экрану при прокрутке */
    overflow: hidden;
}

/* Тёмная плёнка поверх фоновой картинки, чтобы текст было лучше видно */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .15);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* Левая колонка hero-блока — здесь сейчас находятся кнопки.
   margin-top отвечает за то, насколько блок сдвинут вниз от верха экрана. */
.hero-left {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 300px;
}

.hero-brand {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.hero-logo {
    width: 520px;
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 25px;
}

.brand-line {
    width: 120px;
    height: 2px;
    background: linear-gradient(to right, var(--orange), transparent);
}

.hero h1 {
    font-size: clamp(42px, 6vw, 84px);
    line-height: 1.05;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-divider {
    width: 110px;
    height: 4px;
    background: var(--orange);
    margin-bottom: 25px;
}

.hero-subtitle {
    font-size: clamp(20px, 2vw, 28px);
    color: #ececec;
    margin-bottom: 12px;
}

.hero-services {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #cfcfcf;
    font-size: clamp(16px, 1.3vw, 20px);
    margin-bottom: 40px;
}

.hero-services span {
    color: var(--orange);
}


/* =====================================================================
   5. КНОПКИ НА ГЛАВНОМ ЭКРАНЕ ("Наша продукция" / "Связаться")
   ===================================================================== */

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 165px; /* <-- НИЖЕ: чуть опускает блок кнопок вниз. Увеличь число, чтобы опустить ещё ниже */
}

.btn, .btn-outline {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 16px 40px;
    border-radius: 8px;
    font-weight: 700;
    transition: .35s;
    cursor: pointer;
    min-width: 220px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Заливная оранжевая кнопка */
.btn {
    background: linear-gradient(135deg, var(--orange), #ff6a00);
    color: white;
    box-shadow: 0 0 25px rgba(255, 140, 0, .25);
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 35px rgba(255, 140, 0, .55);
}

/* Кнопка с обводкой (прозрачная) */
.btn-outline {
    border: 2px solid var(--orange);
    color: white;
}

.btn-outline:hover {
    background: var(--orange);
    transform: translateY(-4px);
}


/* =====================================================================
   6. КАРТОЧКИ-ПРЕИМУЩЕСТВА ВНУТРИ HERO (сейчас в HTML не используются,
      но стили оставлены на случай, если блок снова понадобится)
   ===================================================================== */

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    border-radius: 10px;
    transition: .35s;
}

.feature:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 140, 0, .4);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: #111;
}


/* =====================================================================
   7. СЕКЦИЯ "О КОМПАНИИ"
   ===================================================================== */

.about {
    background: #151515;
    text-align: center;
}

.about h2 {
    font-size: clamp(32px, 4vw, 48px);
    margin-bottom: 30px;
}

.about p {
    max-width: 900px;
    margin: auto;
    line-height: 1.9;
    color: #cfcfcf;
    font-size: 18px;
}


/* =====================================================================
   8. СЕКЦИЯ "ПОЧЕМУ ВЫБИРАЮТ НАС" (КАРТОЧКИ ПРЕИМУЩЕСТВ)
   ===================================================================== */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.card {
    position: relative;
    padding: 35px;
    border-radius: 12px;
    background: #181818;
    border: 1px solid rgba(255, 255, 255, .08);
    transition: .35s;
    overflow: hidden;
}

/* Оранжевая полоска сверху каждой карточки */
.card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--orange), #ffb347);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .45);
    border-color: rgba(255, 140, 0, .45);
}

.card h3 {
    margin-bottom: 18px;
    font-size: 24px;
}

.card p {
    color: #cfcfcf;
    line-height: 1.8;
}


/* =====================================================================
   9. ПОДВАЛ САЙТА (FOOTER)
   ===================================================================== */

footer {
    background: #0b0b0b;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 35px 0;
    text-align: center;
    color: #9f9f9f;
}


/* =====================================================================
   10. ОБЩИЕ МЕЛОЧИ (выделение текста мышкой, общие transition)
   ===================================================================== */

::selection {
    background: #ff8c00;
    color: white;
}

.btn, .btn-outline, .card, .feature, .logo img, nav a {
    transition: .35s ease;
}


/* =====================================================================
   11. АДАПТИВНОСТЬ (МЕДИА-ЗАПРОСЫ ДЛЯ ПЛАНШЕТОВ И ТЕЛЕФОНОВ)
   ===================================================================== */

/* --- Планшеты и меньше (до 991px): включаем мобильное меню --- */
@media (max-width: 991px) {
    header .container {
        height: 72px;
    }

    .logo img {
        display: none; /* на мобильных вместо картинки-логотипа показываем текст */
    }

    .mobile-title {
        display: block;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 22px;
        font-weight: 700;
        letter-spacing: 1px;
        white-space: nowrap;
    }

    .burger {
        display: flex;
        margin-left: auto;
    }

    /* Выезжающее меню справа */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #111;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 35px;
        transition: .4s;
        box-shadow: -10px 0 40px rgba(0, 0, 0, .45);
        z-index: 1000;
    }

    nav.active {
        right: 0;
    }

    nav a {
        font-size: 22px;
    }

    /* Мобильная версия фона hero-блока (отдельная картинка под телефоны) */
    .hero {
        background-attachment: scroll;
        text-align: center;
        background: url("../images/background-mobile.jpg");
        background: image-set(
            url("../images/background-mobile.webp") type("image/webp"),
            url("../images/background-mobile.jpg") type("image/jpeg")
        );
        background-size: cover;
        background-position: center top;
    }

    .hero-brand {
        justify-content: center;
    }

    .hero-divider {
        margin: 25px auto;
    }

    .hero-services {
        justify-content: center;
    }

    .buttons {
        justify-content: center;
    }

    .hero-features {
        margin-top: 55px;
    }
}

/* --- Телефоны (до 768px) --- */
@media (max-width: 768px) {
    section {
        padding: 80px 0;
    }

    .hero {
        padding-top: 120px;
        min-height: auto;
    }

    .hero-logo {
        width: 85px;
    }

    .hero h1 {
        letter-spacing: 1px;
    }

    .btn, .btn-outline {
        width: 100%;
        min-width: 0; /* кнопки на всю ширину экрана */
    }

    .cards {
        grid-template-columns: 1fr; /* карточки друг под другом */
    }

    .card {
        padding: 28px;
    }

    .about p {
        font-size: 16px;
    }
}

/* --- Маленькие телефоны (до 480px) --- */
@media (max-width: 480px) {
    .mobile-title {
        font-size: 18px;
    }

    .hero {
        padding-top: 100px;
    }

    .hero-logo {
        width: 70px;
    }

    .hero-services {
        font-size: 15px;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .feature {
        padding: 15px;
    }

    .card h3 {
        font-size: 21px;
    }
}

/* На узких экранах отключаем размытие шапки (тяжело для слабых телефонов) */
@media (max-width: 600px) {
    header {
        backdrop-filter: none;
        background: rgba(9, 9, 9, .92);
    }
}


/* =====================================================================
   12. СТРАНИЦА "КОНТАКТЫ"
   ===================================================================== */

.contacts-page {
    min-height: 100vh;
    padding: 160px 0 80px;
    background: #111;
    color: #fff;
    text-align: center;
}

.contacts-page h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.contacts-page p {
    color: #bdbdbd;
    margin-bottom: 60px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

.contact-card {
    padding: 35px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    transition: .35s;
}

.contact-card i,
.contact-svg {
    width: 42px;
    height: 42px;
    margin: 0 auto 18px;
    color: #d61f26;
    display: block;
}

.contact-card:hover {
    transform: translateY(-8px);
    border-color: #d61f26;
    box-shadow: 0 15px 40px rgba(214, 31, 38, .25);
}

.contact-icon {
    width: 52px;
    height: 52px;
    display: block;
    margin: 0 auto 10px auto;
    object-fit: contain;
}

.max-icon {
    transform: translateX(6px);
}

/* Блок с картами (Google/Яндекс карты) на странице контактов */
.maps-section {
    margin-top: 90px;
    text-align: center;
}

.maps-section h2 {
    font-size: 38px;
    margin-bottom: 15px;
}

.maps-grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.map-card {
    background: #1a1a1a;
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .08);
}

.map-card iframe {
    width: 100%;
    height: 350px;
    border: none;
    border-radius: 12px;
    margin: 20px 0;
}

.map-card .btn {
    width: 100%;
}


/* =====================================================================
   13. АНИМАЦИИ ПОЯВЛЕНИЯ ЭЛЕМЕНТОВ ПРИ ЗАГРУЗКЕ СТРАНИЦЫ
   ===================================================================== */

/* --- Появление hero-блока --- */
.hero {
    animation: heroFade 1.8s ease forwards;
}

.hero::before {
    animation: overlayFade 1.8s ease forwards;
}

@keyframes heroFade {
    from {
        opacity: 0;
        transform: scale(1.04);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes overlayFade {
    from {
        background: rgba(0, 0, 0, .6);
    }
    to {
        background: rgba(0, 0, 0, .15);
    }
}

/* --- Появление кнопок с небольшой задержкой друг за другом --- */
.buttons {
    opacity: 0;
    transform: translateY(35px);
    animation: buttonsFade 1.2s ease forwards;
    animation-delay: .6s;
}

.btn, .btn-outline {
    opacity: 0;
    transform: translateY(20px);
}

.btn {
    animation: buttonFade .8s ease forwards;
    animation-delay: .8s;
}

.btn-outline {
    animation: buttonFade .8s ease forwards;
    animation-delay: 1s;
}

@keyframes buttonsFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes buttonFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Появление карточек контактов по очереди --- */
.contact-card {
    opacity: 0;
    transform: translateY(40px);
    animation: contactFade .8s ease forwards;
}

.contact-card:nth-child(1) { animation-delay: .15s; }
.contact-card:nth-child(2) { animation-delay: .35s; }
.contact-card:nth-child(3) { animation-delay: .55s; }
.contact-card:nth-child(4) { animation-delay: .75s; }

@keyframes contactFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Появление карточек с картами --- */
.map-card {
    opacity: 0;
    transform: translateY(45px);
    animation: mapFade .9s ease forwards;
}

.map-card:nth-child(1) { animation-delay: .9s; }
.map-card:nth-child(2) { animation-delay: 1.1s; }

@keyframes mapFade {
    from {
        opacity: 0;
        transform: translateY(45px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =====================================================================
   14. ПРОИЗВОДИТЕЛЬНОСТЬ И ДОСТУПНОСТЬ
   ===================================================================== */

/* Браузер не рендерит содержимое этих блоков, пока пользователь до них
   не долистал — сайт быстрее грузится */
.about, .cards, footer {
    content-visibility: auto;
    contain-intrinsic-size: 1px 800px;
}

/* Если у пользователя в настройках ОС включено "уменьшить анимацию" —
   отключаем все переходы и анимации сайта */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================================
   ВЫПАДАЮЩЕЕ МЕНЮ «КАЛЬКУЛЯТОР» В ШАПКЕ
   ===================================================================== */

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    background: none;
    border: none;
    color: white;
    font-weight: 600;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding: 0;
    transition: .3s;
}

.nav-dropdown-trigger::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 2px;
    background: var(--orange);
    transition: .35s;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
    color: var(--orange);
}

.nav-dropdown-trigger:hover::after,
.nav-dropdown-trigger.active::after {
    width: 100%;
}

.nav-caret {
    font-size: 10px;
    transition: transform .3s;
    display: inline-block;
}

.nav-dropdown.open .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 22px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 200px;
    background: #161616;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: .25s;
    z-index: 1100;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
    transition: .2s;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(255, 140, 0, .12);
    color: var(--orange-light);
}

.nav-dropdown-menu a.active {
    color: var(--orange-light);
    background: rgba(255, 140, 0, .08);
}

/* --- Мобильная версия (внутри выезжающего меню-бургера) --- */
@media (max-width: 991px) {
    .nav-dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nav-dropdown-trigger {
        font-size: 22px;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
        border: none;
        background: transparent;
        max-height: 0;
        padding: 0;
        overflow: hidden;
        transition: max-height .3s ease, padding .3s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        max-height: 200px;
        padding: 10px 0 0;
    }

    .nav-dropdown-menu a {
        font-size: 17px;
        color: var(--gray);
    }
}
