/* ============================================================
   Crazy Deals Mart — Responsive CSS
   Mobile-first media queries
   Breakpoints: 480 | 640 | 768 | 1024 | 1280
============================================================ */

/* ─── Base Mobile-First Overrides ─────────────────────── */

/* Hero */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-deal-card { display: none; }
  .hero-cta-group { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-eyebrow { margin: 0 auto 18px; }

  /* 4-col → 3-col products */
  .products-grid-4,
  .featured-grid { grid-template-columns: repeat(3, 1fr); }
  
  /* 6-col trending -> 4-col */
  .trending-grid { grid-template-columns: repeat(4, 1fr); }

  /* 3-col trust → 2-col */
  .trust-grid { grid-template-columns: repeat(2, 1fr); }

  /* Footer — 4-col → 2-col at 1024px */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  /* Header */
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  /* Show hamburger, hide desktop nav */
  .hamburger { display: flex; }
  .header-nav { display: none; /* mobile: handled by drawer */ }

  /* Old .main-nav / .nav-list blocks removed — replaced by mobile-nav drawer in Module 4 */

  /* Hero */
  .hero-section { padding: 40px 0; min-height: auto; }
  .hero-title { font-size: 1.9rem; }

  /* Products 3-col → 2-col */
  .products-grid-4,
  .products-grid-3,
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Trending -> 3-col */
  .trending-grid { grid-template-columns: repeat(3, 1fr); }

  /* Categories */
  .categories-grid { grid-template-columns: repeat(2, 1fr); }

  /* Blog */
  .blog-grid-3 { grid-template-columns: repeat(2, 1fr); }

  /* Newsletter */
  .newsletter-form { flex-direction: column; border-radius: var(--radius-md); overflow: visible; background: none; border: none; gap: 12px; }
  .newsletter-input {
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: var(--radius-full);
    padding: 13px 20px;
    color: #fff;
  }
  .newsletter-btn { border-radius: var(--radius-full) !important; width: 100%; justify-content: center; }

  /* Footer — 2-col → 1-col at 768px */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-col-brand { text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-social { justify-content: center; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }
  .footer-disclosure .container p { justify-content: center; text-align: center; }

  /* Trust */
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }

  /* Section headers */
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Topbar */
  .topbar-left { display: none; }

  /* Disclaimer bar */
  .disclaimer-bar p { font-size: .72rem; }

  /* Back to top */
  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: .8rem; }
}

@media (max-width: 640px) {
  /* Products 2-col on small screens */
  .products-grid-4,
  .products-grid-3,
  .featured-grid,
  .trending-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Categories grid → 1-col */
  .categories-grid { grid-template-columns: 1fr 1fr; gap: 14px; }

  /* Blog → 1-col */
  .blog-grid-3 { grid-template-columns: 1fr; }

  /* Hero text */
  .hero-title { font-size: 1.65rem; }
  .hero-subtitle { font-size: .9rem; }
  .hero-cta-group .btn { padding: 11px 20px; font-size: .88rem; }
  .hero-stats { gap: 20px; }
  .hero-stat strong { font-size: 1.2rem; }

  /* Trust → 1-col */
  .trust-grid { grid-template-columns: 1fr 1fr; }

  /* Section padding */
  .section-block { padding: 40px 0; }

  /* Card sizes */
  .card-image-wrap { aspect-ratio: 1 / 1; }
  .card-body { padding: 12px; }
  .card-title { font-size: .88rem; }
  .price-current { font-size: 1.1rem; }

  /* Newsletter */
  .newsletter-title { font-size: 1.4rem; }
  .newsletter-section { padding: 40px 0; }

  /* Footer */
  .footer-main { padding: 40px 0 24px; }
}

@media (max-width: 480px) {
  /* Single-column products */
  .products-grid-4,
  .products-grid-3,
  .featured-grid,
  .trending-grid { grid-template-columns: 1fr; }

  /* Categories 1-col */
  .categories-grid { grid-template-columns: 1fr; }

  /* Trust 2-col stays OK */
  .trust-grid { grid-template-columns: 1fr 1fr; }

  /* Section title */
  .section-title { font-size: 1.25rem; }

  /* Hero */
  .hero-section { padding: 32px 0; }
  .hero-title { font-size: 1.5rem; }
  .hero-cta-group { flex-direction: column; }
  .hero-cta-group .btn { width: 100%; justify-content: center; }

  /* Pagination */
  .page-btn { width: 36px; height: 36px; font-size: .8rem; }

  /* Category chips */
  .cat-chip { font-size: .78rem; padding: 7px 14px; }
}

/* ─── Touch Optimization ─────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets */
  .nav-link { padding: 14px 16px; min-height: 48px; }
  .btn { padding: 13px 24px; }
  .cat-chip { padding: 10px 18px; }
  .dropdown-item { padding: 12px 14px; }
  .card-cta { padding: 13px 16px; }
  .footer-links a { padding: 4px 0; min-height: 40px; }
  .page-btn { width: 44px; height: 44px; }

  /* Remove hover-only transforms on touch */
  .product-card:hover { transform: none; }
  .category-card:hover { transform: none; }
  .blog-card:hover { transform: none; }

  /* Show overlay always on touch */
  .card-overlay { display: none; }
}

/* ─── Print ──────────────────────────────────────────── */
@media print {
  .site-header, .main-nav, .disclaimer-bar, .topbar,
  .newsletter-section, .trust-section, .site-footer,
  .back-to-top, .mobile-overlay { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: underline; }
  .product-card { break-inside: avoid; }
}
