/* Адаптивные стили */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title-primary {
        font-size: 2.25rem;
    }

    .hero-tagline {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 1rem;
    }

    /* Герой + «Выберите повод»: одна колонка, текст по центру */
    .hero-content,
    .hero-main-content {
        text-align: center;
        margin-bottom: 2rem;
    }

    .hero-main-content .hero-subtitle,
    .home-page .hero-main-content .seo-context-line {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-main-content .hero-buttons {
        justify-content: center;
    }

    .hero-categories-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-actions {
        gap: 1rem;
    }
    
    .phone {
        display: none;
    }
    
    .header-actions .btn-call {
        display: none;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .reviews-slider {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-legal {
        justify-content: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 20px;
    }
    
    /* Скрываем баннер на очень маленьких экранах */
    .hero-image {
        display: none;
    }
}

    /* Обновление сетки категорий в герое */
    .hero-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

/* ALL CATALOG override: desktop 3 columns, mobile 2 columns (does NOT affect index.php) */
@media (min-width: 992px) {
    .hero-categories-grid.all-catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 991px) {
    .hero-categories-grid.all-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .hero-title-primary {
        font-size: 1.85rem;
    }

    .hero-tagline {
        font-size: 1.65rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-hero {
        width: 100%;
        margin: 0 0 10px 0;
    }
    
    .btn-florist {
        width: auto;
    }

    .mobile-contacts .btn-florist,
    .mobile-contacts .btn-call {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .view-all {
        align-self: flex-end;
    }
    
    .product-card {
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Адаптация формы */
    input, select, textarea {
        padding: 10px 12px;
        font-size: 16px; /* Предотвращает zoom на iOS */
    }
    
    /* Адаптация мобильного меню */
    .bottom-nav {
        padding: 8px 0;
    }
    
    .nav-text {
        font-size: 0.65rem;
    }
    
    /* Адаптация карточки товара */
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    /* Улучшение отступов для мобильных */
    .hero-section,
    .categories-section,
    .products-section,
    .steps-section,
    .features-section,
    .reviews-section,
    .cta-section {
        padding: 40px 0;
    }
    
    /* Адаптация модального окна */
    .florist-option {
        padding: 0.75rem;
    }
    
    .option-icon {
        font-size: 1.5rem;
        margin-right: 0.75rem;
    }
    
    /* Адаптация отзывов */
    .review-card {
        padding: 1.5rem;
    }
    
    /* Адаптация подвала */
    .site-footer {
        padding: 40px 0 20px;
    }
    
    .footer-col {
        margin-bottom: 2rem;
    }
    
    .footer-col:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 400px) {
    .logo-wordmark__line--lg {
        font-size: 1.05rem;
    }

    .logo-wordmark__line--sm {
        font-size: 0.7rem;
    }
    
    .cart-link {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .step-card,
    .feature {
        padding: 1.5rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .category-icon {
        font-size: 2rem;
    }
}

/* Портретный режим на мобильных */
@media (orientation: portrait) {
    .hero-section {
        min-height: calc(100vh - 140px);
        display: flex;
        align-items: center;
    }
}

/* Ландшафтный режим на мобильных */
@media (orientation: landscape) and (max-height: 600px) {
    .site-header {
        position: static;
    }
    
    .hero-title-primary {
        font-size: 1.85rem;
    }

    .hero-tagline {
        font-size: 1.65rem;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .bottom-nav {
        display: none;
    }
}

/* Высокие экраны */
@media (min-height: 800px) and (min-width: 768px) {
    .hero-section {
        min-height: 80vh;
        display: flex;
        align-items: center;
    }
}

/* Поддержка touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn, .category-card, .product-card {
        min-height: 44px; /* Минимальный размер для touch */
    }
    
    .btn {
        padding: 12px 24px; /* Больше для пальцев */
    }
    
    input, select, textarea {
        font-size: 16px; /* Предотвращает zoom на iOS */
    }
    
    /* Убираем ховер-эффекты для touch */
    .product-card:hover {
        transform: none;
    }
    
    .category-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Добавляем активные состояния */
    .btn:active {
        transform: scale(0.98);
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
}

/* Печать */
@media print {
    .site-header,
    .bottom-nav,
    .cta-section,
    .btn,
    .mobile-menu-btn,
    .modal-overlay {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}