/* style.css */

html, body {
    overflow-x: hidden;
}

/* ===== MOBILE MENU ===== */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

#mobile-menu.translate-x-full {
    transform: translateX(100%);
}

#mobile-menu:not(.translate-x-full) {
    transform: translateX(0);
}

/* ===== MARQUEE ===== */
.marquee-content {
    animation: marquee 28s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== GALLERY ===== */
.gallery-img {
    width: 100%;
    aspect-ratio: 1/1;
    cursor: pointer;
    overflow: hidden;
    border-radius: 1rem;
    position: relative;
    background-color: #f0f0f0;
}

.gallery-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-img:hover img {
    transform: scale(1.1);
}

/* ===== FILTER BUTTONS ===== */
.filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    border: 1px solid #496544;
    color: #496544;
    font-weight: 600;
    transition: all 0.3s;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
}

.filter-btn.active {
    background-color: #496544;
    color: white;
    border-color: #496544;
}

.filter-btn:hover {
    background-color: #496544;
    color: white;
}

/* ===== FAQ ACCORDION ===== */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.accordion-active .accordion-content {
    max-height: 500px;
}

.accordion-active .icon {
    transform: rotate(180deg);
}

.icon {
    transition: transform 0.3s ease;
}

/* ===== LIGHTBOX ===== */
#lightbox {
    display: none;
}

#lightbox:not(.hidden) {
    display: flex !important;
}

#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

/* ===== MODALS ===== */
#modal {
    display: none;
}

#modal:not(.hidden) {
    display: flex !important;
}

#service-modal {
    display: none;
}

#service-modal:not(.hidden) {
    display: flex !important;
}

/* ===== MOBILE FIXES ===== */
@media (max-width: 767px) {
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1, h2, h3, h4, p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    form input,
    form select,
    form textarea {
        width: 100%;
        box-sizing: border-box;
    }
    
    #gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    #gallery-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 0.5rem;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    #gallery-filters::-webkit-scrollbar {
        display: none;
    }
    
    #gallery-filters {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    #services-container > div {
        margin-bottom: 1rem;
    }
    
    #testimonials-track > div {
        width: 85vw;
        flex-shrink: 0;
    }
    
    .marquee-content {
        animation: marquee 15s linear infinite;
    }
}

/* ===== SCROLLBAR HIDE ===== */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ===== IMAGE FIXES ===== */
img {
    max-width: 100%;
    height: auto;
}

iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* ===== LINE CLAMP ===== */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== SERVICE CARDS ===== */
#services-container .group {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#services-container .group:hover {
    transform: translateY(-4px);
}

/* ===== HEADER FIX ===== */
header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== HERO FIX ===== */
@media (max-width: 767px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons button,
    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
}

/* ===== ADVANTAGES FIX ===== */
@media (max-width: 767px) {
    .grid-cols-1-mobile {
        grid-template-columns: 1fr;
    }
}

/* ===== FOOTER FIX ===== */
@media (max-width: 767px) {
    footer .grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   КРИТИЧЕСКИЕ ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ
   ============================================= */

/* Фикс горизонтального скролла — запрещаем выход за пределы экрана */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Герой-секция: фикс выхода контента вправо */
@media (max-width: 767px) {
    .relative.min-h-\[100dvh\] .relative.z-10 {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        overflow-x: hidden;
    }
    
    .relative.min-h-\[100dvh\] .relative.z-10 > div:first-child {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .relative.min-h-\[100dvh\] .relative.z-10 > div:last-child {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Скрываем горизонтальный скролл для всей страницы */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Фикс для контейнера hero */
    .min-h-\[100dvh\] {
        min-height: 100dvh;
        max-width: 100vw;
    }
    
    .min-h-\[100dvh\] .max-w-\[1420px\] {
        max-width: 100vw;
    }
}

/* Блок преимуществ: фикс отступов на мобильных */
@media (max-width: 767px) {
    .py-24.px-6 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .bg-white.p-10 {
        padding: 1.5rem;
    }
    
    .bg-white.p-10 h4 {
        font-size: 1.25rem;
        line-height: 1.4;
    }
}

/* Мобильное меню: гарантируем начальное скрытое состояние */
#mobile-menu {
    transform: translateX(100%);
}

#mobile-menu:not(.translate-x-full) {
    transform: translateX(0);
}