/* ==========================================================================
   Smart Functional Foods Pvt. Ltd. - Responsive Master Stylesheet
   Optimized for 360px, 375px, 390px, 480px, 768px, 992px, 1200px+
   Tested for zero layout shifts, zero overlapping, and 100% mobile perfection.
   ========================================================================== */

/* 1024px - Large Tablets & Small Laptops */
@media (max-width: 1024px) {
  .hero-slide-content h1 {
    font-size: 2.6rem;
  }

  .trust-bar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .product-gallery {
    position: static;
    max-width: 580px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
  }
}

/* 992px - Medium Tablets (Switch to Mobile Drawer Navigation) */
@media (max-width: 992px) {
  .main-nav.desktop-only {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
  }

  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* 768px - Tablets & Mobile Viewports */
@media (max-width: 768px) {
  :root {
    --header-height: 68px;
    --topbar-height: auto;
  }

  /* Clean Single-Line Mobile Topbar */
  .site-topbar {
    padding: 0.35rem 0;
    font-size: 0.78rem;
    background: linear-gradient(90deg, var(--primary-950) 0%, var(--primary-900) 100%);
    border-bottom: 2px solid var(--accent-500);
  }

  .topbar-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
  }

  .topbar-address {
    display: none !important;
  }

  .topbar-badge {
    display: none !important;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }

  .topbar-item a {
    font-size: 0.78rem;
  }

  /* Mobile Header */
  .header-inner {
    height: var(--header-height);
  }

  .site-logo-img {
    height: 44px;
    max-width: 195px;
  }

  .header-actions {
    gap: 0.65rem;
  }

  .header-actions .btn-sm {
    padding: 0.42rem 0.85rem;
    font-size: 0.8125rem;
  }

  /* Typography */
  .section {
    padding: 3.5rem 0;
  }

  .section-sm {
    padding: 2.5rem 0;
  }

  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.3rem; }

  /* Hero Slider on Mobile */
  .hero-slider-container {
    min-height: 520px;
  }

  .hero-slide {
    min-height: 520px;
  }

  .hero-slide-content {
    padding: 3.5rem 0 5rem 0;
  }

  .hero-slide-content h1 {
    font-size: 2.1rem;
    line-height: 1.25;
    margin-bottom: 1rem;
  }

  .hero-slide-content .hero-lead {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.85rem;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .hero-slider-arrow {
    width: 40px;
    height: 40px;
  }

  .hero-slider-arrow.arrow-prev {
    left: 0.75rem;
  }

  .hero-slider-arrow.arrow-next {
    right: 0.75rem;
  }

  .hero-slider-tabs {
    bottom: 1rem;
    width: 92%;
    padding: 0.35rem 0.5rem;
    justify-content: center;
  }

  .hero-tab-btn {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
  }

  /* Trust Highlights Ribbon */
  .trust-bar {
    padding: 1.35rem 0;
  }

  .trust-bar-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .trust-item {
    gap: 0.85rem;
  }

  /* Workflow 4-Step Grid */
  .workflow-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .workflow-card {
    padding: 1.75rem 1.5rem;
  }

  /* Category Showcase Grid */
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Filter Toolbar */
  .filter-toolbar {
    padding: 1.15rem 1.25rem;
    margin-bottom: 2rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .search-box {
    max-width: 100%;
  }

  .category-pills {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .pill-btn {
    flex-shrink: 0;
  }

  /* Product Grid */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  /* Modal Form */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .modal-container {
    max-height: 94vh;
  }

  .modal-header {
    padding: 1.25rem 1.5rem 1rem 1.5rem;
  }

  .modal-body {
    padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  }

  /* CTA Banner */
  .cta-banner {
    padding: 3rem 1.5rem;
  }

  .cta-banner h2 {
    font-size: 1.9rem;
  }

  /* Footer */
  .site-footer {
    padding-top: 3.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    margin-bottom: 2.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-copyright {
    text-align: center;
  }

  .footer-member-badge {
    justify-content: center;
  }
}

/* 480px and below - Small Phones */
@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.5rem; }

  .site-logo-img {
    height: 38px;
    max-width: 165px;
  }

  .header-actions .btn-sm {
    display: none; /* Hide header Enquiry button on small phones - available in mobile drawer */
  }

  .hero-slide-content h1 {
    font-size: 1.85rem;
  }

  .hero-slide-content .hero-lead {
    font-size: 0.9375rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-trust-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .hero-slider-tabs {
    display: none; /* Hide text tabs on small phones for clean view */
  }

  .hero-slider-arrow {
    display: none; /* Mobile swipe gesture is intuitive */
  }

  .product-actions {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .product-actions .btn {
    width: 100%;
  }

  .cta-banner {
    padding: 2.5rem 1.25rem;
  }

  .cta-banner h2 {
    font-size: 1.65rem;
  }
}

/* 360px & 375px - Ultra compact screens */
@media (max-width: 390px) {
  html {
    font-size: 15px;
  }

  .btn {
    padding: 0.75rem 1.25rem;
  }

  .product-body {
    padding: 1.25rem;
  }

  .topbar-right {
    font-size: 0.72rem;
  }
}
