/* ================================================================
   Shivara Premium Exports — Responsive/Mobile improvements
   Applied on top of each page's existing inline styles.
   ================================================================ */

/* Prevent any element from causing horizontal scroll */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

body.mobile-menu-active {
  overflow: hidden;
}

/* Better tap targets on touch devices */
@media (hover: none) and (pointer: coarse) {
  a, button, .btn, .product-action, .hero-dot {
    -webkit-tap-highlight-color: rgba(0, 107, 60, 0.12);
  }
  .btn { min-height: 48px; }
}

.mobile-menu-toggle {
  position: relative;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 42px;
  gap: 9px;
  border: 1px solid rgba(208, 167, 57, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, #073f2b, #006b3c);
  color: #fffaf0;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 62, 34, 0.18);
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  pointer-events: auto;
  touch-action: manipulation;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
  background: linear-gradient(135deg, #004d2d, #073f2b);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(0, 62, 34, 0.26);
  outline: none;
}

.mobile-menu-toggle .menu-label {
  display: block;
  width: auto;
  height: auto;
  background: transparent;
  color: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.mobile-menu-toggle .menu-dots {
  display: grid;
  width: auto;
  height: 20px;
  place-items: center;
  gap: 3px;
  background: transparent;
}

.mobile-menu-toggle .menu-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #d0a739;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav.mobile-menu-open .mobile-menu-toggle .menu-dots i:nth-child(1) {
  transform: translateY(7px) scaleX(2.2) rotate(45deg);
}

.nav.mobile-menu-open .mobile-menu-toggle .menu-dots i:nth-child(2) {
  opacity: 0;
}

.nav.mobile-menu-open .mobile-menu-toggle .menu-dots i:nth-child(3) {
  transform: translateY(-7px) scaleX(2.2) rotate(-45deg);
}

.mobile-quote-link {
  display: none;
}

/* Nav switches to drawer mode at the same width where desktop links are hidden */
@media (max-width: 1120px) {
  .topbar { display: none; }
  .nav { min-height: 68px; }
  .nav .wrap { position: relative; z-index: 100; }
  .nav-links { display: none !important; }
  .mobile-menu-toggle { display: inline-flex; }
  .nav-actions { position: relative; z-index: 130; }
  .nav-actions .whatsapp,
  .nav-actions .btn { display: none !important; }
  .nav.mobile-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background:
      radial-gradient(circle at 80% 12%, rgba(208, 167, 57, 0.24), transparent 28%),
      rgba(3, 33, 21, 0.52);
    backdrop-filter: blur(5px);
  }
  .nav.mobile-menu-open .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 70;
    display: flex !important;
    width: min(84vw, 336px);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 92px 20px 24px;
    border-left: 1px solid rgba(208, 167, 57, 0.32);
    border-radius: 26px 0 0 26px;
    background:
      linear-gradient(160deg, rgba(255, 250, 240, 0.98), rgba(244, 235, 210, 0.98)),
      radial-gradient(circle at 90% 0%, rgba(208, 167, 57, 0.3), transparent 36%);
    box-shadow: -24px 0 70px rgba(3, 33, 21, 0.32);
    overflow-y: auto;
    animation: shivara-drawer-in 220ms ease-out both;
  }
  .nav.mobile-menu-open .nav-links::before {
    content: "SHIVARA MENU";
    display: block;
    margin-bottom: 6px;
    color: #d0a739;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
  }
  .nav.mobile-menu-open .nav-links::after {
    content: "Premium rice exports";
    display: block;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(7, 63, 43, 0.12);
    color: #6b655c;
    font-size: 12px;
    font-style: italic;
  }
  .nav.mobile-menu-open .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid rgba(7, 63, 43, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    color: #073f2b;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 24px rgba(70, 56, 23, 0.06);
    transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
  }
  .nav.mobile-menu-open .nav-links a::after {
    content: "›";
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f5eedb;
    color: #006b3c;
    font-size: 18px;
    line-height: 1;
  }
  .nav.mobile-menu-open .nav-links .mobile-quote-link {
    display: flex;
    background: linear-gradient(135deg, #006b3c, #073f2b);
    color: #fff;
    border-color: rgba(208, 167, 57, 0.35);
    box-shadow: 0 16px 34px rgba(0, 107, 60, 0.22);
  }
  .nav.mobile-menu-open .nav-links .mobile-quote-link::after {
    background: #d0a739;
    color: #073f2b;
  }
  .nav.mobile-menu-open .nav-links a:hover,
  .nav.mobile-menu-open .nav-links a:focus-visible {
    background: #006b3c;
    color: #fff;
    border-color: rgba(208, 167, 57, 0.46);
    transform: translateX(-3px);
    outline: none;
  }
  .nav.mobile-menu-open .nav-links a:hover::after,
  .nav.mobile-menu-open .nav-links a:focus-visible::after {
    background: #d0a739;
    color: #073f2b;
  }
}

/* --------------------------------------------------------------
   Tablet & small-desktop tweaks (<= 1120px)
   -------------------------------------------------------------- */
@media (max-width: 1120px) {
  .wrap { width: min(1280px, calc(100% - 32px)); }
  .hero { min-height: auto; padding-top: 118px; padding-bottom: 40px; }
  .hero-inner { min-height: auto; }
  .hero-copy {
    margin-left: 0 !important;
    max-width: 100% !important;
    padding: clamp(20px, 3vw, 32px);
  }
  .product-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 30px 24px !important; }
  .full-product-grid,
  .product-teaser-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 30px 24px !important; }
  .cert-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 22px !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .story-grid, .contact-page-grid, .founder-profile { grid-template-columns: 1fr !important; }
}

/* --------------------------------------------------------------
   Small tablets & large phones (<= 860px)
   -------------------------------------------------------------- */
@media (max-width: 860px) {
  .wrap { width: min(1280px, calc(100% - 28px)); }

  /* Nav */
  .topbar { display: none; }
  .nav { min-height: 68px; }
  .nav .wrap { position: relative; z-index: 100; }
  .nav-links { display: none !important; }
  .mobile-menu-toggle { display: inline-flex; }
  .nav-actions .btn { display: none !important; }
  .nav.mobile-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background:
      radial-gradient(circle at 80% 12%, rgba(208, 167, 57, 0.24), transparent 28%),
      rgba(3, 33, 21, 0.52);
    backdrop-filter: blur(5px);
  }
  .nav.mobile-menu-open .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 70;
    display: flex !important;
    width: min(84vw, 336px);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 92px 20px 24px;
    border-left: 1px solid rgba(208, 167, 57, 0.32);
    border-radius: 26px 0 0 26px;
    background:
      linear-gradient(160deg, rgba(255, 250, 240, 0.98), rgba(244, 235, 210, 0.98)),
      radial-gradient(circle at 90% 0%, rgba(208, 167, 57, 0.3), transparent 36%);
    box-shadow: -24px 0 70px rgba(3, 33, 21, 0.32);
    overflow-y: auto;
    animation: shivara-drawer-in 220ms ease-out both;
  }
  .nav.mobile-menu-open .nav-links::before {
    content: "SHIVARA MENU";
    display: block;
    margin-bottom: 6px;
    color: #d0a739;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
  }
  .nav.mobile-menu-open .nav-links::after {
    content: "Premium rice exports";
    display: block;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(7, 63, 43, 0.12);
    color: #6b655c;
    font-size: 12px;
    font-style: italic;
  }
  .nav.mobile-menu-open .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid rgba(7, 63, 43, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    color: #073f2b;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 24px rgba(70, 56, 23, 0.06);
    transition: background 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
  }
  .nav.mobile-menu-open .nav-links a::after {
    content: "›";
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f5eedb;
    color: #006b3c;
    font-size: 18px;
    line-height: 1;
  }
  .nav.mobile-menu-open .nav-links .mobile-quote-link {
    display: flex;
    background: linear-gradient(135deg, #006b3c, #073f2b);
    color: #fff;
    border-color: rgba(208, 167, 57, 0.35);
    box-shadow: 0 16px 34px rgba(0, 107, 60, 0.22);
  }
  .nav.mobile-menu-open .nav-links .mobile-quote-link::after {
    background: #d0a739;
    color: #073f2b;
  }
  .nav.mobile-menu-open .nav-links a:hover,
  .nav.mobile-menu-open .nav-links a:focus-visible {
    background: #006b3c;
    color: #fff;
    border-color: rgba(208, 167, 57, 0.46);
    transform: translateX(-3px);
    outline: none;
  }
  .nav.mobile-menu-open .nav-links a:hover::after,
  .nav.mobile-menu-open .nav-links a:focus-visible::after {
    background: #d0a739;
    color: #073f2b;
  }
  .logo-title { font-size: 20px !important; letter-spacing: 0.08em; }
  .logo-mark { width: 44px !important; height: 44px !important; }
  .logo-subline { flex-wrap: wrap; gap: 4px !important; white-space: normal !important; }
  .logo-sub { font-size: 9px !important; letter-spacing: 0.18em; }
  .logo-tag { font-size: 8px !important; }
  .nav-actions { gap: 10px; }
  .nav-actions .whatsapp { display: none; }
  .nav-actions .btn {
    padding: 0 14px;
    font-size: 11px;
    min-height: 40px;
  }

  /* Hero */
  .hero { padding-top: 92px; min-height: auto; }
  .hero-inner { grid-template-columns: 1fr !important; min-height: auto; }
  .hero-copy {
    margin-top: 20px !important;
    padding: 22px !important;
    border-radius: 22px !important;
  }
  .hero-kicker { font-size: clamp(26px, 7vw, 36px) !important; }
  .hero h1 {
    font-size: clamp(38px, 10vw, 60px) !important;
    line-height: 1 !important;
    max-width: 100% !important;
  }
  .hero-text {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
    margin-top: 18px !important;
  }
  .hero-actions { gap: 12px; margin-top: 24px; }
  .hero-actions .btn { flex: 1 1 auto; padding: 0 16px; font-size: 12px; }
  .hero-dots { margin-top: 22px; }
  .hero-visual { display: none !important; }

  /* Section spacing */
  section { padding-left: 0; padding-right: 0; }
  .products { padding: 70px 0 40px; }
  .section-title { font-size: clamp(26px, 6vw, 34px) !important; }

  /* Home products heading swap: keep "Our Products" dominant and
     "Premium Quality Rice" as the smaller supporting line. */
  #products-preview .label { font-size: clamp(26px, 6.4vw, 34px) !important; }
  #products-preview .section-title { font-size: clamp(14px, 3.4vw, 16px) !important; }

  /* Grids collapse */
  .stats-box,
  .product-grid,
  .full-product-grid,
  .product-teaser-grid,
  .cert-grid,
  .why-list,
  .quote-form,
  .news-grid,
  .panel-grid,
  .sustain-grid,
  .quote-grid,
  .footer-grid,
  .story-grid,
  .contact-page-grid,
  .founder-profile,
  .founder-meta,
  .info-strip,
  .sustain-items { grid-template-columns: 1fr !important; }

  .product-grid,
  .full-product-grid,
  .product-teaser-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 22px 16px !important; }
  .cert-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 18px !important; }

  /* Stats card */
  .stats { margin-top: -30px !important; }
  .stats-box { border-radius: 20px !important; }
  .stat { padding: 20px 20px !important; }
  .stat, .stat + .stat { border-left: 0 !important; border-top: 1px solid #e7e2d7; }
  .stat:first-child { border-top: 0; }
  .stat strong { font-size: 28px !important; }

  /* Panels */
  .panel { min-height: auto !important; padding: 32px 22px !important; }
  .panel + .panel { border-left: 0 !important; border-top: 1px solid #ded7c8; }
  .panel h2 { font-size: 26px !important; }
  .rice-strand, .rice-stem { width: 150px !important; height: 220px !important; opacity: 0.35 !important; }
  .years { width: 96px !important; height: 96px !important; right: 20px !important; bottom: 20px !important; }
  .years strong { font-size: 24px !important; }

  /* Certifications */
  .cert-box { padding: 22px 20px 24px !important; }
  .cert { font-size: 26px !important; }

  /* Sustainability */
  .sustainability { padding: 70px 0 44px !important; }
  .sustainability h2 { font-size: 26px !important; }
  .why-list li { font-size: 16px !important; padding: 14px 16px 14px 42px !important; }

  /* Quote / form */
  .quote { padding: 44px 0 !important; }
  .quote h2 { font-size: 30px !important; }
  .quote-form { padding: 22px !important; gap: 14px !important; }
  .quote-form input, .quote-form select { height: 44px; }

  /* News */
  .news-head { display: block !important; }
  .news-head .btn { margin-top: 16px; }
  .news-card { grid-template-columns: 1fr !important; }

  /* Product cards */
  .product-card { aspect-ratio: 4 / 5; }
  .product-card h3 { font-size: 15px !important; }

  /* Footer */
  .footer { padding: 40px 0 0 !important; }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding-bottom: 30px !important;
  }
  .footer-products-list { grid-template-columns: 1fr !important; }
  .footer-products-list li { white-space: normal !important; }
  .footer p { max-width: 100% !important; }
  .footer-bottom {
    align-items: flex-start !important;
    flex-direction: column !important;
    text-align: left;
    gap: 8px !important;
  }

  /* Floating buttons: keep on-screen */
  .floating-whatsapp { right: 76px; width: 46px; height: 46px; bottom: 18px; }
  .floating-whatsapp svg { width: 24px; height: 24px; }
  .back-top { right: 18px; width: 46px; height: 46px; bottom: 18px; }
}

/* --------------------------------------------------------------
   Small phones (<= 480px)
   -------------------------------------------------------------- */
@media (max-width: 480px) {
  .wrap { width: min(1280px, calc(100% - 24px)); }

  /* Compact header */
  .nav { min-height: 60px; }
  .mobile-menu-toggle {
    min-width: 44px;
    width: 44px;
    height: 38px;
    gap: 0;
  }
  .mobile-menu-toggle .menu-label { display: none; }
  .logo-title { font-size: 17px !important; }
  .logo-mark { width: 38px !important; height: 38px !important; }
  .logo-sub { font-size: 8px !important; }
  .logo-tag { display: none !important; }
  .nav-actions .btn {
    padding: 0 12px;
    font-size: 10px;
    min-height: 38px;
    gap: 8px;
  }
  .nav-actions .btn .circle { width: 18px; height: 18px; }
  .nav.mobile-menu-open .nav-links {
    width: min(88vw, 318px);
    padding: 82px 16px 20px;
    border-radius: 22px 0 0 22px;
  }

  /* Hero */
  .hero { padding-top: 82px; }
  .hero-copy { padding: 18px !important; border-radius: 18px !important; }
  .hero-kicker { font-size: clamp(22px, 8vw, 30px) !important; }
  .hero h1 { font-size: clamp(30px, 11vw, 44px) !important; }
  .hero-text { font-size: 14px !important; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-dot { width: 24px; }
  .hero-dot.active { width: 40px; }

  /* Single-column product grid on very small screens */
  .product-grid,
  .full-product-grid,
  .product-teaser-grid { grid-template-columns: 1fr !important; gap: 18px !important; }
  .product-card { aspect-ratio: 16 / 10; }

  /* Certs single col */
  .cert-grid { grid-template-columns: 1fr !important; }
  .cert { font-size: 24px !important; }

  /* Section titles */
  .section-title { font-size: clamp(22px, 7vw, 28px) !important; }
  #products-preview .label { font-size: clamp(22px, 7.2vw, 28px) !important; }
  #products-preview .section-title { font-size: clamp(13px, 3.6vw, 15px) !important; }

  /* Panel headings */
  .panel h2 { font-size: 22px !important; }
  .panel { padding: 26px 18px !important; }
  .rice-strand, .rice-stem { display: none !important; }
  .years { position: static !important; margin-top: 20px; }

  /* Sustainability list */
  .why-list li { font-size: 15px !important; }

  /* Quote form single field per row */
  .quote-form { padding: 18px !important; }
  .form-actions .btn { width: 100%; }

  /* Floating buttons stack */
  .floating-whatsapp { right: 66px; width: 44px; height: 44px; }
  .back-top { width: 44px; height: 44px; }
}

/* --------------------------------------------------------------
   Landscape phones — reduce vertical padding
   -------------------------------------------------------------- */
@media (max-width: 900px) and (orientation: landscape) {
  .hero { padding-top: 78px; }
  .hero-copy { margin-top: 12px !important; }
}

/* --------------------------------------------------------------
   Ensure fixed floating actions don't overlap content on tiny screens
   -------------------------------------------------------------- */
@media (max-width: 380px) {
  .logo-subline { display: none !important; }
  .nav-actions .btn { font-size: 9px; }
}

@keyframes shivara-drawer-in {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
