/* responsive.css — Mobile / tablet adaptation for CYAN340 storefront
   Strategy: desktop layout lives in layout.css / components.css.
   Here we reflow grids, add a hamburger nav, scale type, and fix
   tables + modals so the site is comfortable on phones and tablets. */

html, body { -webkit-text-size-adjust: 100%; }

/* Remove the 300ms tap delay and accidental zoom on interactive elements */
a, button, select, input, label { touch-action: manipulation; }

/* Hamburger toggle is hidden on desktop, shown on tablet/phone */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  width: 40px; height: 40px; margin-left: 4px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============ TABLET (<= 900px) ============ */
@media (max-width: 900px) {
  main.view-container { padding: 24px 18px 40px; }

  /* Stack the two-column hero into a single column */
  .hero-commerce-grid { grid-template-columns: 1fr; gap: 24px; }
  .gallery-panel { position: static; margin-bottom: 8px; }

  /* Convert the desktop nav into a dropdown panel toggled by the hamburger */
  .nav-toggle { display: flex; }
  nav.main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 20px rgba(11, 31, 77, 0.10);
    flex-direction: column; align-items: stretch; gap: 0;
    display: none;
  }
  .site-header.nav-open nav.main-nav { display: flex; }
  nav.main-nav a {
    padding: 15px 22px; font-size: 14.5px; border-top: 1px solid var(--border);
  }
  nav.main-nav a:first-child { border-top: none; }
  nav.main-nav a.active { background: #f8fbff; color: var(--electric); }

  /* Footer: 4 columns -> 2 columns */
  .footer-wrap { grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }

  /* Single-column content grids */
  .reviews-timeline-grid,
  .science-pillars,
  .steps-visual-grid,
  .faq-grid,
  .fresh-vs-traditional-section,
  .protocol-cadence-box { grid-template-columns: 1fr; }

  /* Shoppable videos: 4 -> 2 columns on tablet */
  .shoppable-video-grid { grid-template-columns: repeat(2, 1fr); }

  /* Show the mobile sticky buy bar */
  .sticky-bottom-bar { display: flex; }
  body { padding-bottom: 72px; }

  /* Risk strip stays 3-up but tighter */
  .risk-free-strip { font-size: 10.5px; }
}

/* ============ PHONE (<= 600px) ============ */
@media (max-width: 600px) {
  body { font-size: 14px; }

  /* Header: drop the wide stock badge to free space for brand + cart + menu */
  .ca-badge { display: none; }
  .nav-wrap { padding: 12px 14px; }
  .brand-logo h1 { font-size: 21px; }
  .brand-logo span { font-size: 9px; }
  .cart-btn { padding: 7px 12px; font-size: 12px; }
  .cart-btn span:first-child { display: none; }   /* icon-only bag on tiny screens */

  /* Announcement bar may wrap instead of overflowing */
  .announcement-bar { flex-wrap: wrap; font-size: 10.5px; padding: 7px 12px; gap: 6px; line-height: 1.4; }

  main.view-container { padding: 18px 14px 32px; }

  /* Type scaling for comfortable reading */
  .commerce-details h2 { font-size: 24px; }
  .section-title { font-size: 21px; }
  .science-lead-block h3 { font-size: 20px; }
  .hero-rating { flex-wrap: wrap; gap: 6px; }

  /* Panels get tighter padding */
  .gallery-panel { padding: 16px; }

  /* Hero thumbnail rail: scroll horizontally instead of wrapping on phones */
  .gallery-thumbs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; -webkit-overflow-scrolling: touch; padding-bottom: 6px; max-width: 100%; }
  .gallery-thumb { width: 62px; height: 62px; }
  .fresh-vs-traditional-section,
  .science-section-full,
  .practical-faq-section { padding: 22px 16px; }

  /* Tables: horizontal scroll so columns stay readable, never crushed */
  .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .diff-table { min-width: 540px; font-size: 12.5px; }
  .table-scroll .diff-table th,
  .table-scroll .diff-table td { padding: 10px 12px; }

  /* Shoppable videos: 2 -> 1 column on phones */
  .shoppable-video-grid { grid-template-columns: 1fr; }
  .shoppable-video-card { height: 300px; }
  .shoppable-overlay-bar h5 { font-size: 13px; }
  .quick-bag-btn { padding: 10px; font-size: 12.5px; }

  /* Risk strip: 3 -> 1 column */
  .risk-free-strip { grid-template-columns: 1fr; }

  /* Footer: 2 -> 1 column, with extra bottom room for the sticky bar */
  .footer-wrap { grid-template-columns: 1fr; gap: 24px; }
  footer.site-footer { padding: 36px 16px 110px; }
  .footer-col p, .disclaimer-box { font-size: 11.5px; }

  /* Modals: keep comfortably inside the viewport */
  .lead-modal-overlay, .video-modal-overlay { padding: 14px; }
  .lead-modal-box { padding: 28px 20px; }
  .video-modal-container { max-width: 100%; }

  /* Sticky buy bar: full-width select + button, larger tap targets */
  .sticky-bottom-bar { padding: 10px 14px; gap: 10px; }
  .sticky-variant-select { padding: 11px 10px; font-size: 13px; }
  .sticky-quick-btn { padding: 12px 18px; font-size: 14px; }

  /* Track-order card fills width with comfortable inputs */
  .view-container #view-track > div { padding: 22px 18px; }
  #track-id, #track-email { padding: 13px; font-size: 14px; }

  /* Step / science / review cards: comfortable spacing */
  .step-body, .review-body, .sci-card-content { padding: 16px; }
  .step-img-box, .sci-card-img, .review-img-box { height: 170px; }
}

/* ============ VERY SMALL (<= 380px) ============ */
@media (max-width: 380px) {
  .brand-logo h1 { font-size: 19px; }
  .commerce-details h2 { font-size: 22px; }
  .cart-btn { padding: 6px 10px; }
  .sticky-quick-btn { padding: 12px 14px; font-size: 13px; }
}
