/* ============================================================
   MHDCommerce — Responsividade (Media Queries)
   Adicionar ao FINAL do site.css
   ============================================================
   Breakpoints:
     > 1024px  → desktop (padrão, já definido acima)
     ≤ 1024px  → tablet
     ≤ 768px   → mobile
   ============================================================ */

/* ════════════════════════════════════════════
   ELEMENTOS MOBILE — ocultos no desktop
   ════════════════════════════════════════════ */
.menu-btn,
.mobile-search-row,
.drawer,
.drawer-overlay,
.bottom-nav { display: none; }

/* ════════════════════════════════════════════
   TABLET — até 1024px
   ════════════════════════════════════════════ */
@media (max-width: 1024px) {

    .header-inner,
    .nav-inner,
    .content,
    .footer-top,
    .footer-bottom,
    .dept-hero-inner,
    .cat-pills-bar-inner,
    .sort-bar-inner { padding-left: 20px; padding-right: 20px; }

    /* Grid de produtos: 6 → 4 colunas */
    .products,
    .products.cols-6 { grid-template-columns: repeat(4, 1fr); }
    .products.cols-5 { grid-template-columns: repeat(4, 1fr); }

    /* Footer: 5 → 3 colunas */
    .footer-top { grid-template-columns: 1.5fr 1fr 1fr; }

    /* Busca um pouco menor */
    .search-wrap { max-width: 420px; }
}

/* ════════════════════════════════════════════
   MOBILE — até 768px
   ════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── TOPBAR: só a primeira info ── */
    .topbar { gap: 0; padding: 7px 16px; font-size: 11px; }
    .topbar span:not(:first-child) { display: none; }

    /* ── HEADER em 2 linhas ── */
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }

    /* Botão hambúrguer aparece */
    .menu-btn {
        position:relative;
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; flex-shrink: 0;
        background: var(--brand); color: #fff;
        border: none; border-radius: var(--radius-sm); cursor: pointer;
        order: 1;
    }
    .menu-btn svg { width: 22px; height: 22px; }

    .menu-btn .notif-dot {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--red, #e53b3b);
        box-shadow: 0 0 0 2px var(--brand); /* anelzinho pra destacar do verde do botão */
        display: block;
    }

    .logo { order: 2; flex: 1; }
    .logo-tagline { display: none; } /* esconde "Supermercado Online" */

    /* Ações: vira só ícones essenciais */
    .header-actions { order: 3; margin-left: 0; gap: 2px; }
    .header-actions .h-btn span { display: none; } /* esconde os textos */
    .header-actions .h-btn { padding: 8px; }
    /* Esconde "Entrar", "Favoritos", "Minha Lista" — ficam no drawer */
    .header-actions .h-btn:not(.cart) { display: none; }
    .h-btn.cart { padding: 8px 12px; }
    .h-btn.cart span:not(.cart-count) { display: inline; } /* mantém "Carrinho" some via regra acima */

    /* Busca: linha própria, full width */
    .search-wrap {
        order: 4; flex-basis: 100%; max-width: none; height: 42px;
    }

    /* ── NAV horizontal de departamentos: ESCONDE (vai pro drawer) ── */
    .nav { display: none; }

    /* ── DRAWER LATERAL ── */
    .drawer-overlay {
        display: block; position: fixed; inset: 0;
        background: rgba(0,0,0,.5);
        opacity: 0; pointer-events: none;
        transition: opacity .3s; z-index: 998;
    }
    .drawer-overlay.open { opacity: 1; pointer-events: all; }
    .drawer {
        display: flex; flex-direction: column;
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 300px; max-width: 85vw; background: var(--white);
        transform: translateX(-100%);
        transition: transform .3s ease;
        z-index: 999;
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    .drawer.open { transform: translateX(0); }
    .drawer-header {
        background: var(--brand); color: #fff;
        padding: 18px 20px; display: flex; align-items: center; justify-content: space-between;
        flex-shrink: 0;
    }
    .drawer-header-title { font-family: 'Sora',sans-serif; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
    .drawer-close { background: rgba(255,255,255,.15); border: none; color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
    .drawer-body { flex: 1; overflow-y: auto; }
    .drawer-section-label { padding: 14px 20px 8px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
    .drawer-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 500; border-bottom: 1px solid #f4f1ea; }

    .drawer-item .notif-badge {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        background: var(--red, #e53b3b);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        border-radius: 99px;
        line-height: 1;
    }
    /* quando o badge existe, a setinha não precisa mais do margin-left:auto */
    .drawer-item .notif-badge + .di-arrow {
        margin-left: 8px;
    }

    .drawer-item:active { background: var(--brand-light); }
    .drawer-item .di-icon { font-size: 20px; width: 24px; text-align: center; }
    .drawer-item.special { color: var(--brand); font-weight: 700; }
    .drawer-item .di-arrow { margin-left: auto; color: #ccc; }
    .drawer-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
    .drawer-btn { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--bg); text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 600; }
    .drawer-btn svg { width: 18px; height: 18px; }

    /* ── HERO compacto ── */
    .dept-hero-inner { padding: 18px 16px; }
    .dept-hero-title { font-size: 22px; }
    .dept-hero-emoji { font-size: 26px; }
    .banner-title { font-size: 30px; }
    .hero-inner { grid-template-columns: 1fr; }
    .banner-visual { display: none; } /* esconde emoji gigante no mobile */
    .banner-content { padding: 32px 0; }

    /* ── MINI-STRIP vira 2x2 ── */
    .mini-strip-inner { flex-wrap: wrap; padding: 0; }
    .mini-card { flex: 1 1 50%; padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .mini-card:nth-child(even) { border-left: 1px solid var(--border); }

    /* ── GRID: 2 colunas ── */
    .content { padding: 16px; }
    .products,
    .products.cols-6,
    .products.cols-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-img { height: 120px; font-size: 44px; }
    .price-new { font-size: 17px; }

    /* Seções */
    .section { margin-top: 28px; }
    .section-title { font-size: 17px; }

    /* ── BANNER STRIP empilha ── */
    .banner-strip { flex-direction: column; align-items: flex-start; padding: 22px; }
    .strip-btns { width: 100%; flex-direction: column; }
    .strip-btn { width: 100%; text-align: center; }

    /* ── BOTTOM NAV aparece ── */
    .bottom-nav {
        display: flex; position: sticky; bottom: 0;
        background: var(--white); border-top: 1px solid var(--border);
        padding: 6px 0; z-index: 90;
    }
    .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; text-decoration: none; color: var(--muted); font-size: 10px; font-weight: 600; position: relative; }
    .bn-item.active { color: var(--brand); }
    .bn-item svg { width: 22px; height: 22px; }
    .bn-cart-badge { position: absolute; top: 0; left: 50%; transform: translateX(6px); background: var(--accent); color: #6a3d00; border-radius: 99px; min-width: 16px; height: 16px; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

    /* ── FOOTER: 1 coluna ── */
    .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 16px 24px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; padding: 16px; }
}

/* ════════════════════════════════════════════
   MOBILE PEQUENO — até 420px
   ════════════════════════════════════════════ */
@media (max-width: 420px) {
    .footer-top { grid-template-columns: 1fr; }
    .banner-title { font-size: 26px; }
    .mini-card { flex-basis: 100%; }
    .mini-card:nth-child(even) { border-left: none; }
}
