/* ==================== */
/* ОБЩИЕ СТИЛИ         */
/* ==================== */

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

body {
    /* Системный шрифт — мгновенно, без прыжков:
       Mac/iOS → SF Pro, Windows → Segoe UI, Android → Roboto */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #ecfdf5;
    color: #022c22;
    line-height: 1.5;
}

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

/* ==================== */
/* ЗАГОЛОВКИ СТРАНИЦ   */
/* ==================== */

.page-title {
    font-size: 22px;
    text-align: center;
    margin: 40px 0 30px;
    color: #064e3b;
    font-weight: 700;
    min-height: 1.3em;
}

.section-title {
    text-align: center;
    font-size: 36px;
    margin: 50px 0 30px;
    color: #064e3b;
    font-weight: 700;
}

/* ==================== */
/* ШАПКА               */
/* ==================== */

header {
    background: linear-gradient(135deg, #064e3b, #0d9488);
    color: #ffffff;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-bottom: 2px solid #f59e0b;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.logo img {
    height: 60px;
    width: auto;
    transition: opacity 0.3s;
    filter: brightness(0) invert(1);
}

.logo img:hover {
    opacity: 0.8;
}

.contacts-header {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.contact-item {
    display: inline-block;
    font-size: 13px;
    color: #ffffff;
}

.contact-item .icon {
    display: none;
}

.contact-item a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-item a:hover {
    opacity: 0.8;
    color: #f59e0b;
}

/* Иконки соцсетей */
.qr-icons {
    display: flex;
    gap: 12px;
}

.qr-icons a {
    text-decoration: none;
    border-bottom: none;
}

.social-icon {
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}

.social-icon:hover {
    transform: scale(1.1);
}

/* НАВИГАЦИЯ */
nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
    flex-wrap: wrap;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    padding-bottom: 5px;
}

nav a:hover,
nav a[aria-current="page"] {
    color: #f59e0b;
    border-bottom: 2px solid #f59e0b;
}

/* ==================== */
/* Изолируем main от stacking context sticky-шапки */
main {
    isolation: isolate;
}

/* HERO                */
/* ==================== */

.hero {
    background: linear-gradient(135deg, #022c22, #064e3b);
    color: #ffffff;
    text-align: center;
    padding: 60px 0 50px;
    border-bottom: 3px solid #f59e0b;
    min-height: 320px;
    display: flex;
    align-items: center;
}

.hero .container {
    width: 100%;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 12px;
    min-height: 1.2em;
    will-change: contents;
    backface-visibility: hidden;
}

.hero p {
    font-size: 17px;
    opacity: 0.9;
    min-height: 1.5em;
    margin-bottom: 40px;
}

/* Цифры внутри hero */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.hero-stat {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 20px 10px;
    transition: background 0.3s;
}

.hero-stat:hover {
    background: rgba(255,255,255,0.14);
}

.hero-stat-number {
    font-size: 38px;
    font-weight: 700;
    color: #f59e0b;
    line-height: 1;
    margin-bottom: 8px;
}

.hero-stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
}

/* ==================== */
/* БЛОК ЦИФР           */
/* ==================== */

/* Убран отдельный блок — цифры теперь внутри hero */

/* ==================== */
/* ПЛИТКА УСЛУГ        */
/* ==================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.service-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #d1fae5;
    position: relative;
    display: flex;
    flex-direction: column;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transition: width 0.3s;
    z-index: 2;
}

.service-card:hover::after { width: 100%; }

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.service-card:hover img { transform: scale(1.05); }

.service-card h3 {
    font-size: 20px;
    margin: 12px 10px 5px;
    color: #064e3b;
}

.service-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    padding: 0 10px 15px;
}

/* ==================== */
/* СТРАНИЦА РЕШЕНИЯ    */
/* ==================== */

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.solution-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #d1fae5;
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: default;
}

/* Только карточки-ссылки показывают указатель */
a.solution-card {
    cursor: pointer;
}

.solution-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transition: width 0.3s;
    z-index: 2;
}

.solution-card:hover::after { width: 100%; }

.solution-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.solution-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

/* Карточки с логотипами (позиции 5, 6, 7) — contain чтобы логотип не обрезался */
.solutions-grid .solution-card:nth-child(n+5) img {
    object-fit: contain;
    height: 180px;
    padding: 20px;
}

.solution-card:hover img { transform: scale(1.05); }

.solution-card h3 {
    font-size: 20px;
    margin: 12px 10px 5px;
    color: #064e3b;
}

.solution-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    padding: 0 10px 15px;
}

/* ============================================== */
/* КАРУСЕЛЬ ПАРТНЁРОВ: 3 видимых, центр цветной  */
/* ============================================== */

.partners-section {
    margin: 60px 0;
    padding: 30px 0 35px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.partners-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 25px;
    color: #064e3b;
    font-weight: 700;
}

.carousel-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    max-width: 800px;
    margin: 0 auto;
}

/* Область просмотра — скрывает лишние слайды */
.carousel-viewport {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.carousel-track {
    display: flex;
    gap: 24px;
    align-items: center;
    /* transition управляется JS */
}

.carousel-slide {
    /* ширина задаётся JS */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.carousel-slide img {
    width: 100%;
    height: 70px;
    object-fit: contain;
    display: block;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: filter 0.4s, opacity 0.4s, transform 0.4s;
}

.carousel-btn {
    flex: 0 0 auto;
    background: #064e3b;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover { background: #f59e0b; }

/* ==================== */
/* СТРАНИЦА ПРОЕКТЫ    */
/* ==================== */

.city-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.city-btn {
    background: #ffffff;
    border: 2px solid #064e3b;
    color: #064e3b;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s;
}

.city-btn:hover,
.city-btn.active {
    background: #064e3b;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.customers-columns {
    display: block;
}

.customer-group {
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #d1fae5;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.customer-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid currentColor;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.objects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.object-item {
    padding: 4px 8px;
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 12px;
    color: #064e3b;
    line-height: 1.5;
    transition: background 0.2s;
}

.object-item:hover {
    background: #d1fae5;
}

.map-container {
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #d1fae5;
    margin-bottom: 30px;
    border-radius: 16px;
}

.bi-group    { color: #0055cc; }
.aiva-group  { color: #2e7d32; }
.tumar-group { color: #800020; }
.nak-group   { color: #1a1a1a; }
.svoydom-group { color: #000000; }
.favorite-group { color: #b8860b; }

/* ==================== */
/* СТРАНИЦА О КОМПАНИИ */
/* ==================== */

.about-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    border: 1px solid #d1fae5;
}

.about-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

.about-content h2 {
    font-size: 28px;
    margin: 30px 0 20px;
    color: #064e3b;
}

.about-content ul {
    margin: 20px 0 20px 30px;
}

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

.contact-grid-new {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

.contact-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-info, .contact-map, .callback-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #d1fae5;
}

.contact-info h3, .contact-map h3, .callback-form h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #064e3b;
}

.contact-info p {
    margin-bottom: 12px;
    font-size: 15px;
}

.contact-info a {
    color: #064e3b;
    text-decoration: none;
}

.contact-info a:hover {
    color: #f59e0b;
    text-decoration: underline;
}

.contact-map #map {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
}

.callback-form p {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.callback-form input,
.callback-form textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

.callback-form input:focus,
.callback-form textarea:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.1);
}

.callback-form button {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #064e3b;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.callback-form button:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: translateY(-2px);
}

/* ==================== */
/* ПОДВАЛ              */
/* ==================== */

footer {
    background: linear-gradient(135deg, #022c22, #020617);
    color: #ecfdf5;
    padding: 40px 0 20px;
    margin-top: 60px;
    border-top: 2px solid #f59e0b;
}

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

.footer-col h4 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #fbbf24;
    border-left: 3px solid #f59e0b;
    padding-left: 12px;
}

.footer-col p {
    font-size: 14px;
    margin-bottom: 8px;
    color: #ecfdf5;
}

.footer-col a {
    color: #ecfdf5;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover { color: #fbbf24; }

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: #a7f3d0;
}

/* ==================== */
/* ПРОЧИЕ СТИЛИ        */
/* ==================== */

.projects-description {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-left: 4px solid #f59e0b;
    padding: 20px 25px;
    margin: 20px 0 30px;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.6;
    color: #064e3b;
}

.projects-description p { margin: 0; }
.projects-description strong { color: #064e3b; font-weight: 600; }

/* ===================== */
/* МОБИЛЬНАЯ ВЕРСИЯ     */
/* ===================== */

@media (max-width: 768px) {
    .container { padding: 0 16px; }

    .page-title  { font-size: 22px; }
    .section-title { font-size: 24px; }

    /* Шапка: логотип слева, иконки справа */
    header { padding: 10px 0; }

    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        margin-bottom: 4px;
    }

    .logo img { height: 36px; }

    /* Адрес и телефон — компактная строка по центру */
    .contacts-header {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        margin-bottom: 6px;
    }

    .contact-item { font-size: 11px; }

    /* Иконки соцсетей — справа от логотипа */
    .qr-icons {
        justify-content: flex-end;
        margin-top: 0;
    }

    .social-icon { width: 30px; height: 30px; }

    nav {
        border-top: 1px solid rgba(255,255,255,0.15);
        padding-top: 7px;
    }

    nav ul {
        justify-content: center;
        gap: 4px 12px;
    }

    nav a {
        font-size: 13px;
        padding: 3px 4px;
        white-space: nowrap;
    }

    .hero { padding: 40px 0 35px; min-height: unset; }
    .hero h1 { font-size: 22px; }
    .hero p  { font-size: 14px; margin-bottom: 25px; }

    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hero-stat-number { font-size: 28px; }
    .hero-stat-label  { font-size: 12px; }

    .services-grid  { grid-template-columns: 1fr; gap: 20px; }
    .solutions-grid { grid-template-columns: 1fr; gap: 20px; }

    /* Карусель на мобильных — кнопки чуть меньше */
    .carousel-btn { width: 32px; height: 32px; font-size: 13px; }
    .carousel-slide img { height: 50px; }

    .city-btn { padding: 8px 20px; font-size: 14px; }

    .objects-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }

    .contact-grid-new { grid-template-columns: 1fr; gap: 20px; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        text-align: left;
        gap: 15px;
    }

    .footer-col h4 {
        border-left: 3px solid #f59e0b;
        padding-left: 8px;
        text-align: left;
        font-size: 15px;
    }

    .footer-col p {
        font-size: 12px;
    }

    .projects-description {
        padding: 15px 18px;
        font-size: 14px;
        margin: 15px 0 20px;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 22px; }
    .city-btn { padding: 6px 12px; font-size: 12px; }
    .carousel-btn { width: 28px; height: 28px; font-size: 12px; }
    .carousel-slide img { height: 42px; }
}

@media (min-width: 640px) and (max-width: 1024px) {
    .services-grid  { grid-template-columns: repeat(2, 1fr); }
    .solutions-grid { grid-template-columns: repeat(2, 1fr); }
    .objects-grid   { grid-template-columns: repeat(3, 1fr); }
    .contact-grid-new { grid-template-columns: 1fr; gap: 30px; }
}

/* ======================== */
/* БУРГЕР-МЕНЮ (мобильное) */
/* ======================== */

.burger-btn {
    display: none; /* скрыт на десктопе */
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.burger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Анимация в крестик */
.burger-btn.burger-open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.burger-btn.burger-open span:nth-child(2) {
    opacity: 0;
}
.burger-btn.burger-open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
    .burger-btn {
        display: flex;
    }

    /* Прячем nav по умолчанию на мобиле */
    header nav {
        display: none;
        border-top: 1px solid rgba(255,255,255,0.15);
        padding-top: 10px;
        margin-top: 8px;
    }

    /* Показываем когда открыто */
    header nav.nav-open {
        display: block;
    }

    header nav ul {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    header nav ul li {
        width: 100%;
    }

    header nav a {
        display: block;
        padding: 10px 4px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        white-space: normal;
    }

    header nav ul li:last-child a {
        border-bottom: none;
    }

    /* Активная страница */
    header nav a[aria-current="page"] {
        color: #f59e0b;
        border-bottom-color: rgba(255,255,255,0.08);
    }
}
