/* ===== НОВОЕ РАСПОЛОЖЕНИЕ МЕНЮ И АДАПТИВНАЯ КНОПКА ===== */
@media (max-width: 768px) {
    .sticky-header .flex {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 12px !important;
    }
    
    .sticky-header .flex > div:first-child {
        flex: 0 0 auto !important;
    }
    
    .sticky-header .flex-1 {
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .sticky-header .flex.items-center.space-x-3 {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    
    /* Адаптивная кнопка "Рассчитать стоимость" */
    .sticky-header .btn-primary {
        padding: 10px 12px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px !important;
        min-width: 120px !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        height: 40px !important;
        border-radius: 6px !important;
    }
    
    /* Меню-бургер */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        background: transparent !important;
        border: 2px solid rgba(139, 158, 146, 0.5) !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        padding: 0 !important;
        z-index: 1001 !important;
        transition: all 0.3s ease !important;
        color: white !important;
    }
    
    .mobile-menu-btn:hover,
    .mobile-menu-btn:active {
        border-color: var(--primary-green) !important;
        background: rgba(139, 158, 146, 0.1) !important;
    }
    
    .mobile-menu-btn svg {
        width: 22px !important;
        height: 22px !important;
        stroke: currentColor !important;
        stroke-width: 2 !important;
    }
    
    .mobile-menu-btn.active {
        border-color: var(--primary-green) !important;
        background: var(--primary-green) !important;
    }
}

/* Оптимизация для средних экранов */
@media (max-width: 640px) {
    .sticky-header .btn-primary {
        padding: 8px 10px !important;
        font-size: 12px !important;
        min-width: 100px !important;
        height: 36px !important;
    }
    
    .mobile-menu-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .mobile-menu-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Оптимизация для маленьких экранов */
@media (max-width: 480px) {
    .sticky-header .flex {
        padding: 6px 8px !important;
        gap: 4px !important;
    }
    
    .sticky-header img {
        height: 30px !important;
    }
    
    .sticky-header .btn-primary {
        padding: 6px 8px !important;
        font-size: 11px !important;
        min-width: 85px !important;
        height: 32px !important;
    }
    
    .mobile-menu-btn {
        width: 32px !important;
        height: 32px !important;
        border-width: 1.5px !important;
    }
    
    .mobile-menu-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Оптимизация для очень маленьких экранов */
@media (max-width: 360px) {
    .sticky-header .btn-primary {
        padding: 4px 6px !important;
        font-size: 10px !important;
        min-width: 70px !important;
        height: 28px !important;
    }
    
    .sticky-header .flex.items-center.space-x-3 {
        gap: 2px !important;
    }
    
    .mobile-menu-btn {
        width: 28px !important;
        height: 28px !important;
    }
    
    .mobile-menu-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* Стили для мобильного меню */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    padding: 20px;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.mobile-menu .nav-link {
    color: white !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 18px !important;
    padding: 15px 0 !important;
    border-bottom: 1px solid rgba(139, 158, 146, 0.2) !important;
    width: 100% !important;
    text-align: left !important;
    display: block !important;
}

.mobile-menu .nav-link:active {
    color: var(--primary-green) !important;
    padding-left: 10px !important;
}

.mobile-menu .phone-link {
    font-size: 20px !important;
    font-weight: bold !important;
    color: var(--primary-green) !important;
    text-decoration: none !important;
    padding: 15px 0 !important;
    display: block !important;
    border-bottom: 1px solid rgba(139, 158, 146, 0.2) !important;
}

.mobile-menu .btn-primary {
    background: var(--primary-green) !important;
    color: white !important;
    padding: 16px 32px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    display: block !important;
    text-decoration: none !important;
    text-align: center !important;
    margin-top: 20px !important;
    width: 100% !important;
}

/* ===== СКРЫТИЕ ЗНАЧКА КАПЧИ ===== */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    z-index: -9999 !important;
}

/* Альтернативный вариант, если первый не сработает */
iframe[src*="recaptcha"] {
    display: none !important;
}

/* Скрываем если он внутри какого-то контейнера */
[class*="grecaptcha"],
[id*="grecaptcha"] {
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: -1 !important;
}

/* ===== ОПТИМИЗАЦИЯ КАРТОЧЕК ТОВАРОВ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    /* Делаем всю карточку кликабельной */
    .card-hover {
        cursor: pointer !important;
        position: relative !important;
    }
    
    /* Убираем стандартное выделение при клике */
    .card-hover:active {
        opacity: 0.9 !important;
    }
    
    /* Добавляем визуальную подсказку */
    .card-hover::after {
        content: "👆 Нажмите для подробностей";
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(139, 158, 146, 0.9);
        color: white;
        font-size: 11px;
        padding: 4px 8px;
        border-radius: 20px;
        z-index: 5;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        white-space: nowrap;
    }
    
    /* Показываем подсказку при наведении (для планшетов) */
    .card-hover:hover::after {
        opacity: 1;
    }
    
    /* Для мобильных убираем полноэкранный режим с картинок */
    .card-hover img {
        pointer-events: none !important;
    }
    
    /* Стили для активного состояния */
    .card-hover:active {
        transform: scale(0.98) !important;
        box-shadow: 0 10px 30px rgba(139, 158, 146, 0.3) !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .card-hover::after {
        font-size: 10px !important;
        padding: 3px 6px !important;
        bottom: 8px !important;
        right: 8px !important;
    }
}

/* ===== ИСПРАВЛЕНИЕ КНОПКИ ЗАКРЫТИЯ ===== */
.modal-toggle {
    display: none !important;
}

/* Убеждаемся, что модальные окна правильно отображаются */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.modal-toggle:checked + .modal {
    display: block !important;
}

/* Улучшенная кнопка закрытия */
.close-btn {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    font-size: 30px !important;
    font-weight: 300 !important;
    cursor: pointer !important;
    color: #999 !important;
    line-height: 1 !important;
    transition: color 0.2s !important;
    z-index: 2002 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.05) !important;
    border-radius: 50% !important;
    -webkit-tap-highlight-color: transparent !important;
}

.close-btn:hover,
.close-btn:active {
    color: var(--primary-green) !important;
    background: rgba(139, 158, 146, 0.1) !important;
}

/* Убеждаемся, что overlay перехватывает клики */
.modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    cursor: pointer !important;
    backdrop-filter: blur(5px) !important;
    z-index: 2000 !important;
}

/* ===== ИСПРАВЛЕНИЕ ДЛЯ МОДАЛЬНЫХ ОКОН ===== */
.modal-toggle:checked + .modal {
    display: block !important;
}

.close-btn {
    cursor: pointer !important;
    z-index: 9999 !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
}

.close-btn:active {
    transform: scale(0.95) !important;
}

.modal-overlay {
    cursor: pointer !important;
}

/* Гарантированное скрытие модалок по умолчанию */
.modal {
    display: none;
}




/* ===== АДАПТАЦИЯ ГЕРОЯ (ЛАКОНИЧНАЯ ВЕРСИЯ) ===== */

/* Мобильные устройства */
@media (max-width: 768px) {
    /* Секция героя */
    section.relative.text-white {
        min-height: 450px !important;
        padding: 30px 0 !important;
    }
    
    /* Фоновое изображение */
    section.relative > img.absolute {
        object-fit: cover !important;
        object-position: 65% center !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Затемнение */
    section.relative .bg-gradient-to-r {
        background: linear-gradient(to right, rgba(0,0,0,0.9), rgba(0,0,0,0.7)) !important;
    }
    
    /* Контейнер с текстом */
    section.relative .max-w-2xl {
        width: 100% !important;
        padding: 0 20px !important;
    }
    
    /* Заголовок - компактный как на компьютере */
    section.relative h1 {
        font-size: 2.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
        text-align: left !important; /* Выравнивание влево как на компьютере */
    }
    
    /* Зеленая часть заголовка */
    section.relative h1 .text-\[\#8b9e92\] {
        font-size: 2rem !important;
        display: inline !important; /* Не переносим на новую строку */
        margin-top: 0 !important;
    }
    
    /* Подзаголовок */
    section.relative p.text-lg {
        font-size: 1rem !important;
        margin-bottom: 5px !important;
        text-align: left !important;
    }
    
    /* Основной текст */
    section.relative p.text-xl.sm:text-2xl {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
        text-align: left !important;
        padding: 0 !important;
    }
    
    /* Кнопка */
    section.relative .btn-primary {
        display: inline-block !important; /* Не блочный элемент */
        margin: 0 !important; /* Убираем центрирование */
        font-size: 1rem !important;
        padding: 12px 24px !important;
    }
}

/* Очень маленькие устройства */
@media (max-width: 480px) {
    section.relative h1 {
        font-size: 1.8rem !important;
    }
    
    section.relative h1 .text-\[\#8b9e92\] {
        font-size: 1.6rem !important;
    }
    
    section.relative p.text-xl.sm:text-2xl {
        font-size: 1rem !important;
    }
    
    section.relative > img.absolute {
        object-position: 70% center !important;
    }
}

@media (max-width: 360px) {
    section.relative h1 {
        font-size: 1.5rem !important;
    }
    
    section.relative h1 .text-\[\#8b9e92\] {
        font-size: 1.3rem !important;
    }
}


/* ===== УЛУЧШЕННЫЕ СТИЛИ ДЛЯ КАРУСЕЛИ В МОДАЛЬНЫХ ОКНАХ ===== */
.simple-slider {
    position: relative;
    margin: 20px 0;
}

.slider-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.slider-img:hover {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 10px 25px rgba(139, 158, 146, 0.3);
}

.simple-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

.simple-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 60px;
}

.simple-btn:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 158, 146, 0.4);
}

.simple-btn:active {
    transform: translateY(0);
}

.simple-btn:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.photo-counter {
    font-size: 16px;
    color: #666;
    font-weight: 600;
    background: rgba(255,255,255,0.9);
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Мобильная адаптация для карусели */
@media (max-width: 768px) {
    .slider-img {
        height: 250px;
    }
    
    .simple-btn {
        padding: 12px 30px;
        font-size: 20px;
        min-width: 70px;
    }
    
    .photo-counter {
        font-size: 16px;
        padding: 6px 18px;
    }
}

@media (max-width: 480px) {
    .slider-img {
        height: 200px;
    }
    
    .simple-btn {
        padding: 10px 25px;
        font-size: 18px;
        min-width: 60px;
    }
}

/* ===== УЛУЧШЕННЫЕ СТИЛИ ДЛЯ КАРТОЧЕК КАТАЛОГА ===== */
#catalog .card-hover {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#catalog .card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 158, 146, 0.25);
}

#catalog .card-hover:active {
    transform: scale(0.98);
}

#catalog .card-hover img {
    transition: all 0.3s ease;
    pointer-events: auto;
}

#catalog .card-hover:hover img {
    transform: scale(1.05);
}

/* Индикатор кликабельности на мобильных */
@media (max-width: 768px) {
    #catalog .card-hover::after {
        content: "👆 Нажмите для подробностей";
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(139, 158, 146, 0.95);
        color: white;
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 20px;
        z-index: 10;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        white-space: nowrap;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        font-weight: 500;
    }
    
    #catalog .card-hover:active::after,
    #catalog .card-hover:hover::after {
        opacity: 1;
    }
}

/* ===== ИСПРАВЛЕНИЕ ГАЛЕРЕИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ===== */

/* Планшеты и большие телефоны */
@media (max-width: 768px) {
    #gallery .relative.rounded-2xl {
        height: 400px !important; /* Уменьшаем высоту для мобильных */
    }
    
    #gallery #mainImage {
        object-fit: cover !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Уменьшаем кнопки навигации для мобильных */
    #gallery #prevBtn,
    #gallery #nextBtn {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        background: rgba(255, 255, 255, 0.9) !important;
        backdrop-filter: blur(5px) !important;
    }
    
    /* Оптимизация миниатюр */
    #gallery .grid.grid-cols-7 {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 колонки вместо 7 */
        gap: 8px !important;
        margin-top: 12px !important;
    }
    
    #gallery .grid.grid-cols-7 > div {
        height: 70px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }
    
    #gallery .grid.grid-cols-7 img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Счетчик фото */
    #gallery .absolute.top-4.left-4 {
        font-size: 14px !important;
        padding: 6px 12px !important;
        background: rgba(0, 0, 0, 0.6) !important;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    #gallery .relative.rounded-2xl {
        height: 300px !important;
    }
    
    #gallery .grid.grid-cols-7 {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
    
    #gallery .grid.grid-cols-7 > div {
        height: 60px !important;
    }
    
    #gallery #prevBtn,
    #gallery #nextBtn {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
}

/* Очень маленькие телефоны */
@media (max-width: 360px) {
    #gallery .relative.rounded-2xl {
        height: 250px !important;
    }
    
    #gallery .grid.grid-cols-7 > div {
        height: 50px !important;
    }
    
    #gallery .absolute.top-4.left-4 {
        font-size: 12px !important;
        padding: 4px 10px !important;
    }
}

/* Ландшафтная ориентация на телефонах */
@media (max-width: 768px) and (orientation: landscape) {
    #gallery .relative.rounded-2xl {
        height: 350px !important;
    }
    
    #gallery .grid.grid-cols-7 > div {
        height: 80px !important;
    }
}