/* ========== Широкие экраны (1600px+) ========== */
@media (min-width: 1600px) {
    .container { max-width: 1400px; }
    .gallery-section, .about-section, .news-section { padding: 4.5rem 0; }
    .mc-home-section { padding: 5rem 0 6rem; }
    .news-grid { gap: 2.5rem; }
    .mc-grid   { gap: 2rem; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .section-title h2 { font-size: 2.4rem; }
}

/* ========== Адаптив — планшет ========== */
@media (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
}

@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    /* Меню чуть мельче на планшете чтобы все 4 пункта влезли */
    .nav-menu { gap: 1rem; }
    .nav-menu a { font-size: 0.9rem; }
}

/* ========== Адаптив — мобильный (≤768px) ========== */
@media (max-width: 768px) {

    /* --- Хедер --- */
    .burger { display: flex; }
    .logo-img { height: 46px; }
    .cart-btn {
        padding: 5px 12px;
        font-size: 0.82rem;
        gap: 5px;
        margin-left: 6px;
    }
    .cart-btn span:first-child { display: none; } /* убираем эмодзи на очень узких */
    .nav-menu {
        position: fixed;
        top: 56px;
        left: -100%;
        width: min(80%, 280px);
        height: calc(100dvh - 56px);   /* dvh для мобильных браузеров */
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 2rem;
        gap: 0.25rem;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0,0,0,0.12);
        z-index: 99;
        overflow-y: auto;
    }
    .nav-menu.active { left: 0; }
    .nav-menu li { width: 100%; }
    .nav-menu a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.05rem;
        border-bottom: 1px solid #f5f5f5;
    }
    .nav-menu a.active::after { display: none; } /* убираем подчёркивание — вместо него цвет */

    /* Затемнение за меню */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0,0,0,0.35);
        z-index: 98;
    }
    .nav-overlay.active { display: block; }

    /* --- Hero --- */
    .hero { height: auto; min-height: 75vh; padding: 4.5rem 0 3.5rem; }
    .hero-decor { display: none; }
    /* Больше воздуха между блоками */
    .gallery-section  { padding: 3rem 0; }
    .about-section    { padding: 3rem 0; }
    .news-section     { padding: 3rem 0; }
    .mc-home-section  { padding: 3rem 0 3.5rem; margin-top: 0; }
    .animated-title { font-size: clamp(1.6rem, 7vw, 2.4rem); }
    .hero-content p { font-size: clamp(0.9rem, 3.5vw, 1.1rem); }
    .btn { padding: 10px 24px; font-size: 0.95rem; }

    /* --- Секции --- */
    .section-title { margin: 2rem 0 1.25rem; }
    .section-title h2 { font-size: clamp(1.3rem, 5vw, 1.8rem); padding: 0 10px; }

    /* --- Галерея --- */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        margin: 1rem 0;
    }
    .gallery-item { border-radius: 14px; }
    .gallery-item .caption {
        font-size: 0.82rem;
        padding: 1rem 0.6rem 0.5rem;
        /* На мобиле caption всегда видна — нет hover */
        transform: translateY(0);
        opacity: 1;
    }

    /* --- About --- */
    .about-grid { flex-direction: column; gap: 1rem; }
    .about-text { padding: 1.25rem; border-radius: 20px; min-width: unset; }
    .about-stats {
        flex-direction: row;  /* горизонтально на мобиле — экономия места */
        flex-wrap: wrap;
        gap: 0.6rem;
        min-width: unset;
    }
    .stat-item {
        flex: 1 1 calc(33% - 0.4rem);
        min-width: 90px;
        padding: 0.9rem 0.5rem;
        font-size: 0.85rem;
        border-radius: 16px;
    }

    /* --- Новости --- */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    .news-card { border-radius: 16px; }
    .news-card .news-img { height: 180px; }
    .news-card-content { padding: 1rem; }
    .news-card h3 { font-size: 1.05rem; }

    /* --- Магазин --- */
    .shop-container { padding: 1rem 0; }
    .category { margin-bottom: 2rem; }
    .category > h2 {
        font-size: 1.2rem;
        padding: 0.4rem 1.2rem;
        margin-bottom: 1rem;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .product-card { border-radius: 14px; }
    .product-card .prod-img { height: 130px; }
    .product-card h4 { font-size: 0.85rem; margin: 0.5rem 0.4rem 0.2rem; }
    .product-card .price { font-size: 0.95rem; }
    .product-card .prod-desc { font-size: 0.75rem; padding: 0 0.5rem; }
    .product-card button { padding: 6px 14px; font-size: 0.82rem; margin-top: 0.5rem; }

    /* --- Компания --- */
    .company-content { padding: 1.25rem; border-radius: 20px; }
    .company-block { margin-bottom: 1.5rem; }
    .advantages-list li { font-size: 0.9rem; }

    /* --- Контакты --- */
    .contacts-grid { flex-direction: column; gap: 1rem; }
    .contacts-info, .contacts-map {
        min-width: unset;
        border-radius: 20px;
        padding: 1.25rem;
    }
    .contacts-map > div { height: 260px !important; }
    .contacts-map iframe { height: 260px !important; }

    /* --- Админка --- */
    .admin-form { padding: 1.25rem; border-radius: 16px; }
    .login-form { margin-top: 2rem; }

    /* --- Scroll-top --- */
    .scroll-top { bottom: 16px; right: 16px; min-width: 44px; height: 44px; padding: 0 12px; font-size: 1.1rem; }
    .scroll-top .st-label { display: none; }
    .scroll-top .st-arrow { font-size: 1.3rem; }
}

/* ========== Адаптив — очень узкие (≤400px) ========== */
@media (max-width: 400px) {
    .gallery-grid { gap: 0.4rem; }
    .gallery-item .caption { font-size: 0.75rem; }
    .stat-item { flex: 1 1 100%; } /* на совсем узких — вертикально */
    .products-grid { gap: 0.5rem; }
    .product-card .prod-img { height: 110px; }
}

/* ========== Footer мобиль ========== */
@media (max-width: 700px) {
    .footer-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .footer-logo-link {
        margin-left: 0;  /* убираем прижим к левому краю */
    }
    .footer-logo {
        height: 72px;    /* компактно на мобиле */
    }
    .footer-cols {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem 0.5rem;
        width: 100%;
    }
    .footer-col-title { font-size: 0.78rem; margin-bottom: 0.5rem; }
    .footer-col a { font-size: 0.82rem; }
    .footer-bottom {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 0.4rem;
    }
}
@media (max-width: 420px) {
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .footer-col:last-child { grid-column: 1 / -1; }
}
