/* =========================================
   1. СБРОС И БАЗОВЫЕ СТИЛИ
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #222;
    background-color: #fdfdfd;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

a:hover {
    color: #ff6600;
}

/* =========================================
   2. КОНТЕЙНЕРЫ И СЕТКИ
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Общая сетка для карточек (Услуги, Преимущества, Контакты) */
.services-grid,
.advantages-grid,
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    justify-items: center;
}

/* =========================================
   3. ШАПКА (HEADER)
   ========================================= */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Верхняя часть (Лого + Навигация) */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px; /* Отступ до нижней части шапки */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
    color: #222;
}

.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    font-weight: 500;
    color: #222;
}

.nav a.active {
    color: #ff6600;
}

/* Нижняя часть (Соцсети + Кнопка + Телефон) */
.header-extra-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    position: relative; /* Для позиционирования кнопки */
    padding-top: 5px;
    border-top: 1px solid #f0f0f0;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-links img {
    width: 24px;
    height: 24px;
    display: block;
}

.phone-header {
    font-weight: 600;
    white-space: nowrap;
    color: #222;
}

/* Кнопка "Консультация" в шапке */
.btn-consultation {
    padding: 8px 20px;
    background-color: #ff6600;
    color: #fff !important; /* Force white text */
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    /* Центрирование кнопки */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.btn-consultation:hover {
    background-color: #e05500;
}

/* Адаптив шапки */
@media (max-width: 768px) {
    .header-inner,
    .header-extra-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nav {
        justify-content: center;
    }

    .btn-consultation {
        position: static;
        transform: none;
        margin: 10px 0;
        width: 100%;
        text-align: center;
    }
}

/* =========================================
   4. ГЕРОЙ (HERO SECTION)
   ========================================= */
.hero {
    background-color: #fff7f0;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero h1 span {
    color: #ff6600;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #444;
}

.hero-buttons {
    margin-bottom: 30px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 25px;
    margin: 5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: #ff6600;
    color: #fff !important;
}

.btn-primary:hover {
    background-color: #e05500;
}

.btn-secondary {
    background-color: #fff;
    color: #ff6600 !important;
    border: 2px solid #ff6600;
}

.btn-secondary:hover {
    background-color: #ff6600;
    color: #fff !important;
}

.btn-outline {
    display: inline-block;
    margin: 25px auto 0;
    padding: 10px 25px;
    border: 2px solid #222;
    border-radius: 8px;
    color: #222;
}

.btn-outline:hover {
    background: #222;
    color: #fff;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.feature {
    text-align: center;
    font-weight: 500;
}

.feature-icon {
    font-size: 1.5rem;
    margin-right: 5px;
}

.hero-text {
    margin-top: 30px;
    font-size: 0.95rem;
    color: #666;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   5. УСЛУГИ (ПРЕВЬЮ И ПОЛНЫЙ СПИСОК)
   ========================================= */
.services-preview,
.services-full,
.advantages,
.contacts {
    padding: 60px 0;
}

.services-preview h2,
.advantages h2,
.contacts h2,
.services-full h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

/* Карточка услуги (компактная) */
.service-card {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 280px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #f0f0f0;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.service-card p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
}

.price {
    display: block;
    font-weight: 700;
    color: #ff6600;
    font-size: 1.1rem;
}

.seo-text {
    margin-top: 40px;
    font-size: 0.9rem;
    color: #777;
    text-align: center;
    line-height: 1.5;
}

/* === Таблица цен (Страница "Услуги") === */
.service-category-wrapper {
    margin-bottom: 40px;
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.service-category-header h2 {
    margin-bottom: 20px;
    font-size: 1.6rem;
    color: #ff6600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    text-align: left;
}

.price-table {
    display: grid;
    gap: 10px;
}

.price-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.price-row.header {
    font-weight: 700;
    background-color: #f9f9f9;
    border-radius: 6px;
    border-bottom: none;
    color: #444;
}

.price-row:not(.header):hover {
    background-color: #fff7f0;
}

.service-name { font-weight: 500; }
.service-time { color: #666; font-size: 0.9rem; }
.service-price { font-weight: 700; color: #ff6600; }

@media (max-width: 600px) {
    .price-row {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: center;
    }
    .price-row.header { display: none; }
}

/* =========================================
   6. СТАТЬИ (СПИСОК И ДЕТАЛЬНАЯ)
   ========================================= */
.articles-list {
    padding: 60px 0;
}

.articles-list h1 {
    text-align: center;
    margin-bottom: 30px;
}

/* Категории статей */
.article-categories {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.article-categories a {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.article-categories a:hover,
.article-categories a.active {
    background-color: #ff6600;
    color: #fff;
}

/* Горизонтальная сетка статей */
.articles-grid-horizontal {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}

.article-item {
    display: flex;
    gap: 25px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 20px;
    transition: 0.3s;
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.article-item img {
    width: 240px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.article-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-category {
    color: #ff6600;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.article-info h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-info h2 a:hover {
    color: #ff6600;
}

.article-preview {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.article-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .article-item {
        flex-direction: column;
    }
    .article-item img {
        width: 100%;
        height: 200px;
    }
}

/* Детальная страница статьи */
.article-detail {
    padding: 60px 0;
    max-width: 800px;
    margin: 0 auto;
}

.article-detail h1 {
    font-size: 2.2rem;
    margin: 15px 0;
}

.article-detail img {
    width: 100%;
    border-radius: 12px;
    margin: 25px 0;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 40px;
}

.article-content p {
    margin-bottom: 15px;
}

/* =========================================
   7. ФОРМА ОБРАТНОЙ СВЯЗИ (CALLBACK)
   ========================================= */
.callback-form-section {
    padding: 60px 0;
    background: #f7f7f7;
}

.callback-form-section h1 {
    text-align: center;
    margin-bottom: 10px;
}

.form-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

.callback-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 40px 35px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.input-field,
.textarea-field,
.select-field {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    transition: 0.3s;
}

.input-field:focus,
.textarea-field:focus,
.select-field:focus {
    border-color: #007BFF;
    outline: none;
    box-shadow: 0 0 8px rgba(0,123,255,0.2);
}

.textarea-field {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}

.hint {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
    display: block;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 16px;
    font-size: 18px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 6px 12px rgba(0,123,255,0.2);
}

.btn-submit:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Состояние успеха */
.form-success {
    max-width: 600px;
    margin: 0 auto;
    background-color: #e6ffed;
    border: 1px solid #2ecc71;
    padding: 20px;
    border-radius: 10px;
    color: #27ae60;
    text-align: center;
}

.redirect-timer {
    height: 6px;
    width: 100%;
    background: #c3e6cb;
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: #27ae60;
    transition: width 0.05s linear;
}

/* =========================================
   8. ТОВАРЫ (PRODUCTS)
   ========================================= */
.products-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.categories-grid {
    display: grid;
    gap: 40px;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background-color: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #222;
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: block;
    color: #ff6600;
    font-size: 1.2rem;
    font-weight: 700;
}

/* =========================================
   9. ПОДВАЛ (FOOTER)
   ========================================= */
.footer {
    background-color: #222;
    color: #fff;
    padding: 30px 0;
    margin-top: auto;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer a {
    color: #ccc;
    margin: 0 10px;
}

.footer a:hover {
    color: #ff6600;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}