/* --- ПЕРЕМЕННЫЕ --- */
:root {
    --primary-dark: #111827;
    --primary-green: #006D5B;
    --accent-green: #D1FAE5;
    --bg-light: #F3F4F6;
    --text-gray: #4B5563;
    --white: #FFFFFF;
    --container-width: 1200px;
}

/* --- СБРОС СТИЛЕЙ --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--primary-dark);
    background-color: #fff;
    line-height: 1.6;
    position: relative;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; } /* height: auto важно для пропорций */
button { font-family: inherit; border: none; background: none; cursor: pointer; }

/* --- УТИЛИТЫ --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%; /* Гарантирует, что контейнер не шире экрана */
}

.section-padding { padding: 80px 0; }
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mb-50 { margin-bottom: 50px; }
.mt-20 { margin-top: 20px; }
.text-gray { color: var(--text-gray); }

/* --- ТИПОГРАФИКА --- */
h1 { font-size: 3.5rem; line-height: 1.1; font-weight: 800; margin-bottom: 20px; }
h2 { font-size: 42px; font-weight: 700; margin-bottom: 20px; line-height: 1.2; }
h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
h4 { font-weight: 700; font-size: 1.1rem; }
p { color: var(--text-gray); margin-bottom: 20px; }

/* --- КНОПКИ --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-dark);
    color: var(--white);
}
.btn-primary:hover { opacity: 0.9; }

.btn-ghost {
    background-color: transparent;
    color: var(--primary-dark);
}

.btn-white {
    background-color: white;
    color: var(--primary-dark);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-round {
    width: 50px; height: 50px; border-radius: 50%; padding: 0; flex-shrink: 0;
}

.wide-btn {
    border-radius: 50px; padding: 15px 40px;
}

.badge {
    display: inline-block;
    background: #FFE4E6;
    color: #BE123C;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.blue-badge { background: #E0F2FE; color: #0284C7; }

/* --- HEADER & NAV --- */
.header {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 100;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon { color: var(--primary-green); font-size: 1.8rem; }

.nav-links {
    display: flex;
    gap: 30px;
    font-weight: 500;
}
.nav-links a:hover { color: var(--primary-green); }

/* Гамбургер кнопка */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    z-index: 101;
}
.hamburger-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary-dark);
    border-radius: 3px;
}

/* --- МОБИЛЬНОЕ МЕНЮ --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; }

.mobile-menu {
    position: fixed;
    top: 0; right: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: white;
    z-index: 999;
    padding: 40px 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto; /* Скролл внутри меню если оно длинное */
}
.mobile-menu.active { transform: translateX(0); }

.close-menu-btn {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 2rem;
    line-height: 1;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
}
.mobile-link {
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- HERO SECTION --- */
.hero { padding: 60px 0 80px; }
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-content p { font-size: 1.125rem; margin-bottom: 30px; }
.hero-buttons { display: flex; gap: 15px; }

.hero-images {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: center;
}
.hero-img {
    border-radius: 16px;
    object-fit: cover;
    height: 400px;
    width: 100%;
}
.hero-img.small { height: 320px; }

/* --- STATS --- */
.stats {
    padding: 40px 0 100px 0;
}
.stats-grid {
    display: flex;
    justify-content: space-between;
    text-align: center;
    flex-wrap: wrap;
    gap: 20px;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-green);
}
.stat-sub { font-size: 0.8rem; color: #888; }
.stat-label { font-weight: 600; }

/* --- TESTIMONIALS --- */
.testimonials {
    background-color: #E6F6F4;
    padding: 100px 0;
}
.testimonials-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}
.reviews-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.review-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.review-text { font-size: 0.9rem; margin-bottom: 15px; }
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-avatar {
    width: 50px; height: 50px; border-radius: 50%; object-fit: cover;
}
.user-name { font-weight: 700; }
.user-role { font-size: 0.8rem; color: #888; }

/* --- PROCESS --- */
.process-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 80px;
    align-items: center;
    padding: 100px 0px;
}
.process-img-wrapper { position: relative; }
.process-img-wrapper img { border-radius: 16px; width: 100%; }

.floating-widget {
    position: absolute;
    bottom: -30px; right: -30px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 180px;
    text-align: center;
    z-index: 2;
}
.progress-bar {
    height: 4px; background: #eee; margin: 10px 0; border-radius: 2px;
}
.progress-fill {
    width: 85%; height: 100%; background: var(--primary-green);
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
.step-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 10px;
}
.step-desc { font-size: 0.9rem; }

/* --- CATEGORIES --- */
.subtitle-center { text-align: center; max-width: 600px; margin: 0 auto 50px; }
.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}
.cat-card img {
    border-radius: 12px;
    height: 300px;
    width: 100%;
    object-fit: cover;
    margin-bottom: 20px;
}
.cat-meta {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 5px;
}
.center-btn { text-align: center; }

/* --- BLOG --- */
.section-blog {padding: 100px 0px;}
.blog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}
.blog-card-large img {
    height: 250px; width: 100%;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.blog-item-small {
    display: flex;
    gap: 15px;
    align-items: center;
}
.blog-item-small img {
    width: 80px; height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0; /* Чтобы картинка не сжималась */
}
.blog-item-small h4 { font-size: 0.95rem; }
.blog-meta { font-size: 0.8rem; color: #888; }

/* --- NEWSLETTER --- */
.newsletter-box {
    background-color: #D4EAE8;
    border-radius: 20px;
    padding: 100px 0px;
    position: relative;
    overflow: hidden;
}
.newsletter-box .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
    
.newsletter-content { max-width: 500px; z-index: 2; width: 100%; }
.subscribe-form {
    background: white;
    padding: 5px;
    border-radius: 50px;
    display: flex;
    margin-top: 20px;
    width: 100%;
    max-width: 400px; /* Ограничение ширины формы */
}
.subscribe-form input {
    border: none;
    padding: 15px 20px;
    flex-grow: 1;
    border-radius: 50px;
    outline: none;
    min-width: 0; /* Важно для адаптивности flex */
}
.newsletter-img {
    max-width: 400px;
    border-radius: 12px;
}

/* --- FOOTER --- */
footer {
    padding: 60px 0;
    border-top: 1px solid #eee;
    margin-top: 80px;
    font-size: 0.9rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 30px;
}
.footer-col h4 { font-weight: 700; margin-bottom: 20px; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: var(--text-gray); }
.footer-col ul li a:hover { color: var(--primary-green); }
.footer-copy {
    text-align: center; margin-top: 50px; color: #888; font-size: 0.8rem;
}

/* ================================== */
/*          АДАПТИВ (MOBILE)          */
/* ================================== */

@media (max-width: 900px) {
    /* --- 1. Исправляем глобальные отступы --- */
    .section-padding { padding: 50px 0; }
    
    /* Header */
    .desktop-only { display: none; }
    .hamburger-btn { display: flex; }
    
    /* Typography */
    h1 { font-size: 1.5rem; word-wrap: break-word; } /* Чтобы длинные слова не рвали экран */
    h2 { font-size: 28px; line-height: 1.3; }
    .footer-col ul li { margin-bottom: 4px;}
    .footer-col h4 {margin-bottom: 10px;}
    footer {padding: 60px 0 20px 0;}

    /* --- 2. Hero Section --- */
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    /* Меняем порядок: картинка сверху, текст снизу */
    .hero-images { grid-template-columns: 1fr; order: -1; width: 100%; }
    .hero-img { height: auto; max-height: 300px; width: 100%; }
    .hero-img.small { display: none; }
    
    .hero-buttons { 
        flex-direction: column; 
        width: 100%; 
        align-items: stretch; /* Растягиваем кнопки на всю ширину */
    }
    .hero-buttons .btn { 
        width: 100%; 
        margin-bottom: 10px; 
        justify-content: center; /* Центрируем текст в кнопке */
    }

    /* --- 3. Stats --- */
    .stats-grid { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 30px 10px; 
    }

    /* --- 4. Testimonials --- */
    .testimonials-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .reviews-grid { grid-template-columns: 1fr; }

    /* --- 5. Process & Floating Widget (Исправлено) --- */
    .process-grid { grid-template-columns: 1fr; gap: 40px; padding: 70px 0px;}
    .process-img-wrapper { 
        margin-bottom: 20px; 
        display: flex; 
        flex-direction: column;
    }
    
    /* ПЛАШКА: Убираем absolute, делаем обычным блоком под картинкой */
    .floating-widget {
        position: static; /* Отключаем absolute */
        margin: 20px auto 0 auto; /* Центрируем с отступом сверху */
        width: 100%;
        max-width: 100%; /* Чтобы не вылезала */
        right: auto;
        bottom: auto;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Легкая тень */
        border: 1px solid #eee;
    }

    .steps-grid { grid-template-columns: 1fr;}

    /* --- 6. Categories --- */
    .categories-grid { grid-template-columns: 1fr; }
    .cat-card img { height: auto; max-height: 250px; width: 100%; }

    /* --- 7. Blog --- */
    .blog-grid { grid-template-columns: 1fr; }
    .blog-item-small img { flex-shrink: 0; } /* Не сжимать картинку блога */

    /* --- 8. Newsletter (Исправлено: паддинги) --- */
    .newsletter-box { 
        padding: 40px 20px; /* Уменьшили боковые отступы с 60px до 20px */
        text-align: center; 
        justify-content: center; 
        flex-direction: column; 
    }
    .newsletter-img { display: none; }
    
    .subscribe-form { 
        width: 100%; 
        max-width: 100%; 
        box-sizing: border-box; /* Важно */
        flex-direction: row; /* Оставляем в строку */
        padding: 5px;
    }
    
    .subscribe-form input {
        width: 100%;
        min-width: 0; /* Разрешаем сжиматься */
    }
    
    .subscribe-form .btn {
        flex-shrink: 0; /* Кнопка не сжимается */
    }

    /* --- 9. Footer --- */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; text-align: left; }
    .footer-brand { grid-column: span 1; }
}

@media (max-width: 480px) {
    /* Для совсем узких экранов */
    .stats-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (min-width: 0px) and (max-width: 900px) {
    .hero {padding: 0px;}
    body {padding: 0px 15px;}
    .section-blog {padding: 70px 0;}
    .testimonials {
        padding: 70px 15px;
        border-radius:20px;
    }
    .step-number {margin-bottom: 0px;}
    .steps-grid h3 {margin-bottom: 0px;}
    .step-desc {margin-bottom: 0px;}
    .steps-grid {gap: 20px;}
    .stats {padding: 40px 0;}
    h3 {
        font-size: 1.5rem;
        line-height: 1.9rem;
    }
    .categories-grid {gap: 40px;}
    .process-grid {padding: 70px 0px;}
    .section-blog {padding: 70px 0px;}
    .newsletter-box {padding: 70px 0px;}
    .newsletter-box .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0px 15px;
    }
}