/* ============================================================
   RESPONSIVE — Mobile first breakpoints
   sm: 640px | md: 768px | lg: 1024px | xl: 1280px
   ============================================================ */

/* ── Tablet (≤ 1024px) ───────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .footer-info  { grid-column: 1 / -1; }

  .about-split { grid-template-columns: 1fr; gap: var(--space-10); }
  .about-image { order: -1; max-width: 420px; margin-inline: auto; width: 100%; }

  .product-layout { grid-template-columns: 1fr 1fr; gap: var(--space-8); }

  .quote-layout { grid-template-columns: 1fr 320px; gap: var(--space-8); }

  .page-container { grid-template-columns: 1fr 240px; }
}

/* ── Mobile grande (≤ 768px) ─────────────────────────────── */
@media (max-width: 768px) {

  /* Header */
  .main-nav     { display: none; }
  .btn-menu-toggle { display: flex; }
  .mobile-nav   { display: block; }

  /* Footer */
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-info  { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Hero */
  .hero { height: 70vh; min-height: 420px; }
  .hero-overlay { background: linear-gradient(to bottom, rgba(44,22,70,.6) 0%, rgba(44,22,70,.4) 100%); }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; max-width: 280px; }

  /* Grids */
  .categories-grid   { grid-template-columns: 1fr 1fr; }
  .products-grid--3  { grid-template-columns: 1fr 1fr; }
  .products-grid--4  { grid-template-columns: 1fr 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .steps-grid        { grid-template-columns: 1fr 1fr; }

  /* Category */
  .category-layout { grid-template-columns: 1fr; }

  .filters-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 300px; max-width: 85vw;
    z-index: 950;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform var(--transition);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
  }
  .filters-sidebar.is-open { transform: translateX(0); }
  .filters-close { display: flex; }

  .filters-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 940;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }
  .filters-overlay.is-visible { opacity: 1; pointer-events: all; }

  .filters-toggle { display: flex; }

  /* Produto */
  .product-layout { grid-template-columns: 1fr; gap: var(--space-6); }
  .product-gallery { position: static; }

  /* Orçamento */
  .quote-layout { grid-template-columns: 1fr; }
  .quote-sidebar { position: static; }

  /* Páginas */
  .page-container { grid-template-columns: 1fr; }
  .page-sidebar-cta { position: static; }
}

/* ── Mobile (≤ 640px) ────────────────────────────────────── */
@media (max-width: 640px) {

  :root {
    --container-px: 1rem;
    --header-height: 60px;
  }

  /* Hero */
  .hero { height: 85vh; }
  .hero-title { font-size: var(--text-3xl); }
  .hero-subtitle { font-size: var(--text-base); }

  /* Grids */
  .categories-grid { grid-template-columns: 1fr; }
  .products-grid--3, .products-grid--4, .products-grid--auto { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }

  /* Seções */
  .section { padding-block: var(--space-10); }

  /* Footer */
  .footer-top { grid-template-columns: 1fr; gap: var(--space-6); }

  /* WhatsApp FAB */
  .whatsapp-fab { bottom: var(--space-4); right: var(--space-4); }
  .whatsapp-fab-label { display: none; }

  /* Busca */
  .search-hero-form { flex-direction: column; }
  .search-hero-input { font-size: var(--text-base); }

  /* Variantes */
  .variant-options { flex-direction: column; }
  .variant-option { justify-content: space-between; }

  /* Orçamento */
  .quote-item { flex-wrap: wrap; }
  .quote-item-meta { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
}

/* ── Sem hover (touch devices) ───────────────────────────── */
@media (hover: none) {
  .product-card:hover { transform: none; }
  .category-card:hover { transform: none; }
  .btn:active { transform: scale(.97); }
}

/* ── Preferência por animações reduzidas ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
