/* Основные переменные */
:root {
    --primary-color: #0f1142; /* Основной темно-красный цвет */
    --secondary-color: #d32f2f; /* Ярко-красный для акцентов */
    --dark-color: #333;
    --light-color: #f4f4f4;
    --gray-color: #777;
    --light-red: #ffebee; /* Светло-красный фон для некоторых элементов */
}

.fa-plug { color: #050768; } /* Неисправности */
.fa-tint-slash { color: #0de1e1; } /* Устранение протечек */
.fa-cogs { color: #13ddbf; } /* Замена подшипников */
.fa-bolt { color: #0d18e3; } /* Ремонт электроники */
.fa-filter { color: #3be30d; } /* Чистка и обслуживание */
.fa-exchange-alt { color: #e3bf0d; } /* Замена комплектующих */
.fa-utensils { color: #27ae60; } /* Зеленый для посудомоек */
.fa-fire { color: #e74c3c; } /* Красный для духовок */
.fa-faucet { color: #3498db; } /* Синий для водонагревателей */
.fa-toolbox { color: #9b59b6; } /* Фиолетовый для комплексного обслуживания */
.fa-exclamation-triangle { color: #f39c12; } /* Оранжевый для срочного ремонта */
.fa-shield-alt { color: #2ecc71; } /* Светло-зеленый для гарантии */

section {
    padding: 10px 0 10px; /* Уменьшили с типичных 60-80px до 40px */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Шапка сайта */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.header.hide {
    transform: translateY(-100%);
}

.header-top {
    padding: 10px 0;
}

.header-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Навигация */
.navbar {
    padding: 15px 0;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Секция героя */
.hero {
    background-color: white;
    margin: 10px auto 10px;
    text-align: center;
    position: relative;
}

/* Основные стили для блока */
.hero-main {
    margin-top: 0;
    width: 100%;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5; /* Фон на случай отступов */
}

.container-main {
    width: 100%;
    max-width: 1899px; /* Максимальная ширина как у изображения */
    margin: 0 auto;
    padding: 0;
}

.hero-content-main {
    width: 100%;
    position: relative;
    aspect-ratio: 1899/1056; /* Сохраняем пропорции изображения */
}

.service-icon-main {
    margin-top: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-icon-main img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Полное изображение без обрезки */
    object-position: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-service {
    width: 100%;
    overflow: hidden; /* Обрезаем всё, что выходит за границы */
}

.container-service {
    width: 100%;
    max-width: 1540px; /* Максимальная ширина как у изображения */
    margin: 0 auto;
    padding: 0;
}

.hero-content-service {
    position: relative;
    width: 100%;
}

.service-icon-service {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
}

.service-icon-service img {
    width: 100%;
    height: auto;
    max-width: 1540px;
    object-fit: contain; /* Сохраняем пропорции */
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    line-height: 1.3;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    color: var(--gray-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-features {
    background-color: var(--light-red);
    border-radius: 8px;
    padding: 25px;
    margin: 0 auto 40px;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.feature i {
    font-size: 1.8rem;
    margin-right: 15px;
    color: var(--primary-color);
}

.hero-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero-button:hover {
    background-color: #b71c1c;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Секция услуг */
.services {
    margin: 10px auto 10px;
    padding: 20px 0 20px;
    background-color: #f9f9f9;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.container-head {
    width: 100%;
    margin: 70px auto 0;
    padding: 0 15px;
    text-align: center;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-color);
    font-size: 2.2rem;
}

.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;
}

.service-grid {
    margin: 10px auto 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.service-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-icon {
    height: 300px; /* Фиксированная высота контейнера */
    display: flex;
    justify-content: center;
    align-items: center;
    background: white; /* Фон на случай отступов */
    overflow: hidden;
}

.service-icon img {
    width: auto;  /* Ширина подстраивается под пропорции */
    height: 100%; /* Занимает всю высоту контейнера */
    max-width: 100%; /* Не выходит за границы блока */
    object-fit: contain; /* Показывает всё изображение целиком */
}
.service-icon-service img {
    width: 100%;
    height: auto;
    max-width: 1200px; /* Оригинальная ширина изображения */
    object-fit: contain; /* Важно: сохраняет пропорции и показывает всё изображение */
}
.service-icon-diag {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    margin: 10px auto 10px;
    background: linear-gradient(135deg, #f8f6f7 0%, #d1d3dd 100%);
    border-radius: 50%;
    color: white;
    font-size: 36px; /* Размер иконки */
    box-shadow: 0 4px 10px rgba(106, 17, 203, 0.3);
}

.service-content {
    padding: 12px 15px;
    flex-grow: 1;
}

.service-content-h3 {
    display: flex;              /* Включаем flexbox */
    justify-content: center;    /* Горизонтальное центрирование */
    align-items: center;       /* Вертикальное центрирование */
    text-align: center;        /* Дублируем для старых браузеров */
    padding: 10px 0;         /* Отступы сверху/снизу */
}

.service-list {
    padding-left: 20px;
    margin: 8px 0;
}

.service-list li {
    margin-bottom: 4px;  /* Уменьшаем отступ между пунктами */
    line-height: 1.3;    /* Уменьшаем межстрочное расстояние */
}

.service-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.service-content p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.service-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 15px;
}

/* Секция о мастере */
.about {
    margin: 10px auto 10px;
    background-color: white;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.about-text p {
    color: var(--gray-color);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-features {
    margin-top: 30px;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.about-feature i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Секция контактов */
.contact {
    margin: 10px auto 10px;
    background-color: #f9f9f9;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-info {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-top: 3px;
}

.contact-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    width: 100%;
}

.form-button:hover {
    background-color: #700000;
}

/* Футер */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #8B0000;
    background: none;
    border: none;
}

/* Мобильные стили */
@media (max-width: 768px) {
    .hero-main {
        padding: 40px 0 0;
        box-sizing: border-box;
    }

    .hero-content-main {
        aspect-ratio: 4/3; /* Более квадратное соотношение для мобильных */
    }

    .service-icon-service img {
        /* Можно добавить небольшие отступы по бокам */
        padding: 0 10px;
        box-sizing: border-box;
    }

    .header-name h2 {
        font-size: 16px;
        margin: 0;
        white-space: nowrap;
    }

    .service-icon {
        aspect-ratio: 16/9; /* Меняем пропорции на мобильных */
    }

    .service-grid {
        grid-template-columns: 1fr; /* 1 колонка на мобильных */
    }

    .mobile-menu-toggle {
        background: none;
        border: none;
        font-size: 22px;
        color: var(--primary-color);
        padding: 5px;
    }

    .mobile-phone {
        display: block;
    }

    .mobile-phone .phone-link {
        color: var(--primary-color);
        font-size: 20px;
        margin-right: 10px;
    }

    .header-info {
        display: none;
    }

    .mobile-nav {
        display: none;
        background: white;
        padding: 15px;
        border-top: 1px solid #eee;
        white-space: nowrap;
    }

    .mobile-nav.active {
        display: flex;
        flex-direction: column;
    }

    .mobile-nav a {
        padding: 12px 0;
        color: var(--dark-color);
        text-decoration: none;
        border-bottom: 1px solid #f5f5f5;
        white-space: nowrap;
    }

    .mobile-nav .mobile-call {
        color: var(--primary-color);
        font-weight: bold;
        margin-top: 10px;
    }

    .about-content {
        flex-direction: column;
        gap: 30px;
    }
}

/* Адаптация для планшетов */
@media (max-width: 1024px) {
    .hero-content-main {
        aspect-ratio: 16/9; /* Чуть изменяем пропорции */
    }
}

/* Десктопные стили */
@media (min-width: 769px) {
    .mobile-menu-toggle,
    .mobile-phone,
    .mobile-nav {
        display: none;
    }

    .header-contact {
        display: flex;
        justify-content: space-between;
    }

    .header-info {
        display: flex;
        align-items: center;
        gap: 30px;
        justify-content: space-between;
        flex-grow: 1;
    }

    .desktop-nav {
        display: flex;
        gap: 25px;
    }

    .desktop-nav a {
        color: var(--dark-color);
        text-decoration: none;
        font-weight: 500;
        position: relative;
        white-space: nowrap;
    }

    .desktop-nav a:hover {
        color: var(--primary-color);
    }

    .desktop-nav a::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--primary-color);
        transition: width 0.3s;
    }

    .desktop-nav a:hover::after {
        width: 100%;
    }

    .header-contacts {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    .header-phone a {
        color: var(--primary-color);
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .header-button {
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 4px;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
    }
}