/* ============================================
   СБРОС СТИЛЕЙ И БАЗОВЫЕ НАСТРОЙКИ
   ============================================ */

/* Сброс стандартных отступов браузера */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Плавная прокрутка для якорных ссылок */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Отступ для фиксированного header */
}

/* Базовые настройки body */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #ffffff;
    overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
}

/* Сброс стилей для ссылок */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Сброс стилей для списков */
ul, ol {
    list-style: none;
}

/* Сброс стилей для кнопок */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

/* Сброс стилей для изображений */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Универсальный контейнер для центрирования контента */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   ЦВЕТОВАЯ ПАЛИТРА (CSS-переменные)
   ============================================ */
:root {
    /* Основные цвета */
    --primary-color: #f39c12;      /* Оранжевый — основной цвет */
    --primary-dark: #e67e22;       /* Тёмно-оранжевый */
    --secondary-color: #2c3e50;    /* Тёмно-синий */
    --accent-color: #e74c3c;       /* Красный для акцентов */
    
    /* Нейтральные цвета */
    --text-dark: #2c3e50;          /* Тёмный текст */
    --text-medium: #5a6c7d;        /* Средний текст */
    --text-light: #95a5a6;         /* Светлый текст */
    --bg-light: #f8f9fa;           /* Светлый фон */
    --bg-white: #ffffff;           /* Белый фон */
    --border-color: #e1e8ed;       /* Цвет границ */
    
    /* Отступы */
    --section-padding: 80px 0;     /* Отступы секций */
    
    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* Радиусы скругления */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* ============================================
   ШАПКА САЙТА
   ============================================ */

/* Фиксированная шапка */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Внутренний контейнер шапки — flex-раскладка */
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    padding-bottom: 15px;
    gap: 20px;
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--text-dark);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 1.8rem;
}

/* Главное меню навигации */
.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-medium);
    position: relative;
    padding: 5px 0;
}

/* Подчёркивание при наведении */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

/* Правая часть шапки: телефон + бургер */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Телефон в шапке */
.header-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.header-phone:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* Кнопка бургер-меню (скрыта на десктопе) */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    cursor: pointer;
}

.burger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Анимация бургера при открытии меню */
.burger.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* ============================================
   КНОПКИ (УНИВЕРСАЛЬНЫЕ СТИЛИ)
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

/* Основная кнопка (оранжевая) */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Вторичная кнопка (прозрачная с обводкой) */
.btn-secondary {
    background-color: transparent;
    color: white;
    border-color: white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--text-dark);
}

/* ============================================
   ГЛАВНЫЙ ЭКРАН (HERO)
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    /* Градиентный фон строительной тематики */
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    color: white;
    padding-top: 100px; /* Отступ под фиксированный header */
    position: relative;
    overflow: hidden;
}

/* Декоративный паттерн на фоне hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(243, 156, 18, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(243, 156, 18, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

/* Главный заголовок H1 */
.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
}

/* Подзаголовок */
.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: 0.9;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

/* Список преимуществ на главном экране */
.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero-features li {
    font-size: 1.05rem;
    padding: 10px 0;
}

/* Кнопки на главном экране */
.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

/* Анимация появления снизу */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ОБЩИЕ СТИЛИ СЕКЦИЙ
   ============================================ */

/* Базовые отступы секций */
section {
    padding: var(--section-padding);
}

/* Заголовок секции H2 */
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-dark);
    position: relative;
}

/* Подзаголовок секции */
.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-medium);
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   СЕКЦИЯ УСЛУГ
   ============================================ */

.services {
    background-color: var(--bg-light);
}

/* Сетка карточек услуг */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Карточка отдельной услуги */
.service-card {
    background-color: white;
    border-radius: var(--radius-md);
    padding: 35px 30px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Иконка услуги */
.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
}

/* Заголовок услуги H3 */
.service-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Описание услуги */
.service-desc {
    color: var(--text-medium);
    margin-bottom: 20px;
    line-height: 1.7;
}

/* Список работ в карточке услуги */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-list li {
    padding-left: 20px;
    position: relative;
    color: var(--text-medium);
    font-size: 0.95rem;
}

/* Маркер списка */
.service-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* ============================================
   СЕКЦИЯ ПРЕИМУЩЕСТВ
   ============================================ */

.advantages {
    background-color: white;
}

/* Сетка преимуществ */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

/* Отдельный блок преимущества */
.advantage-item {
    text-align: center;
    padding: 20px;
}

/* Номер преимущества */
.advantage-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 20px;
}

/* Заголовок преимущества H3 */
.advantage-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

/* Описание преимущества */
.advantage-desc {
    color: var(--text-medium);
    line-height: 1.7;
}

/* ============================================
   СЕКЦИЯ "О МАСТЕРЕ"
   ============================================ */

.about {
    background-color: var(--bg-light);
}

/* Обёртка для двухколоночного макета */
.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Текстовая часть секции "О мастере" */
.about-content .section-title {
    text-align: left;
    margin-bottom: 25px;
}

.about-text {
    color: var(--text-medium);
    margin-bottom: 15px;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Список достижений */
.about-list {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-list li {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Декоративный блок-заглушка для фото */
.about-image-placeholder {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: var(--radius-lg);
    padding: 60px 30px;
    text-align: center;
    color: white;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
}

.about-image-placeholder span {
    font-size: 5rem;
}

.about-image-placeholder p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 250px;
}

/* ============================================
   СЕКЦИЯ КОНТАКТОВ И ФОРМЫ
   ============================================ */

.contact {
    background-color: white;
}

/* Обёртка для двухколоночного макета формы и контактов */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: start;
}

/* Форма обратной связи */
.contact-form {
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Группа поля формы (label + input + error) */
.form-group {
    margin-bottom: 20px;
}

/* Метка поля */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

/* Поле ввода */
.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: white;
}

/* Стили при фокусе на поле */
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

/* Стили для невалидного поля */
.form-input.error {
    border-color: var(--accent-color);
}

/* Сообщение об ошибке */
.form-error {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--accent-color);
    min-height: 18px;
}

/* Кнопка отправки формы */
.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Текст согласия на обработку данных */
.form-agreement {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
}

.agreement-link {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Блок контактной информации */
.contact-info {
    padding: 20px 0;
}

.contact-info-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-dark);
}

/* Отдельный контакт (иконка + текст) */
.contact-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: flex-start;
}

/* Иконка контакта */
.contact-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Детали контакта */
.contact-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.contact-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

a.contact-value:hover {
    color: var(--primary-color);
}

/* ============================================
   ПОДВАЛ САЙТА
   ============================================ */

.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 60px 0 30px;
}

/* Сетка колонок подвала */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Логотип в подвале */
.footer-logo {
    margin-bottom: 15px;
}

.footer-logo .logo-text {
    color: white;
}

/* Описание в подвале */
.footer-about {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

/* Заголовки колонок подвала */
.footer-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
}

/* Навигация и списки в подвале */
.footer-nav li,
.footer-contacts li {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer-nav a:hover,
.footer-contacts a:hover {
    color: var(--primary-color);
}

/* Нижняя часть подвала */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright,
.footer-city {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ============================================
   КНОПКА "НАВЕРХ"
   ============================================ */

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

/* Показываем кнопку при прокрутке */
.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

/* Активное состояние модального окна */
.modal.active {
    opacity: 1;
    visibility: visible;
}

/* Содержимое модального окна */
.modal-content {
    background-color: white;
    border-radius: var(--radius-md);
    padding: 50px 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Кнопка закрытия модального окна */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2rem;
    color: var(--text-light);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Иконка в модальном окне */
.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.modal-text {
    color: var(--text-medium);
    margin-bottom: 25px;
    line-height: 1.6;
}

/* ============================================
   АДАПТИВНЫЙ ДИЗАЙН (МЕДИА-ЗАПРОСЫ)
   ============================================ */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
    /* Уменьшаем отступы секций */
    :root {
        --section-padding: 60px 0;
    }
    
    /* Уменьшаем зазор в сетке услуг */
    .services-grid {
        gap: 20px;
    }
    
    /* Уменьшаем зазор в сетке преимуществ */
    .advantages-grid {
        gap: 30px;
    }
    
    /* Секция "О мастере" — одна колонка */
    .about-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    /* Секция контактов — одна колонка */
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    /* Подвал — 2 колонки */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    /* Показываем бургер-меню */
    .burger {
        display: flex;
    }
    
    /* Скрываем телефон в шапке на мобильных */
    .header-phone .phone-number {
        display: none;
    }
    
    /* Мобильное меню — выпадающее */
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: var(--shadow-md);
        padding: 20px;
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    /* Открытое мобильное меню */
    .nav.active {
        transform: translateY(0);
    }
    
    .nav-list {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-link {
        display: block;
        padding: 10px 0;
        font-size: 1.1rem;
    }
    
    /* Уменьшаем отступы секций */
    :root {
        --section-padding: 50px 0;
    }
    
    /* Главный экран */
    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Сетка услуг — одна колонка */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Сетка преимуществ — одна колонка */
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    /* Форма */
    .contact-form {
        padding: 25px 20px;
    }
    
    /* Подвал — одна колонка */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    /* Кнопка "Наверх" — меньше */
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Маленькие мобильные устройства (до 480px) */
@media (max-width: 480px) {
    /* Уменьшаем размер шрифтов */
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    /* Уменьшаем отступы карточек услуг */
    .service-card {
        padding: 25px 20px;
    }
    
    /* Модальное окно */
    .modal-content {
        padding: 35px 25px;
    }
}

/* ============================================
   УТИЛИТЫ И АНИМАЦИИ
   ============================================ */

/* Плавное появление элементов при скролле */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Скрытие элемента для скринридеров (визуально скрыт) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}