/* ========================================
   MOBILE-ONLY FIXES
   Только для мобильных (< 1024px)
   Десктоп не изменён!
   ======================================== */

/* ============================================
   1. СКРЫТЬ ТОЛЬКО ГЛАВНУЮ 3D МОДЕЛЬ В HERO
   НЕ трогать 3D модели в карточках!
   ============================================ */

@media (max-width: 1023px) {
    /* Частая причина "вылета" ширины на мобиле — absolute/transform элементы.
       Запираем горизонтальный скролл строго на мобиле. */
    html, body {
        overflow-x: hidden !important;
    }

    /* Скрыть ТОЛЬКО первую model-viewer в hero */
    section:first-of-type model-viewer:first-of-type {
        display: none !important;
    }

    /* Убрать подпись у 3D модели ("Огнетушитель ОП-5") в hero */
    section:first-of-type .model-label {
        display: none !important;
    }

    /* Убрать бейдж "Лицензия МЧС России" в первом экране (между щитом и заголовком) */
    section:first-of-type .glass-badge {
        display: none !important;
    }

    /* Убрать все плавающие бейджи/лейблы вокруг модели в hero (в т.ч. "500+ проектов") */
    section:first-of-type .order-1 .absolute {
        display: none !important;
    }

    /* В статистике hero оставить только "10+ лет на рынке" (скрыть 500+ / поддержка / гарантия) */
    section:first-of-type .grid.grid-cols-4 > div:nth-child(2),
    section:first-of-type .grid.grid-cols-4 > div:nth-child(3),
    section:first-of-type .grid.grid-cols-4 > div:nth-child(4) {
        display: none !important;
    }

    /* После скрытия элементов перестроить сетку */
    section:first-of-type .grid.grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        justify-items: center;
    }

    /* Сжать лишний "воздух" в hero */
    section:first-of-type {
        /* На мобиле min-h-screen + большие отступы дают пустоты сверху/снизу */
        min-height: auto !important;
        padding-top: 3.25rem !important;
        padding-bottom: 1.5rem !important;
    }
    section:first-of-type .mobile-shield-replacement {
        padding: 0.25rem 0 0 !important;
    }

    /* Строгое центрирование герба с огнем */
    section:first-of-type .mobile-shield-replacement {
        justify-content: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    section:first-of-type .shield-container-mobile {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Показать SVG щит */
    .mobile-shield-replacement {
        display: flex !important;
    }
}

/* ============================================
   Кнопка "Заказать" в модальном окне оборудования
   (используется и на мобиле, и на десктопе)
   ============================================ */

.btn-order-outline {
    background: transparent !important;
    border: 2px solid #f97316 !important;
    color: #ffffff !important;
    border-radius: 9999px !important;
}

.btn-order-outline:hover {
    background: rgba(249, 115, 22, 0.12) !important;
}

.btn-order-outline:active {
    background: rgba(249, 115, 22, 0.18) !important;
}

@media (min-width: 1024px) {
    .mobile-shield-replacement {
        display: none !important;
    }
}


/* ============================================
   2. SVG ЩИТ - ЦЕНТРИРОВАНИЕ
   ============================================ */

.mobile-shield-replacement {
    display: none;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 2rem 0;
    margin: 0 auto;
}

.shield-container-mobile {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .shield-container-mobile {
        width: 320px;
        height: 320px;
    }
}

.shield-glow-mobile {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-mobile 3s ease-in-out infinite;
}

@keyframes glow-mobile {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.shield-svg-mobile {
    width: 85%;
    height: 85%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 10px 30px rgba(249, 115, 22, 0.3));
}

.shield-logo-mobile {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    object-fit: contain;
    z-index: 2;
}

.fire-container-mobile {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.fire-svg-mobile {
    width: 3.5rem;
    height: 3.5rem;
    animation: flicker-mobile 2s ease-in-out infinite;
}

@keyframes flicker-mobile {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.8; }
    25% { transform: scale(1.05) translateY(-2px); opacity: 0.9; }
    50% { transform: scale(0.98) translateY(1px); opacity: 0.7; }
    75% { transform: scale(1.02) translateY(-1px); opacity: 0.85; }
}


/* ============================================
   3. ЦЕНТРИРОВАНИЕ ЗАГОЛОВКОВ
   ============================================ */

@media (max-width: 1023px) {
    h1, h2, h3, h4, h5, h6 {
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }
}


/* ============================================
   3.1 HERO: выравнивание и удаление лишних надписей
   (только мобильные)
   ============================================ */

@media (max-width: 1023px) {
    /* Центрировать текстовый блок слева в HERO */
    section:first-of-type .order-2 {
        text-align: center !important;
    }

    /* Центрировать бейдж "Лицензия" */
    section:first-of-type .order-2 .glass-badge {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Центрировать описание под H1 (max-w-lg делает визуальный сдвиг) */
    section:first-of-type .order-2 p.max-w-lg {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Убрать надпись "Огнетушитель ОП-5" и декоративный glow */
    section:first-of-type .model-viewer-container .model-label,
    section:first-of-type .model-viewer-container .model-glow {
        display: none !important;
    }

    /* Убрать "Гарантия" и "24/7" бейджи рядом с моделью (оставляем "500+ проектов") */
    section:first-of-type .order-1 .absolute.-top-4,
    section:first-of-type .order-1 .absolute.top-1\/3 {
        display: none !important;
    }

    /* Убрать в статистике "поддержка" и "гарантия" (3-й и 4-й элементы) */
    section:first-of-type .grid.grid-cols-4 > div:nth-child(3),
    section:first-of-type .grid.grid-cols-4 > div:nth-child(4) {
        display: none !important;
    }

    /* Чтобы сетка не разваливалась после скрытия 2 элементов */
    section:first-of-type .grid.grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Доп. страховка центрирования SVG-щита */
    section:first-of-type .model-viewer-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}


/* ============================================
   4. УМЕНЬШЕНИЕ ОТСТУПОВ
   ============================================ */

@media (max-width: 1023px) {
    section[class*="py-"],
    .section {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    @media (min-width: 640px) {
        section[class*="py-"],
        .section {
            padding-top: 1rem !important;
            padding-bottom: 1rem !important;
        }
    }
    
    [class*="mb-20"],
    [class*="mb-16"],
    [class*="mb-12"] {
        margin-bottom: 1.5rem !important;
    }
    
    [class*="mb-10"],
    [class*="mb-8"] {
        margin-bottom: 1rem !important;
    }
    
    [class*="gap-20"],
    [class*="gap-16"],
    [class*="gap-12"] {
        gap: 1rem !important;
    }
    
    .container,
    [class*="max-w-"] {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}


/* ============================================
   5. ОПТИМИЗАЦИЯ ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================ */

@media (max-width: 374px) {
    .shield-container-mobile {
        width: 220px !important;
        height: 220px !important;
    }
    
    .fire-svg-mobile {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
}


/* ============================================
   6. DISABLE ANIMATIONS (ACCESSIBILITY)
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .shield-glow-mobile,
    .fire-svg-mobile {
        animation: none !important;
    }
}


/* ============================================
   7. iPhone 14 (430px) - точные правки под ваш тест
   ТОЛЬКО мобильные
   ============================================ */

@media (max-width: 480px) {
    /* HERO: убрать пустоты (верх/низ) */
    section.section-dark.min-h-screen {
        min-height: auto !important;
        align-items: flex-start !important;
        padding-top: 3.25rem !important;
        padding-bottom: 1rem !important;
    }

    /* HERO: уменьшить разрыв между щитом и текстом */
    section.section-dark.min-h-screen .grid.lg\:grid-cols-2 {
        gap: 1rem !important;
    }

    /* Щит: убрать избыточный верхний/нижний отступ */
    section.section-dark.min-h-screen .mobile-shield-replacement {
        padding-top: 0.25rem !important;
        padding-bottom: 0 !important;
        margin-bottom: 0.25rem !important;
    }

    /* Заголовок HERO: 30px */
    section.section-dark.min-h-screen h1.text-display {
        font-size: 30px !important;
        line-height: 1.1 !important;
        margin-bottom: 0.75rem !important;
    }

    /* Заголовок "Сертифицированное оборудование": 30px */
    h2.text-section {
        font-size: 30px !important;
        line-height: 1.1 !important;
    }

    /* HERO: убрать блок статистики ("10+ лет на рынке" и пустоты) */
    section.section-dark.min-h-screen .grid.grid-cols-4 {
        display: none !important;
    }

    /* Feature strip (оранжевый блок): покрупнее и пожирнее */
    .feature-strip {
        padding-top: 0.875rem !important;
        padding-bottom: 0.875rem !important;
    }
    .feature-strip .text-white {
        font-size: 14px !important;
        font-weight: 700 !important;
        letter-spacing: 0.2px !important;
    }
    .feature-strip svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* "Комплексные решения по пожарной безопасности" - единый белый */
    #услуги h2 span {
        color: #ffffff !important;
        opacity: 1 !important;
    }

    /* Карточки услуг (мобайл): приводим к тому же стилю, что и в "Преимущества":
       иконка сверху, единый заголовок по центру (заголовок+подзаголовок объединены JS). */
    #услуги .glass-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }

    /* Иконка (плашка) — сверху, по центру */
    #услуги .glass-card > div:nth-child(1) {
        width: 52px !important;
        height: 52px !important;
        margin: 0 auto 12px !important;
        flex: 0 0 auto !important;
    }

    /* Единый заголовок */
    #услуги .glass-card h3 {
        margin: 0 0 10px !important;
        font-size: 20px !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
        width: 100% !important;
    }

    /* Оранжевая часть заголовка (бывший подзаголовок) */
    #услуги .glass-card h3 .service-title-accent {
        color: #f97316 !important;
        font-weight: 800 !important;
        opacity: 1 !important;
        
    }

    /* Описание и прочие элементы — чуть плотнее */
    #услуги .glass-card p {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* v8: service card price + order button stacked on mobile */
@media (max-width: 480px) {
  .service-cta-row{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .service-cta-row .order-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 2px solid #f97316;
    border-radius: 9999px;
    background: transparent;
    line-height: 1;
    text-decoration: none;
  }
  .service-cta-row .order-btn svg{
    width: 14px;
    height: 14px;
  }
}



