/* ==========================================================================
   THAR PATEL FOODS - Comprehensive Responsive Stylesheet
   Supports: 320px, 360px, 375px, 390px, 414px, 480px, 768px, 1024px, 1366px, 1920px
   Defeats all inline grid locks and guarantees zero horizontal overflow
   ========================================================================== */

/* Large screens and desktop containment */
@media (min-width: 1366px) {
  .container {
    max-width: 1240px;
  }
}

/* Tablet & Landscape Devices (max-width: 1024px) */
@media (max-width: 1024px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 32px !important;
  }

  /* Defeat inline grid template styles on split layouts */
  [style*="grid-template-columns: 1fr 1.15fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* Tablets and Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Header adjustments */
  .desktop-nav {
    display: none !important;
  }

  .hamburger-btn {
    display: block !important;
  }

  .site-header {
    height: 74px;
  }

  .header-inner {
    height: 74px;
  }

  .brand-emblem-wrap {
    width: 48px;
    height: 48px;
  }

  .brand-name {
    font-size: 1.18rem;
  }

  .brand-tagline-sub {
    font-size: 0.6rem;
  }

  /* Hero Section */
  .hero-section {
    padding: 50px 0 65px;
  }

  .hero-title {
    font-size: 2.15rem !important;
    line-height: 1.2 !important;
  }

  .hero-tagline {
    font-size: 1.1rem !important;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .hero-card-img-wrap {
    height: 280px !important;
  }

  .trust-metrics-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  /* OVERRIDE ALL INLINE GRIDS ON MOBILE TO SINGLE COLUMN */
  div[style*="grid-template-columns"],
  section[style*="grid-template-columns"],
  [style*="grid-template-columns: 1fr 1.15fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"],
  [style*="grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Product detail layout single column */
  .section-py.product-card .container > div {
    width: 100% !important;
  }

  .section-py.product-card img {
    height: auto !important;
    max-height: 340px !important;
    object-fit: contain !important;
  }

  .products-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .product-img-wrap {
    height: 230px !important;
  }

  /* Cart Drawer Fullscreen on Mobile */
  .cart-drawer {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Footer Stack */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
  }

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

/* Small Android phones & iPhones (max-width: 480px, 414px, 390px, 375px, 360px, 320px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem !important;
  }

  .section-main-title {
    font-size: 1.85rem !important;
  }

  .trust-metrics-strip {
    grid-template-columns: 1fr !important;
  }

  .hero-cta-group {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .hero-cta-group .btn {
    width: 100% !important;
  }

  .hero-mini-badges {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .size-pills-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .size-pill {
    padding: 6px 4px !important;
    font-size: 0.72rem !important;
  }

  .checkout-modal-card {
    width: 95% !important;
    padding: 10px !important;
  }

  .floating-whatsapp-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.6rem !important;
    bottom: 18px !important;
    right: 18px !important;
  }
}

@media (max-width: 360px) {
  .hero-title {
    font-size: 1.6rem !important;
  }
  .brand-name {
    font-size: 1.05rem !important;
  }
}

/* Checkout Modal Styles */
.checkout-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(13, 51, 96, 0.72);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.checkout-modal.active {
  opacity: 1;
  visibility: visible;
}

.checkout-modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  width: 92%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  border: 2px solid var(--desert-sand);
}

.checkout-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--desert-sand);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--desert-ivory);
}
