/* ============================================
   DIARIOLAPALABRA - RESPONSIVE CSS
   All breakpoints: 320px → 4K
   ============================================ */

/* ============================================
   MOBILE FIRST: Base styles apply to 320px+
   ============================================ */

/* ============================================
   480px – Small Phones
   ============================================ */
@media (max-width: 480px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .btn-order-nav { display: none; }

  .hero h1 { font-size: clamp(26px, 7vw, 36px); }
  .hero p { font-size: 14px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  .trust-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
  }

  .trust-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
  }

  .pizza-carousel { padding: 0 16px 8px; }
  .pizza-card { width: min(260px, 80vw); }

  .promo-inner { flex-direction: column; text-align: center; }
  .promo-cta { text-align: center; }
  .promo-cards { justify-content: center; }
  .promo-card { min-width: calc(50vw - 20px); }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-legal { justify-content: center; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }

  .newsletter-form {
    flex-direction: column;
    border-radius: var(--radius-lg);
    box-shadow: none;
    gap: 10px;
  }

  .newsletter-form input {
    border-radius: var(--radius-full);
    border-right: 2px solid var(--gray-200);
    text-align: center;
  }

  .newsletter-form button {
    border-radius: var(--radius-full);
    padding: 14px 24px;
  }

  .order-steps {
    gap: 0;
    width: 100%;
  }

  .step-label { display: none; }
  .step-divider { width: 20px; }

  .search-bar { flex-direction: column; }
  .search-bar input, .search-bar button { width: 100%; border-radius: var(--radius-full); }

  .page-hero h1 { font-size: clamp(24px, 7vw, 32px); }

  #cart-sidebar { width: 100vw; }

  .delivery-toggle { max-width: 100%; }

  .faq-question { font-size: 14px; }
}

/* ============================================
   481px – 767px (Larger Phones, Small Tablets)
   ============================================ */
@media (min-width: 481px) and (max-width: 767px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .btn-order-nav { display: none; }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-brand { grid-column: 1 / -1; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }

  .pizza-card { width: min(280px, 75vw); }
  .promo-inner { flex-direction: column; }
  .promo-cta { text-align: left; }
}

/* ============================================
   768px – 1023px (Tablets)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .hamburger { display: flex; }
  .nav-links { display: none; }
  .btn-order-nav { display: none; }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .footer-brand { grid-column: 1 / -1; }

  .hero { min-height: clamp(500px, 70vw, 700px); }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .account-layout {
    grid-template-columns: 220px 1fr;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   820px – iPad Air/Pro landscape detection
   ============================================ */
@media (min-width: 820px) and (max-width: 1023px) {
  .footer-main {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .footer-brand { grid-column: 1; }

  .about-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   1024px+ (Laptops & Desktops)
   ============================================ */
@media (min-width: 1024px) {
  .hamburger { display: none !important; }
  .nav-links { display: flex; }
  .btn-order-nav { display: flex; }

  .footer-main {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .about-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr 1.5fr; }
  .account-layout { grid-template-columns: 260px 1fr; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   1280px (Standard Laptops)
   ============================================ */
@media (min-width: 1280px) {
  .menu-grid { grid-template-columns: repeat(4, 1fr); }
  .team-grid { grid-template-columns: repeat(4, 1fr); }
  .reviews-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   1440px+ (Large Desktops)
   ============================================ */
@media (min-width: 1440px) {
  :root { --nav-height: 78px; }

  .pizza-card { width: 300px; }
  .hero { min-height: 85vh; }

  .menu-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   1920px+ (Full HD Wide)
   ============================================ */
@media (min-width: 1920px) {
  :root {
    --nav-height: 80px;
  }

  .section-inner,
  .nav-container,
  .hero-content,
  .trust-bar-inner,
  .promo-inner,
  .newsletter-inner,
  .footer-main,
  .footer-bottom {
    max-width: 1600px;
  }

  .pizza-carousel { padding: 0 calc((100vw - 1600px) / 2 + 48px) 8px; }

  html { font-size: 17px; }

  .menu-grid { grid-template-columns: repeat(5, 1fr); }
  .location-grid { grid-template-columns: repeat(4, 1fr); }
  .reviews-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   2560px+ (2K / QHD)
   ============================================ */
@media (min-width: 2560px) {
  html { font-size: 18px; }

  :root {
    --nav-height: 84px;
  }

  .section-inner,
  .nav-container,
  .hero-content,
  .trust-bar-inner,
  .promo-inner,
  .newsletter-inner,
  .footer-main,
  .footer-bottom {
    max-width: 1800px;
  }

  .pizza-carousel { padding: 0 calc((100vw - 1800px) / 2 + 64px) 8px; }

  .menu-grid { grid-template-columns: repeat(6, 1fr); }
  .location-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ============================================
   3840px+ (4K / UHD)
   ============================================ */
@media (min-width: 3840px) {
  html { font-size: 22px; }

  :root {
    --nav-height: 96px;
  }

  .section-inner,
  .nav-container,
  .hero-content,
  .trust-bar-inner,
  .promo-inner,
  .newsletter-inner,
  .footer-main,
  .footer-bottom {
    max-width: 2400px;
  }

  .pizza-carousel { padding: 0 calc((100vw - 2400px) / 2 + 80px) 8px; }

  .nav-logo { font-size: 28px; }
  .nav-logo .logo-icon { width: 48px; height: 48px; font-size: 24px; }

  .trust-icon { font-size: 44px; }

  .menu-grid { grid-template-columns: repeat(6, 1fr); }
  .location-grid { grid-template-columns: repeat(6, 1fr); }
  .pizza-card { width: 360px; }

  .btn { padding: 18px 36px; font-size: 18px; }
  .btn-lg { padding: 22px 48px; font-size: 20px; }

  #scroll-top { width: 64px; height: 64px; font-size: 28px; bottom: 48px; right: 48px; }
  .chat-btn { width: 72px; height: 72px; font-size: 32px; }
  #live-chat { bottom: 140px; right: 48px; }
}

/* ============================================
   ULTRA-WIDE: 2560×1080 (21:9)
   ============================================ */
@media (min-width: 2560px) and (max-height: 1200px) {
  .hero { min-height: 100vh; }
  .hero-bg { background-attachment: fixed; }

  .section-inner,
  .nav-container,
  .hero-content {
    max-width: 2200px;
  }
}

/* ============================================
   SUPER ULTRA-WIDE: 3440×1440 (34")
   ============================================ */
@media (min-width: 3440px) {
  html { font-size: 20px; }

  .section-inner,
  .nav-container,
  .hero-content,
  .footer-main {
    max-width: 2800px;
  }

  .menu-grid { grid-template-columns: repeat(7, 1fr); }
}

/* ============================================
   iOS SAFE AREA SUPPORT
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--nav-height) + env(safe-area-inset-top));
  }

  .page-wrapper {
    padding-top: calc(var(--nav-height) + env(safe-area-inset-top));
  }

  .mobile-menu {
    top: calc(var(--nav-height) + env(safe-area-inset-top));
  }

  footer {
    padding-bottom: env(safe-area-inset-bottom);
  }

  #scroll-top {
    bottom: calc(32px + env(safe-area-inset-bottom));
    right: calc(24px + env(safe-area-inset-right));
  }

  #live-chat {
    bottom: calc(96px + env(safe-area-inset-bottom));
    right: calc(24px + env(safe-area-inset-right));
  }

  #cookie-banner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }

  .menu-filter-bar {
    padding-left: calc(max(16px, env(safe-area-inset-left)));
    padding-right: calc(max(16px, env(safe-area-inset-right)));
  }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-bg {
    background-image: var(--hero-bg-hd, var(--hero-bg));
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar, #scroll-top, #live-chat, #cookie-banner,
  #cart-overlay, #cart-sidebar, .newsletter-section { display: none !important; }
  .page-wrapper { padding-top: 0; }
  body { font-size: 12pt; }
  a { text-decoration: none; color: black; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================
   DARK MODE (Optional / System)
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Intentionally not enabling full dark mode as per design spec */
  /* Brand stays consistent with light theme */
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 900px) and (orientation: landscape) {
  .hero { min-height: 100vw; }
  .hero h1 { font-size: clamp(22px, 5vw, 32px); }
  .hero p { font-size: 13px; margin-bottom: 20px; }
  .hero-cta .btn { padding: 12px 22px; font-size: 14px; }
  :root { --nav-height: 60px; }
}

/* ============================================
   GALAXY Z FOLD 5 - Folded (344px)
   ============================================ */
@media (max-width: 344px) {
  body { font-size: 13px; }
  .hero h1 { font-size: 22px; }
  .pizza-card { width: calc(100vw - 32px); }
  .nav-container { padding: 0 12px; }
  .trust-bar-inner { grid-template-columns: 1fr; }
  .section-inner { padding: 0 12px; }
  .btn { padding: 12px 20px; font-size: 13px; }
}

/* ============================================
   SAMSUNG GALAXY Z FOLD 5 - Unfolded (882px)
   ============================================ */
@media (min-width: 882px) and (max-width: 882px) {
  .hamburger { display: none !important; }
  .nav-links { display: flex; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   FORCE NO HORIZONTAL SCROLL - Universal
   ============================================ */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

.pizza-carousel-wrap {
  max-width: 100vw;
}

/* Prevent overflow from any child */
section, div, main, header, footer {
  max-width: 100%;
}
