/* ===================================================
   ОРВИС — Полный адаптив по PDF дизайну (стр.16-25)
   Breakpoints: 1400, 1024, 768, 480
   =================================================== */

/* ===== 1400px — широкие ноутбуки ===== */
@media(max-width:1400px) {
    :root { --page-px: 24px; }
    .about-grid { grid-template-columns: 1fr; }
    .about-media { height: 400px; }
    .product-gallery-main { flex: 0 0 600px; height: 450px; }
    .product-info-block { width: 100%; max-width: 600px; }
    .products-grid-catalog--cols-4 { grid-template-columns: repeat(3,1fr); }
}

/* ===== 1024px — планшет горизонтально ===== */
@media(max-width:1024px) {
    /* Шапка */
    .main-nav { display: none !important; }
    .burger-btn { display: flex !important; }
    .header-inner { padding: 12px 20px; }

    /* Hero */
    .hero-section { height: 500px; padding: 0 20px; }
    .hero-slide-content { top: 140px; left: 0; right: 0; }
    .hero-slide-content h1 { font-size: clamp(10px, 2.9vw, 56px); white-space: nowrap; max-width: none; }

    /* Преимущества */
    .advantages-grid { grid-template-columns: repeat(2,1fr); }
    .advantage-item:nth-child(2) { border-right: none; }
    .advantage-item:nth-child(4) { border-right: 1px solid var(--color-stroke); }

    /* Шоурум */
    .showroom-grid { grid-template-columns: 1fr; }
    .showroom-item:first-child { height: 300px; grid-row: unset; }
    .showroom-item:not(:first-child) { height: 200px; }

    /* Каталог на главной */
    .products-grid { flex-wrap: wrap; }
    .product-card { flex: 0 0 calc(50% - 8px); }

    /* Каталог страница */
    .products-grid-catalog--cols-3 { grid-template-columns: repeat(2,1fr); }
    .products-grid-catalog--cols-4 { grid-template-columns: repeat(2,1fr); }
    .category-filter { overflow-x: auto; flex-wrap: nowrap; }
    .category-pill { flex-shrink: 0; }

    /* Новости */
    .news-grid { grid-template-columns: repeat(2,1fr); }

    /* Страница товара */
    .product-gallery-row { flex-wrap: wrap; }
    .product-gallery-main { flex: 0 0 100%; height: 400px; order: 1; }
    .product-gallery-side { display: none; }
    .product-gallery-arrow { display: none; }
    .product-info-block { width: 100%; padding: 32px 24px 40px; }

    /* Избранное */
    #wishlistGrid { grid-template-columns: repeat(2,1fr) !important; }

    /* Футер */
    .footer-menus { flex-wrap: wrap; gap: 32px; }
    .footer-inner { gap: 32px; }

    /* Контакты — карточка */
    .contacts-card {
        position: relative !important;
        top: auto !important; left: auto !important;
        transform: none !important;
        width: 100%;
    }

    /* Страницы контента */
    .page-contacts-3col { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* ===== 768px — телефон горизонтально / планшет вертикально ===== */
@media(max-width:768px) {
    :root { --page-px: 16px; }

    /* Шапка */
    .header-inner { padding: 12px 16px; }
    .site-logo-text { font-size: 18px; }

    /* Hero (PDF стр.16: баннер на всю ширину, текст слева) */
    .hero-section { height: 380px; margin-top: 56px; padding: 0; }
    .hero-slide-content { top: 80px; left: 0; right: 0; }
    .hero-slide-content h1 { font-size: clamp(10px, 2.9vw, 56px); white-space: nowrap; max-width: none; }

    /* Подзаголовок */
    .subtitle-section { padding: 32px 16px; }
    .subtitle-section h2 { font-size: 24px; }

    /* Преимущества (PDF стр.16: 2 колонки) */
    .advantages-grid { grid-template-columns: repeat(2,1fr); }
    .advantage-item { padding: 24px 12px; gap: 16px; }
    .advantage-item p { font-size: 16px; }
    .advantage-icon img { width: 48px; height: 48px; }
    .adv-border-r { border-right: none !important; }
    .advantage-item:nth-child(1),
    .advantage-item:nth-child(3),
    .advantage-item:nth-child(5) { border-right: 1px solid var(--color-stroke) !important; }

    /* Шоурум */
    .showroom-section { padding: 40px 16px; }
    .showroom-grid { grid-template-columns: 1fr; gap: 8px; }
    .showroom-item:first-child { height: 220px; }
    .showroom-item:not(:first-child) { height: 150px; }
    .showroom-item-label { font-size: 14px; padding: 8px 12px; }

    /* Каталог на главной (PDF стр.16: слайдер 2 карточки) */
    .catalog-section { padding: 40px 16px; }
    .catalog-tabs { gap: 16px; overflow-x: auto; flex-wrap: nowrap; }
    .catalog-tab { flex-shrink: 0; font-size: 15px; }
    .products-grid { gap: 8px; }
    .product-card { flex: 0 0 calc(50% - 4px); min-height: 280px; }
    .product-card-image { min-height: 200px; }
    .product-card-image img { height: 200px; }

    /* Производители */
    .manufacturers-section { padding: 40px 16px; }
    .manufacturers-grid { gap: 16px; justify-content: center; }
    .manufacturer-logo { height: 40px; max-width: 120px; }

    /* О компании */
    .about-section { padding: 40px 16px; }
    .about-grid { grid-template-columns: 1fr; gap: 32px; }
    .about-label { font-size: 28px; }
    .about-text p { font-size: 16px; }
    .about-media { height: 280px; }

    /* Новости */
    .news-section { padding: 40px 16px; }
    .news-section .section-title { font-size: 28px; margin-bottom: 32px; }
    .news-grid { grid-template-columns: 1fr; gap: 24px; }
    .news-card-image { height: 220px; }
    .news-card-title { font-size: 16px; }

    /* Карта / контакты */
    .contacts-section { display: flex; flex-direction: column; }
    .contacts-map { height: 320px; }
    .contacts-card {
        position: relative !important;
        top: auto !important; left: auto !important;
        transform: none !important;
        padding: 24px 16px;
        gap: 16px;
    }
    .contacts-card .contacts-phone a { font-size: 24px !important; }
    .contacts-card .contacts-mail a,
    .contacts-card .contacts-address span { font-size: 16px !important; }

    /* Футер (PDF стр.16: в колонку) */
    .site-footer { padding: 40px 16px; }
    .footer-inner { flex-direction: column; gap: 32px; }
    .footer-logo { min-height: auto; gap: 16px; }
    .footer-menus { flex-direction: column; gap: 24px; max-width: 100%; }
    .footer-menu-col { gap: 16px; }
    .footer-menu-col a { font-size: 15px; }
    .footer-contacts { gap: 16px; }

    /* Заголовок страниц */
    .section-title { font-size: 24px !important; margin-bottom: 32px !important; }

    /* Каталог страница (PDF стр.17) */
    .catalog-page-inner { padding: 24px 16px; }
    .catalog-page-title { font-size: 28px; margin-bottom: 24px; text-align: left; }
    .products-grid-catalog--cols-3,
    .products-grid-catalog--cols-4 { grid-template-columns: repeat(2,1fr); gap: 8px; }
    .catalog-filters-row { flex-direction: column; align-items: flex-start; gap: 16px; }
    .price-range-track { width: 200px; }
    .price-range-input { width: 200px; }

    /* Страница товара (PDF стр.18) */
    .single-product-page { padding-top: 56px; }
    .product-gallery-row { padding: 0; }
    .product-gallery-main { height: 280px; }
    .product-info-block { width: 100%; padding: 24px 16px 40px; gap: 20px; }
    .product-title { font-size: 24px; }
    .product-price-text { font-size: 20px; }
    .product-description { font-size: 16px; }

    /* Избранное (PDF стр.19) */
    #wishlistGrid { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }

    /* Контакты страница (PDF стр.20) */
    .page-contacts-3col { grid-template-columns: 1fr !important; }
    .page-contacts-3col > div { padding: 0 !important; }

    /* Мебель на заказ (PDF стр.21) */
    .page-furniture-content { columns: 1 !important; }

    /* Дизайн-центр (PDF стр.22) */
    .design-grid { grid-template-columns: 1fr !important; }
    .design-gallery { grid-template-columns: repeat(3,1fr) !important; height: 150px !important; }

    /* Салон (PDF стр.23) */
    .salon-grid { grid-template-columns: 1fr !important; }
}

/* ===== 480px — телефон вертикально ===== */
@media(max-width:480px) {
    :root { --page-px: 12px; }

    /* Шапка */
    .site-logo-text { font-size: 16px; letter-spacing: 0.1em; }

    /* Hero */
    .hero-section { height: 320px; }
    .hero-slide-content h1 { font-size: clamp(10px, 2.9vw, 56px); white-space: nowrap; }

    /* Преимущества — 2 колонки (по PDF стр.16) */
    .advantages-grid { grid-template-columns: repeat(2,1fr); }

    /* Карточки товаров — 2 в ряд */
    .product-card { flex: 0 0 calc(50% - 4px); min-height: 240px; }
    .product-card-image img { height: 160px; }
    .product-card-name { font-size: 14px; }
    .product-card-price { font-size: 14px; }

    /* Каталог — 2 колонки */
    .products-grid-catalog--cols-3,
    .products-grid-catalog--cols-4 { grid-template-columns: repeat(2,1fr) !important; gap: 8px; }

    /* Пиллы категорий */
    .category-filter { padding: 4px; gap: 4px; }
    .category-pill { padding: 4px 8px 4px 4px; gap: 8px; }
    .category-pill-img { width: 48px; height: 36px; }
    .category-pill-name { font-size: 13px; }

    /* Избранное — 2 колонки */
    #wishlistGrid { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }

    /* Модалка — снизу вверх, полный экран */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal {
        padding: 32px 16px 40px;
        max-height: 95vh;
        width: 100%;
        border-radius: 16px 16px 0 0;
        overflow-y: auto;
    }
    .modal h3,
    #callbackFormWrap > h3 { font-size: 20px !important; margin-bottom: 20px !important; }
    .modal .form-group input,
    .modal .form-group textarea { padding: 16px; font-size: 15px; }
    .btn-accent { padding: 16px 24px; font-size: 15px; }

    /* Мобильное меню */
    .mobile-menu { width: 100%; right: -100%; }
    .mobile-menu.active { right: 0; }
    .mobile-menu a { font-size: 18px; }

    /* Футер */
    .footer-social { gap: 16px; }
    .site-footer { padding: 32px 12px; }

    /* Страница товара */
    .product-gallery-main { height: 240px; }
    .product-info-block { padding: 20px 12px; }
    .product-title { font-size: 22px; }
    .product-price-text { font-size: 18px; }

    /* Новости */
    .news-card-image { height: 180px; }

    /* Производители */
    .manufacturers-grid { gap: 12px; }
    .manufacturer-logo { height: 32px; max-width: 90px; }

    /* Контакты */
    .contacts-card { padding: 20px 12px; }
    .contacts-card .contacts-phone a { font-size: 20px !important; }

    /* Breadcrumbs */
    .breadcrumbs { font-size: 12px; flex-wrap: wrap; }

    /* Range slider */
    .price-range-track { width: 160px; }
    .price-range-input { width: 160px; }
    .price-field { width: 110px; font-size: 14px; }
}

/* ===== Мобильная шапка — высота ===== */
@media(max-width:768px) {
    .hero-section { margin-top: 56px; }
    .admin-bar .hero-section { margin-top: 102px; }
}
@media(max-width:480px) {
    .admin-bar .hero-section { margin-top: 92px; }
}

/* ===== АДАПТИВ для страниц из PDF ===== */

/* PDF стр.11 wishlist: меньше колонок на мобильном */
@media(max-width:1200px) {
    #wishlistGrid { grid-template-columns: repeat(4,1fr) !important; }
    .wishlist-page .products-grid-full { grid-template-columns: repeat(4,1fr) !important; }
}
@media(max-width:1024px) {
    #wishlistGrid { grid-template-columns: repeat(3,1fr) !important; }
    .wishlist-page .products-grid-full { grid-template-columns: repeat(3,1fr) !important; }
    /* PDF стр.14 Дизайн-центр */
    .design-text-photos { grid-template-columns: 1fr !important; }
    .design-photos-col { height: 400px !important; }
    .design-gallery-6 { grid-template-columns: repeat(3,1fr) !important; height: 300px !important; }
    /* PDF стр.15 Салон */
    .salon-2col { grid-template-columns: 1fr !important; }
    .salon-gallery-2x2 { grid-template-columns: 1fr 1fr; height: 400px; }
    /* PDF стр.13 Мебель */
    .furniture-text-cols { columns: 1 !important; }
    /* PDF стр.12 Контакты */
    .page-contacts-3col { grid-template-columns: 1fr !important; gap: 24px !important; }
}
@media(max-width:768px) {
    #wishlistGrid { grid-template-columns: repeat(2,1fr) !important; gap: 8px !important; }
    .wishlist-page .products-grid-full { grid-template-columns: repeat(2,1fr) !important; }
    .design-gallery-6 { grid-template-columns: repeat(2,1fr) !important; height: 240px !important; }
    .salon-gallery-2x2 { grid-template-columns: 1fr 1fr; height: 280px; }
    .design-photos-col { height: 280px !important; }
}
@media(max-width:480px) {
    #wishlistGrid { grid-template-columns: repeat(2,1fr) !important; }
    .design-gallery-6 { grid-template-columns: repeat(2,1fr) !important; height: 200px !important; }
    .salon-gallery-2x2 { height: 200px; }
}
