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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow: visible;
}

/* Шапка */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.header.scroll-up {
    transform: translateY(0);
}

.header.scroll-down {
    transform: translateY(-100%);
}

body {
    padding-top: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
    width: 100%;
    overflow: visible;
}

.logo {
    flex: 0 0 auto;
    display: block;
    visibility: visible;
    opacity: 1;
}

.logo h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    visibility: visible;
    opacity: 1;
}

.logo h1 a {
    color: #e63946;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    visibility: visible;
    opacity: 1;
}

.logo h1 a:hover {
    color: #c1121f;
}

.logo-img {
    height: 2.5rem;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav a:hover {
    color: #e63946;
}

.nav a:focus {
    outline: 2px solid #e63946;
    outline-offset: 4px;
    border-radius: 4px;
}

.header-phone {
    flex: 0 0 auto;
}

.header-phone a {
    text-decoration: none;
    color: #e63946;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.header-phone a:hover {
    color: #c1121f;
}

.header-phone a:focus {
    outline: 2px solid #e63946;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Кнопка мобильного меню */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    flex: 0 0 auto;
    margin-left: auto;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 3px;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover span {
    background: #e63946;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #e63946;
    outline-offset: 4px;
    border-radius: 4px;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Главный баннер */
.hero {
    position: relative;
    color: white;
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero::before {
    display: none;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #e63946;
    color: white;
    position: relative;
    overflow: visible;
}

.btn-primary:hover {
    background: #c1121f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.4);
}

.btn-primary:focus {
    outline: 3px solid #e63946;
    outline-offset: 2px;
}

.btn:focus {
    outline: 3px solid #e63946;
    outline-offset: 2px;
}

/* Убрана анимация пламени для кнопки "Подключить газ" */
.hero-buttons .btn-primary::before,
.hero-buttons .btn-primary::after {
    display: none;
}

.btn-secondary {
    background: white;
    color: #667eea;
}

.btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e63946;
    color: #e63946;
}

.btn-outline:hover {
    background: #e63946;
    color: white;
}

.btn-outline:focus {
    outline: 3px solid #e63946;
    outline-offset: 2px;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    background: white;
    color: #667eea;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Секции */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* О компании */
.about {
    background: #f8f9fa;
}

.advantages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.advantage-card {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.advantage-card:hover {
    transform: translateY(-5px);
}

.advantage-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #e63946;
    margin-bottom: 1rem;
}

.advantage-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.advantage-card p {
    color: #666;
    line-height: 1.8;
}

/* Услуги */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-top: 4px solid #e63946;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.service-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    flex-grow: 1;
}

.service-card .btn {
    margin-top: auto;
    align-self: flex-start;
}

.service-card a.btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

/* Выполненные проекты */
.projects {
    background: #f8f9fa;
}

.projects-note {
    text-align: center;
    font-size: 1rem;
    color: #999;
    font-style: italic;
    margin: -1.5rem auto 2rem;
    max-width: 800px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-top: 4px solid #e63946;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    position: relative;
    cursor: pointer;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    transform: scale(1);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.project-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    flex-grow: 1;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-feature {
    background: #e63946;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.3s;
}

.project-card:hover .project-feature {
    background: #c1121f;
}

/* Видео о работе */
.videos {
    background: white;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.video-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    border-top: 4px solid #e63946;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-top-color: #c1121f;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 соотношение сторон */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-content {
    padding: 1.5rem;
}

.video-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.video-content p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Отзывы */
.reviews {
    background: #f8f9fa;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.review-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.review-stars {
    color: #ffc107;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.review-text {
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
    line-height: 1.8;
}

.review-author {
    color: #333;
    font-weight: 600;
}

/* Контакты */
.contacts-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    font-size: 1.1rem;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-item a {
    color: #e63946;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.contact-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
}

.contact-form h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #e63946;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown) {
    border-color: #e63946;
}

.contact-form textarea {
    resize: vertical;
}

/* Футер */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2.5rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideDown 0.3s;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #e63946;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.modal-content input:invalid:not(:placeholder-shown),
.modal-content textarea:invalid:not(:placeholder-shown) {
    border-color: #e63946;
}

.modal-content textarea {
    resize: vertical;
}

/* Модальное окно для просмотра изображений */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.image-modal.show {
    display: flex;
    flex-direction: column;
}

.image-modal-close {
    position: absolute;
    right: 30px;
    top: 30px;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 2001;
    line-height: 1;
    transition: color 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.image-modal-close:hover {
    color: #e63946;
    background: rgba(255, 255, 255, 0.2);
}

.image-modal img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: imageModalFadeIn 0.3s ease;
}

.image-modal-title {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 1.2rem;
    max-width: 90%;
    padding: 0 20px;
}

@keyframes imageModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Кнопка чата */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1500;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-button:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.chat-button:active {
    transform: scale(0.95);
}

.chat-menu {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    min-width: 200px;
    overflow: hidden;
    animation: slideUp 0.3s;
}

.chat-menu.show {
    display: flex;
}

.chat-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
    border-bottom: 1px solid #f0f0f0;
}

.chat-option:last-child {
    border-bottom: none;
}

.chat-option:hover {
    background: #f8f9fa;
}

.chat-option span:first-child {
    font-size: 1.5rem;
}

.chat-option span:last-child {
    font-weight: 600;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Мобильное меню */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    z-index: 999;
    padding: 2rem 0;
    margin-top: 70px; /* Высота шапки */
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.mobile-nav.show {
    transform: translateY(0);
}

.mobile-nav a {
    display: block;
    padding: 1rem 2rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.mobile-nav a:hover,
.mobile-nav a:focus {
    background: #f8f9fa;
    color: #e63946;
    outline: none;
}

.mobile-nav a:last-child {
    border-bottom: none;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .nav {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .header-content {
        flex-wrap: nowrap;
        gap: 1rem;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        overflow: visible;
        padding: 1rem 20px;
    }
    
    .container {
        padding: 0;
        overflow: visible;
    }

    .logo {
        flex: 0 0 auto;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        z-index: 10;
        min-width: 0;
        overflow: visible;
    }

    .logo h1 {
        font-size: 1.5rem;
        white-space: nowrap;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0;
        padding: 0;
    }
    
    .logo h1 a {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .logo-img {
        height: 2rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
        flex: 0 0 auto;
    }

    .mobile-nav {
        display: block;
    }

    .header-phone {
        display: none;
        order: 2;
    }

    .header-phone a {
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        min-height: 44px; /* Минимальный размер для touch targets */
    }

    .contacts-content {
        grid-template-columns: 1fr;
    }

    .advantages,
    .services-grid,
    .reviews-grid,
    .projects-grid,
    .videos-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .logo-img {
        height: 1.8rem;
    }

    .chat-widget {
        bottom: 20px;
        right: 20px;
    }

    .chat-button {
        width: 50px;
        height: 50px;
    }

    .image-modal-close {
        right: 15px;
        top: 15px;
        font-size: 2rem;
        width: 40px;
        height: 40px;
    }

    .image-modal img {
        max-width: 95%;
        max-height: 80vh;
    }

    .image-modal-title {
        font-size: 1rem;
        margin-top: 15px;
    }
}

