/* ====== НАСТРОЙКА ЦВЕТОВ ====== */
:root {
    --primary: #004a8f;
    --accent: #f47920;
    --text: #333333;
    --bg-light: #f5f7fa;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Сброс только для body и основных элементов, чтобы не ломать админку */
body, h1, h2, h3, p, ul, li, a, div, section, main {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ====== АНИМАЦИИ ПРИ СКРОЛЛЕ ====== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}
/* задержки для каскадного появления */
.services-grid .service-card:nth-child(1) { transition-delay: 0.1s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.2s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.3s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.4s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.5s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.6s; }
.services-grid .service-card:nth-child(7) { transition-delay: 0.7s; }
.services-grid .service-card:nth-child(8) { transition-delay: 0.8s; }
.services-grid .service-card:nth-child(9) { transition-delay: 0.9s; }

.about-content .about-text,
.about-content .about-image {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.about-content .about-image {
    transform: translateX(-40px);
}
.about-content .about-text {
    transform: translateX(40px);
}
.about-content.visible .about-text,
.about-content.visible .about-image {
    opacity: 1;
    transform: translateX(0);
}

/* ====== ШАПКА ====== */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo a {
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    color: #999999;
    letter-spacing: 1px;
    display: inline-block;
}

.logo a strong {
    font-size: 2.4rem;
    color: #0b98d5;
    font-weight: 700;
}

.logo .slogan {
    color: #999999;
    font-size: 14px;
    text-shadow: #cccccc -1px -2px 2px;
    display: block;
    align-self: flex-end;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 25px;
    font-size: 0.95rem;
}
.header-contacts a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
}
.header-contacts .address {
    color: #666;
}

/* ====== ГЛАВНЫЙ ЭКРАН ====== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #002856 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}
.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    font-weight: 700;
}
.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}
.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    padding: 14px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(244, 121, 32, 0.4);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    margin-left: 15px;
}
.btn-outline:hover {
    background: rgba(255,255,255,0.15);
}

/* ====== СЕКЦИИ ====== */
.section {
    padding: 70px 0;
}
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;
    color: var(--primary);
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ====== УСЛУГИ ====== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--white);
    border-radius: 16px;
    padding: 35px 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
    text-align: center;
    min-height: 280px; /* Гарантируем высоту */
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(0,0,0,0.1);
}
.service-card.featured {
    background: var(--accent);
    color: var(--white);
    border: none;
    box-shadow: 0 10px 30px rgba(244, 121, 32, 0.3);
}
.service-card.featured .card-icon {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}
.service-card.featured h3 {
    color: var(--white);
}
.service-card.featured p {
    color: rgba(255,255,255,0.9);
}
.card-icon {
    width: 70px;
    height: 70px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--primary);
}
.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--primary);
}
.service-card p {
    font-size: 0.95rem;
    color: #666;
    flex-grow: 1; /* Растягиваем текст, чтобы иконки не прыгали */
}

/* ====== О КОМПАНИИ ====== */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}
.about-text {
    flex: 1 1 400px;
}
.about-text p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}
.about-image {
    flex: 1 1 300px;
    background: var(--bg-light);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

/* ====== КОНТАКТЫ ====== */
.contacts-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 40px;
}
.contact-item {
    flex: 1 1 250px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
}
.contact-item .icon {
    font-size: 2rem;
    margin-bottom: 15px;
}
.contact-item h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

/* ФОРМА */
.contact-form .form-group {
    margin-bottom: 20px;
}
.contact-form .form-group input,
.contact-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}
.contact-form .form-group textarea {
    height: 120px;
    resize: vertical;
}
.contact-form .btn {
    width: 100%;
    background: var(--accent);
    color: var(--white);
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.contact-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(244, 121, 32, 0.4);
}

/* ПОДВАЛ */
.footer {
    background: #1a1a1a;
    color: #ccc;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .header-contacts {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    .btn-outline {
        margin-left: 0;
        margin-top: 10px;
    }
    .about-content {
        flex-direction: column-reverse;
    }
}

/* Ошибки формы */
.contact-form .form-group input.field-error,
.contact-form .form-group textarea.field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    animation: tfran-shake 0.3s ease;
}

@keyframes tfran-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Сообщения над формой */
.contact-form .form-note {
    background: #e8f7ec;
    color: #1e7a3c;
    border: 1px solid #b8e6c5;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.contact-form .form-errors {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

/* Обёртка сообщений над формой */
.contact-form .form-messages {
    margin-bottom: 25px;
}
.contact-form .form-note {
    background: #e8f7ec;
    color: #1e7a3c;
    border: 1px solid #b8e6c5;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 1rem;
    line-height: 1.5;
}
.contact-form .form-note strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.contact-form .form-errors {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 1rem;
    line-height: 1.5;
}
.contact-form .form-errors strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

/* Подсветка ошибочных полей */
.contact-form .form-group input.field-error,
.contact-form .form-group textarea.field-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    animation: tfran-shake 0.3s ease;
}
@keyframes tfran-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Поле капчи */
.contact-form .form-group-captcha img {
    display: block;
    margin-bottom: 12px;
    border-radius: 6px;
}

/* Плавающая кнопка «наверх» */
.to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent, #f47920);
    color: #000;                     /* чёрная стрелка */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(244, 121, 32, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s, transform .25s, visibility .25s, background .2s;
    z-index: 999;
}
.to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.to-top:hover {
    background: #ff8b32;
    transform: translateY(-2px);
}
@media (max-width: 768px) {
    .to-top { right: 15px; bottom: 15px; width: 46px; height: 46px; }
}

/* ====== СЕТКА КАТАЛОГА ====== */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}
.catalog-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--text);
}
.catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.catalog-card-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 20px;
}
.catalog-card h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.catalog-card p {
    font-size: 0.9rem;
    color: #666;
    flex-grow: 1;
}

/* ====== СТРАНИЦА ПРОДУКТА ====== */
.product-hero {
    background: var(--bg-light);
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
}
.product-hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.product-hero-text {
    flex: 1 1 500px;
}
.product-hero-text h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.2;
}
.product-hero-text p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
}
.product-hero-actions {
    display: flex;
    gap: 15px;
}
.product-hero-image {
    flex: 1 1 400px;
    text-align: center;
}
.product-hero-image img {
    max-width: 100%;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Двухколоночный макет */
.product-layout {
    display: flex;
    gap: 40px;
    padding: 60px 0;
    align-items: flex-start;
}

/* Левое меню-якорь */
.product-sidebar {
    flex: 0 0 250px;
    position: sticky;
    top: 100px; /* Отступ от прилипшей шапки */
    background: var(--bg-light);
    border-radius: 16px;
    padding: 20px;
}
.product-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.product-sidebar li {
    margin-bottom: 10px;
}
.product-sidebar a {
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    transition: color 0.2s;
    display: block;
}
.product-sidebar a:hover, .product-sidebar a.active {
    color: var(--accent);
}
.product-sidebar .btn {
    margin-top: 20px;
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
}

/* Правая колонка контента */
.product-content {
    flex: 1;
}
.product-content section {
    margin-bottom: 50px;
    scroll-margin-top: 100px; /* Чтобы якорь не прятался за шапкой */
}
.product-content h2 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-light);
}
.product-content h3, .product-content h4 {
    color: var(--primary);
    margin: 20px 0 10px;
}
.product-content p {
    margin-bottom: 15px;
    line-height: 1.7;
}
.product-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}
.product-content li {
    margin-bottom: 8px;
}

/* Мобильная адаптация */
@media (max-width: 992px) {
    .product-layout {
        flex-direction: column;
    }
    .product-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        flex: auto;
        display: flex;
        overflow-x: auto;
        padding: 15px;
    }
    .product-sidebar ul {
        display: flex;
        gap: 20px;
    }
    .product-sidebar li { margin-bottom: 0; }
    .product-sidebar a { white-space: nowrap; }
    .product-sidebar .btn { width: auto; margin-top: 0; margin-left: 20px; }
}