/* ===== Базовые настройки и переменные ===== */
:root {
    --accent-color: #e67e22;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Темная тема (по умолчанию) */
.dark-theme {
    --primary-color: #3a8bb9;
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --header-bg: rgba(30, 30, 30, 0.98);
    --footer-bg: #0a0a0a;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

/* Светлая тема */
.light-theme {
    --primary-color: #2a6d8c;
    --bg-primary: #ffffff;
    --bg-secondary: #f4f7fb;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #666666;
    --header-bg: rgba(255, 255, 255, 0.98);
    --footer-bg: #1a2b3c;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* ===== ГЛОБАЛЬНЫЙ КОНТРОЛЬ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Защита от горизонтального скролла */
}

body {
    overflow-x: hidden; /* Защита от горизонтального скролла */
    width: 100%;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Типография ===== */
.section {
    padding: 80px 0;
}

.section__title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    font-weight: 700;
    color: var(--text-primary);
}

.section__title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    text-align: center;
}

.btn--primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.btn--primary:hover {
    background-color: #d35400;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(230, 126, 34, 0.4);
}

.btn--full {
    width: 100%;
}

/* ===== Шапка сайта ===== */
.header {
    position: fixed; /* Заменяем sticky на fixed для 100% надежности ⚓ */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 1; /* Позволяет логотипу сжиматься на мелких экранах */
}

.logo__icon {
    color: var(--accent-color);
    font-size: 2rem;
}

.logo__accent {
    color: var(--accent-color);
}

/* Управление шапкой (Тоггл + Бургер) */
.header__controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */
.theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    box-sizing: border-box;
    transition: var(--transition);
}

.theme-toggle__icon {
    font-size: 14px;
    z-index: 2;
    transition: var(--transition);
}

.theme-toggle__icon--light {
    color: #f39c12;
}

.theme-toggle__icon--dark {
    color: #f1c40f;
}

.theme-toggle__slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background-color: var(--accent-color);
    border-radius: 50%;
    transition: transform 0.3s ease;
    will-change: transform;
}

.light-theme .theme-toggle__slider {
    transform: translateX(32px);
}

/* ===== Навигация ===== */
.nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav__list {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav__link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav__link:hover,
.nav__link.active {
    color: var(--accent-color);
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.nav-toggle__bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Hero секция ===== */
.hero {
    position: relative;
    background: url(banner.jpeg) center/cover no-repeat;
    min-height: 600px;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero__container {
    position: relative;
    z-index: 2;
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.hero__subtitle {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.95;
}

/* ===== Секция "О технологии" ===== */
.about__content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about__text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

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

.stat-card {
    background: var(--bg-card);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-10px);
}

.stat-card__number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1.2;
}

.stat-card__label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===== Преимущества ===== */
.advantages {
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

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

.advantage-card {
    background: var(--bg-card);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.advantage-card:hover {
    transform: scale(1.03);
}

.advantage-card__icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.advantage-card h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.advantage-card p {
    color: var(--text-secondary);
}

/* ===== Технологический процесс ===== */
.process {
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

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

.process-step {
    background: var(--bg-card);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.process-step:hover {
    transform: translateY(-5px);
}

.process-step__number {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    opacity: 0.2;
    font-family: monospace;
}

.process-step__icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.process-step h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.process-step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== Контакты ===== */
.contact__wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.contact__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact__form input,
.contact__form textarea {
    padding: 15px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    color: var(--text-primary);
    width: 100%;
}

.contact__form input::placeholder,
.contact__form textarea::placeholder {
    color: var(--text-secondary);
}

.contact__form input:focus,
.contact__form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2);
}

.contact__info {
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
}

.contact__item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.contact__item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    width: 30px;
}

/* ===== Футер ===== */
.footer {
    background-color: var(--footer-bg);
    color: var(--text-secondary);
    padding: 30px 0;
    transition: background-color 0.3s ease;
}

.footer__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer__links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer__link:hover {
    color: var(--accent-color);
}

.footer__socials {
    display: flex;
    gap: 20px;
}

.footer__socials a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: var(--transition);
}

.footer__socials a:hover {
    color: var(--accent-color);
}

/* ===== Уведомления ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
}

.notification.show {
    display: block;
}

.notification.success { background-color: #4CAF50; }
.notification.error { background-color: #f44336; }
.notification.info { background-color: #2196F3; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.btn--loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn__loader::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media screen and (max-width: 992px) {
    .section__title { font-size: 2rem; }
    .hero__title { font-size: 2.8rem; }
}

@media screen and (max-width: 768px) {
    .container {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .nav-toggle {
        display: flex !important;
    }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%); /* Исправление горизонтального скролла */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        box-shadow: -5px 0 15px var(--shadow-color);
        transition: transform 0.3s ease; /* Анимируем transform, а не right */
        padding: 80px 20px 20px;
        z-index: 1000;
        border-left: 1px solid var(--border-color);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }

    .nav.active {
        transform: translateX(0); /* Показываем меню без сдвига документа */
    }

    .nav__list {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .nav__link {
        font-size: 1.2rem;
        display: block;
        padding: 10px;
        white-space: normal;
    }

    .nav-toggle.active .nav-toggle__bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .nav-toggle.active .nav-toggle__bar:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active .nav-toggle__bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .about__content,
    .contact__wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero__title { font-size: 2.2rem; }
    .hero__subtitle { font-size: 1.1rem; }
    .contact__wrapper { padding: 20px; }

    .footer__container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer__links {
        margin: 0;
    }
}

@media screen and (max-width: 480px) {
    .hero__title { font-size: 1.8rem; }
    .stat-card__number { font-size: 2.5rem; }
    .logo__text { font-size: 1.1rem; }
    .logo__icon { font-size: 1.5rem; }
    .contact__item { font-size: 1rem; gap: 10px; }
    .contact__item i { font-size: 1.2rem; }

    .header__controls { gap: 10px; }

    .theme-toggle {
        width: 54px;
        height: 28px;
    }

    .theme-toggle__slider {
        width: 20px;
        height: 20px;
    }

    .light-theme .theme-toggle__slider {
        transform: translateX(28px);
    }
}

.logo-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    color: inherit;
}

.logo-link:hover {
    opacity: 0.9;
}
