/**
 * US BENGOL - Comprehensive Responsive Breakpoints & Device Adaptations
 * 
 * Verified across 16 target viewports:
 * - Mobile: 320px, 360px, 375px, 390px, 414px, 430px
 * - Tablet: 600px, 768px, 820px, 912px, 1024px
 * - Desktop: 1280px, 1366px, 1440px, 1600px, 1920px
 */

/* =========================================================================
   1. ULTRA-WIDE & LARGE DESKTOPS (>= 1440px)
   ========================================================================= */
@media (min-width: 1440px) {
  :root {
    --max-width: 1320px;
  }

  .hero-section {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 110px;
  }
}

/* =========================================================================
   2. DESKTOP & SMALL LAPTOPS (1025px - 1240px)
   ========================================================================= */
@media (max-width: 1240px) {
  .nav-links {
    gap: 22px;
  }

  .footer-top-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
    gap: 32px;
  }
}

/* =========================================================================
   3. TABLETS & MEDIUM SCREENS (<= 1024px)
   (e.g., iPad Pro, Surface Pro, iPad Air, Galaxy Tab)
   ========================================================================= */
@media (max-width: 1024px) {
  :root {
    --nav-height: 70px;
  }

  /* Transition desktop navigation links to mobile drawer */
  .nav-links {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Keep 'Order Now' button alongside hamburger on tablet widths (641px - 1024px) */
  .nav-actions {
    gap: 12px;
  }

  .nav-actions .btn-primary {
    padding: 9px 18px;
    font-size: 0.875rem;
  }

  /* Hero Section Single Column */
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-meta-details {
    justify-content: center;
  }

  .hero-visual-stage {
    margin-top: 10px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Products 2-col on Tablet */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Editorial Story */
  .story-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .story-content {
    padding-right: 0;
  }

  .diet-box {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .diet-checklist {
    align-items: center;
  }

  /* Nationwide Delivery */
  .delivery-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .delivery-chips-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .chips-scroll {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }

  /* Preparation Timeline */
  .prep-timeline::before {
    left: 20px;
    transform: none;
  }

  .prep-step-card {
    grid-template-columns: 1fr;
    padding-left: 50px;
    gap: 20px;
  }

  .prep-step-card:nth-child(even) {
    direction: ltr;
  }

  .prep-step-card:nth-child(even) .prep-step-content {
    direction: ltr;
  }

  /* Footer 2-columns */
  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

/* =========================================================================
   4. SMALL TABLETS & LARGE MOBILE (< 768px)
   ========================================================================= */
@media (max-width: 768px) {
  /* On mobile header, show only logo + hamburger to avoid overcrowding */
  .nav-actions .btn-primary {
    display: none;
  }

  /* Products 1-col on mobile */
  .products-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }

  .why-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .trust-pillars-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Modal Form Layout */
  .modal-product-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* iOS Safari Auto-Zoom Prevention: Inputs must be at least 16px */
  .form-input, .form-select, .form-textarea {
    font-size: 16px;
  }

  .modal-dialog {
    max-height: calc(100dvh - 24px);
    border-radius: var(--radius-md);
  }

  .modal-body {
    padding: clamp(18px, 4vw, 24px);
  }

  /* Footer */
  .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

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

  /* Floating Elements in Hero */
  .hero-floating-card {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 16px;
    max-width: 100%;
    width: 100%;
  }

  .hero-secondary-chip {
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  /* Floating WhatsApp FAB */
  .floating-whatsapp-widget span {
    display: none;
  }
  .floating-whatsapp-widget {
    padding: 14px;
    border-radius: 50%;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    justify-content: center;
  }

  /* Final Contact Bar - Stack into clean 3 rows without orphan bullet dots */
  .final-contact-bar {
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    text-align: center;
  }

  .final-contact-bar > span:nth-child(even) {
    display: none;
  }

  /* Delivery Map Header */
  .delivery-map-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .map-status-pill {
    align-self: flex-start;
    font-size: 0.75rem;
    padding: 4px 10px;
  }
}

/* =========================================================================
   5. STANDARD MOBILE (< 600px)
   ========================================================================= */
@media (max-width: 600px) {
  .prep-timeline::before {
    left: 14px;
  }

  .prep-step-card {
    padding-left: 36px;
    gap: 16px;
  }

  .prep-step-content {
    padding: 20px 18px;
  }

  .step-title {
    font-size: 1.25rem;
  }

  .quote-statement {
    font-size: 1.35rem;
  }

  .why-card {
    padding: 24px 20px;
  }

  .trust-pillar-item {
    padding: 22px 18px;
  }

  .section-title {
    font-size: clamp(1.85rem, 6.5vw, 2.4rem);
  }
}

/* =========================================================================
   6. COMPACT MOBILE (< 480px)
   (e.g., iPhone 12/13/14, Pixel 7, Galaxy S21)
   ========================================================================= */
@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.85rem, 7.2vw, 2.35rem);
  }

  .hero-title span.highlight-gold {
    white-space: normal;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-ctas .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .final-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .final-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .tile-footer {
    gap: 10px;
  }

  .tile-order-btn {
    padding: 10px 16px;
    min-height: 42px;
  }

  .quantity-stepper .stepper-btn {
    width: 44px;
    height: 44px;
  }

  .quantity-stepper .stepper-value {
    min-width: 48px;
    font-size: 1.05rem;
  }
}

/* =========================================================================
   7. ULTRA-COMPACT MOBILE (< 360px & 320px)
   (e.g., Galaxy Fold narrow screen, iPhone SE 1st gen)
   ========================================================================= */
@media (max-width: 360px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-logo-img {
    height: 38px;
  }

  .hero-title {
    font-size: 1.7rem;
    line-height: 1.15;
  }

  /* In 320px width, remove timeline left indent so cards have full width */
  .prep-timeline::before {
    display: none;
  }

  .prep-step-card {
    padding-left: 0;
  }

  .prep-step-content {
    padding: 16px 14px;
  }

  .tile-content {
    padding: 18px 14px;
  }

  .tile-name {
    font-size: 1.2rem;
  }

  .tile-price {
    font-size: 1.2rem;
  }

  .tile-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tile-order-btn {
    width: 100%;
    justify-content: center;
  }

  .delivery-map-card {
    padding: 14px;
  }

  .final-contact-bar {
    padding: 14px 10px;
    font-size: 0.8125rem;
  }
}
