﻿/* ============================================
   КАТАЛОГ — ЖЁСТКИЙ АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    /* ===== СБРАСЫВАЕМ ВСЕ СТИЛИ ===== */
    .catalog-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ===== ЗАГОЛОВОК — НА ВСЮ ШИРИНУ ===== */
    .catalog-header {
        width: 100% !important;
        max-width: 100% !important;
        padding: 120px 15px 20px !important; /* отступ под фиксированную шапку */
        margin: 0 !important;
        text-align: center !important;
    }

        .catalog-header h1 {
            font-size: 1.8rem !important;
            margin-bottom: 8px !important;
            word-wrap: break-word !important;
        }

    .catalog-subtitle {
        font-size: 0.95rem !important;
        margin: 0 !important;
    }

    /* ===== ЛЕЙАУТ — В СТОЛБИК ===== */
    .catalog-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important;
        margin: 0 !important;
    }

        /* ===== САЙДБАР (КАТЕГОРИИ) — ВНИЗУ ===== */
        .catalog-layout aside {
            width: 100% !important;
            max-width: 100% !important;
            padding: 20px 15px !important;
            margin: 0 !important;
            order: 2 !important; /* второй по счёту (после товаров) */
            box-sizing: border-box !important;
        }

            .catalog-layout aside h3 {
                font-size: 1.1rem !important;
                margin-bottom: 15px !important;
                text-align: center !important;
            }

            .catalog-layout aside ul {
                display: flex !important;
                flex-direction: column !important;
                gap: 10px !important;
            }

                .catalog-layout aside ul li a {
                    padding: 10px 12px !important;
                    font-size: 0.9rem !important;
                    text-align: center !important;
                }

    /* ===== ОСНОВНОЙ КОНТЕНТ (ТОВАРЫ) — СВЕРХУ ===== */
    .catalog-main {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 15px !important;
        margin: 0 !important;
        order: 1 !important; /* первый по счёту */
        box-sizing: border-box !important;
    }

    /* ===== СЕТКА ТОВАРОВ — 1 КОЛОНКА ===== */
    .catalog-products-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin: 0 !important;
    }

    .catalog-product-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }

    .catalog-product-image {
        height: 200px !important;
        margin-bottom: 15px !important;
    }

    .catalog-product-name {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        line-height: 1.3 !important;
    }

    .catalog-product-brand {
        font-size: 0.9rem !important;
        margin-bottom: 12px !important;
    }

    .catalog-product-price {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }

    .catalog-product-quantity {
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
    }

    .catalog-btn-addtocart {
        width: 100% !important;
        padding: 12px !important;
        font-size: 1rem !important;
    }

    /* ===== ПАГИНАЦИЯ ===== */
    .pagination {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 30px !important;
        padding: 20px 0 !important;
    }

    .pagination-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        min-width: 40px !important;
    }

    /* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
    .empty-state {
        text-align: center !important;
        padding: 40px 20px !important;
    }
}




/* ============================================
   КАТАЛОГ — АДАПТИВ (МОБИЛЬНЫЕ)
   ============================================ */

@media (max-width: 768px) {
    /* ===== ОБЩИЙ КОНТЕЙНЕР ===== */
    .catalog-container {
        padding: 15px !important;
    }

    /* Отступ под фиксированную шапку */
    .catalog-header {
        margin-top: 120px !important;
        padding: 20px 10px !important;
    }

        .catalog-header h1 {
            font-size: 1.8rem !important;
            margin-bottom: 10px !important;
        }

    .catalog-subtitle {
        font-size: 0.95rem !important;
    }

    /* ===== ЛЕЙАУТ: САЙДБАР + КОНТЕНТ ===== */
    .catalog-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

        /* ===== САЙДБАР С КАТЕГОРИЯМИ ===== */
        .catalog-layout aside {
            width: 100% !important;
            padding: 20px 15px !important;
            order: 2 !important; /* сайдбар снизу */
        }

            .catalog-layout aside h3 {
                font-size: 1.1rem !important;
                margin-bottom: 15px !important;
            }

            /* Категории — компактный список */
            .catalog-layout aside ul {
                gap: 10px !important;
            }

                .catalog-layout aside ul li a {
                    padding: 10px 12px !important;
                    font-size: 0.9rem !important;
                }

    /* ===== ОСНОВНОЙ КОНТЕНТ (ТОВАРЫ) ===== */
    .catalog-main {
        order: 1 !important; /* контент сверху */
        width: 100% !important;
    }

    /* ===== СЕТКА ТОВАРОВ ===== */
    .catalog-products-grid {
        display: grid !important;
        grid-template-columns: 1fr !important; /* 1 колонка */
        gap: 20px !important;
    }

    /* Карточка товара */
    .catalog-product-card {
        padding: 15px !important;
    }

    .catalog-product-image {
        height: 200px !important;
        margin-bottom: 15px !important;
    }

    .catalog-product-name {
        font-size: 1.1rem !important;
        margin-bottom: 8px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .catalog-product-brand {
        font-size: 0.9rem !important;
        margin-bottom: 12px !important;
    }

    .catalog-product-price {
        font-size: 1.5rem !important;
        margin-bottom: 10px !important;
    }

    .catalog-product-quantity {
        font-size: 0.85rem !important;
        margin-bottom: 12px !important;
    }

    /* Кнопка "В корзину" */
    .catalog-btn-addtocart {
        width: 100% !important;
        padding: 12px !important;
        font-size: 1rem !important;
    }

    /* ===== ПАГИНАЦИЯ ===== */
    .pagination {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 30px !important;
    }

    .pagination-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        min-width: 40px !important;
    }
}

/* ===== ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (до 375px) ===== */
@media (max-width: 375px) {
    .catalog-header h1 {
        font-size: 1.5rem !important;
    }

    .catalog-product-image {
        height: 180px !important;
    }

    .catalog-product-name {
        font-size: 1rem !important;
    }
}

/* ============================================
   ШАПКА — ФИКСИРОВАННАЯ + УМНЫЙ СКРОЛЛ
   ============================================ */

@media (max-width: 768px) {
    /* Фиксируем шапку */
    .site-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        background: #FFE733 !important;
        transition: transform 0.3s ease !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }

        /* Скрываем при скролле вниз */
        .site-header.header-hidden {
            transform: translateY(-100%) !important;
        }
}

/* ============================================
   ФУТЕР — ЦЕНТРИРОВАНИЕ НА МОБИЛЬНОМ
   ============================================ */

@media (max-width: 768px) {
    footer,
    .site-footer,
    .footer {
        padding: 40px 20px !important;
    }

        /* Все колонки в столбик */
        .footer-content,
        .footer-columns,
        footer .row,
        footer .col,
        .footer-sections {
            display: flex !important;
            flex-direction: column !important;
            gap: 30px !important;
        }

        /* Каждая секция по центру */
        .footer-column,
        .footer-section,
        footer [class*="col-"] {
            text-align: center !important;
            width: 100% !important;
        }

        /* Логотип по центру */
        .footer-logo,
        footer .logo {
            display: flex !important;
            justify-content: center !important;
            margin-bottom: 20px !important;
        }

        /* Заголовки секций */
        .footer-column h4,
        .footer-section h4,
        footer h4 {
            font-size: 1.1rem !important;
            margin-bottom: 15px !important;
            text-align: center !important;
        }

    /* Списки ссылок */
    .footer-column ul,
    .footer-section ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

        .footer-column ul li,
        .footer-section ul li {
            margin-bottom: 8px !important;
            text-align: center !important;
        }

            .footer-column ul li a,
            .footer-section ul li a {
                font-size: 0.9rem !important;
                text-decoration: none !important;
                color: inherit !important;
            }

    /* Нижняя часть футера (копирайт) */
    .footer-bottom,
    footer .copyright {
        text-align: center !important;
        margin-top: 30px !important;
        padding-top: 20px !important;
        border-top: 1px solid rgba(255,255,255,0.2) !important;
    }
}