/* ═══════════════════════════════════════════════════════════
   WATANIA FARMS — Responsive Stylesheet
   Breakpoints:
     xl  : 1200px+
     lg  : 992px – 1199px
     md  : 768px – 991px
     sm  : 576px – 767px
     xs  : 0px – 575px
═══════════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════════
   XL  ≤ 1400px  (prevent nav text wrap on mid-large screens)
══════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {

  #navbar .nav-link {
    font-size: .83rem;
    padding: 6px 11px !important;
  }
}


/* ══════════════════════════════════════════════════════════
   LG  ≤ 1199px
══════════════════════════════════════════════════════════ */
@media (max-width: 1199px) {

  /* Navbar — tighter link spacing */
  #navbar .nav-link {
    font-size: .78rem;
    padding: 6px 9px !important;
  }

  .py-section { padding: 80px 0; }
}


/* ══════════════════════════════════════════════════════════
   MD  ≤ 991px  (tablet / hamburger breakpoint)
══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {

  /* ── Navbar ── */
  #navbar {
    height: auto;
    min-height: 64px;
  }

  /* Mobile collapsed menu panel */
  #navbar .navbar-collapse {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 16px 16px;
    padding: 12px 16px 20px;
    margin: 0 -12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
  }

  /* hero-top state: keep menu white when open on mobile */
  #navbar.hero-top .navbar-collapse {
    background: #0f3320;
    border-top-color: rgba(255,255,255,.1);
  }

  /* Nav links full width */
  #navbar .navbar-nav {
    gap: 2px !important;
    margin: 0 !important;
  }
  #navbar .nav-link {
    font-size: .9rem;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    color: #334155 !important;
    font-weight: 600;
  }
  #navbar.hero-top .nav-link {
    color: rgba(255,255,255,.88) !important;
  }
  #navbar .nav-link:hover,
  #navbar .nav-link.active {
    background: var(--fr-green-50) !important;
    color: var(--fr-green-700) !important;
  }
  #navbar.hero-top .nav-link:hover,
  #navbar.hero-top .nav-link.active {
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
  }

  /* Dropdown on mobile — show inline */
  #navbar .dropdown-menu {
    border: none;
    background: var(--fr-green-50);
    border-radius: 10px;
    padding: 6px 8px;
    margin: 4px 0 4px 12px;
    box-shadow: none;
    border-top: 2px solid var(--fr-green-400);
    animation: none;
  }
  #navbar.hero-top .dropdown-menu {
    background: rgba(255,255,255,.12);
    border-top-color: var(--fr-green-400);
  }
  #navbar .dropdown-item {
    border-radius: 8px;
    font-size: .85rem;
    padding: 9px 12px;
    color: #334155;
    font-weight: 500;
  }
  #navbar .dropdown-item i {
    background: var(--fr-green-50);
    color: var(--fr-green-600);
  }
  #navbar.hero-top .dropdown-item {
    color: rgba(255,255,255,.85);
  }
  #navbar.hero-top .dropdown-item i {
    background: rgba(255,255,255,.15);
    color: #fff;
  }
  #navbar .dropdown-item:hover {
    background: var(--fr-green-100);
    color: var(--fr-green-700);
    padding-left: 14px;
  }

  /* Cart button row on mobile */
  #navbar .d-flex.align-items-center {
    padding: 10px 0 4px;
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
  }
  #navbar.hero-top .d-flex.align-items-center {
    border-top-color: rgba(255,255,255,.1);
  }

  /* Hamburger icon */
  #navbar .navbar-toggler {
    padding: 6px 10px;
  }
  #navbar .navbar-toggler:focus { box-shadow: none; }

  /* ── Hero ── */
  .hero {
    height: auto;
    min-height: 100svh;
    padding: 120px 5vw 48px;
  }
  .hero h1 {
    font-size: clamp(1.7rem, 5vw, 2.8rem);
  }

  /* ── Steps connector hide ── */
  .steps-connector { display: none; }

  /* ── Quality overlay card hide ── */
  .quality-overlay-card { display: none; }

  /* ── Product Catalogue ── */
  .catalogue-table th,
  .catalogue-table td {
    padding: 10px 12px;
    font-size: .8rem;
  }

  /* ── Section padding ── */
  .py-section { padding: 72px 0; }
}


/* ══════════════════════════════════════════════════════════
   SM  ≤ 767px  (large phones / small tablets)
══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── General ── */
  .py-section { padding: 56px 0; }

  /* ── Navbar ── */
  #navbar .navbar-brand img {
    height: 38px;
  }

  /* ── Hero ── */
  .hero {
    padding: 100px 5vw 40px;
  }
  .hero h1 {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    line-height: 1.15;
  }
  .hero p {
    font-size: .88rem;
  }
  .hero .d-flex.gap-3 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .btn-hero-primary,
  .btn-hero-ghost {
    padding: 13px 24px;
    font-size: .875rem;
    justify-content: center;
  }

  /* Stats bar */
  .hero-stats-bar {
    flex-wrap: wrap;
    border-radius: 16px;
  }
  .hero-stat {
    min-width: 50%;
    padding: 16px 12px;
  }
  .hero-stat + .hero-stat::before { display: none; }
  .hero-stat-num {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
  }

  /* ── Section titles ── */
  .section-title {
    font-size: clamp(1.4rem, 5vw, 1.9rem);
  }

  /* ── Who We Are ── */
  #about .row { gap: 20px !important; }

  /* ── Product grid ── */
  #productsGrid .col-sm-6 { width: 50%; }

  /* ── Product card image height ── */
  .product-img-wrap { height: 180px; }

  /* ── Filter tabs ── */
  .d-flex.gap-2.flex-wrap .filter-tab {
    font-size: .75rem;
    padding: 6px 14px;
  }

  /* ── Delivery form ── */
  .delivery-form-wrap { padding: 22px 18px; }
  .time-slots { grid-template-columns: repeat(2, 1fr); }

  /* ── Quality cert cards ── */
  .quality-section .row.g-4 > .col-md-6 { margin-bottom: 4px; }
  /* 5-col cert cards → 2 cols on tablet */
  .quality-section .row.g-4 > .col-lg { flex: 0 0 50%; max-width: 50%; }

  /* ── Catalogue table — hide less critical columns on small screens ── */
  .catalogue-table .hide-sm { display: none; }

  /* ── Newsletter ── */
  .newsletter-section { padding: 56px 0; }
  .newsletter-section h2 { font-size: 1.6rem; }
  .newsletter-section .d-flex {
    flex-direction: column;
    align-items: stretch;
  }
  .newsletter-section .btn-hero-ghost,
  .newsletter-section .btn-newsletter {
    justify-content: center;
  }

  /* ── Footer ── */
  .site-footer { padding-top: 48px; }
  .footer-logo { height: 40px; }
  .footer-logos img { height: 40px; }
  .social-link { width: 34px; height: 34px; font-size: .82rem; }
}


/* ══════════════════════════════════════════════════════════
   XS  ≤ 575px  (phones)
══════════════════════════════════════════════════════════ */
@media (max-width: 575px) {

  /* ── Navbar ── */
  #navbar .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* ── Hero ── */
  .hero {
    padding: 90px 4vw 36px;
    text-align: center;
  }
  .hero h1 {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }
  .hero-badge { font-size: .65rem; }
  .hero-stats-bar { margin-top: 24px; }
  .hero-stat { min-width: 50%; padding: 12px 8px; }
  .hero-stat-num { font-size: 1.3rem; }
  .hero-stat-label { font-size: .62rem; letter-spacing: .5px; }

  /* ── Section padding ── */
  .py-section { padding: 48px 0; }

  /* ── Section tags & titles ── */
  .section-tag { font-size: .68rem; }
  .section-title { font-size: clamp(1.3rem, 6vw, 1.7rem); }

  /* ── Product grid — 1 column on very small ── */
  #productsGrid .col-sm-6 {
    width: 100%;
  }
  .product-img-wrap { height: 200px; }

  /* ── Search bar ── */
  .search-wrap { max-width: 100% !important; }

  /* ── Catalogue table ── */
  .catalogue-table th,
  .catalogue-table td {
    padding: 8px 10px;
    font-size: .75rem;
  }
  .catalogue-table td.sku { font-size: .7rem; }

  /* ── Core focus cards ── */
  #core-focus .col-6 { width: 50%; }
  /* Product focus cards height on mobile */
  .product-focus-card { height: 130px; }

  /* ── Quality section — 5 cert cards → 1 col ── */
  .quality-section .row.g-4 > .col-lg { flex: 0 0 100%; max-width: 100%; }

  /* ── Quality section ── */
  .cert-icon { width: 50px; height: 50px; font-size: 1.2rem; }

  /* ── Delivery features ── */
  .delivery-feature { padding: 14px; gap: 10px; }
  .delivery-feature-icon { width: 40px; height: 40px; font-size: 1rem; }

  /* ── Newsletter ── */
  .newsletter-section { padding: 48px 0; }
  .newsletter-section h2 { font-size: 1.35rem; }

  /* ── Footer ── */
  .site-footer { padding-top: 40px; }
  .footer-col h5 { margin-bottom: 12px; }
  .footer-bottom { font-size: .72rem; padding: 16px 0; }
  .footer-logos { gap: 14px; padding: 20px 0; }
  .footer-logos img { height: 32px; }

  /* ── Marquee ticker ── */
  .marquee-item { padding: 0 18px; font-size: .72rem; }

  /* ── Buttons ── */
  .btn-hero-primary,
  .btn-hero-ghost {
    padding: 12px 20px;
    font-size: .84rem;
  }

  /* ── Step cards ── */
  .step-number { width: 46px; height: 46px; font-size: 1rem; }

  /* ── Catalogue group header ── */
  .catalogue-group-header { font-size: .73rem; padding: 9px 14px; }

  /* ── Shelf badges ── */
  .shelf-badge { font-size: .65rem; padding: 2px 8px; }
}


/* ══════════════════════════════════════════════════════════
   UTILITY — safe area for notched phones
══════════════════════════════════════════════════════════ */
@supports (padding: max(0px)) {
  #navbar .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .hero {
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }
}
