/* wh-responsive.css v2 — winkinghome.com global responsive layer
   Load order: wh-core.css → <style>(fallback) → this file
   This file wins all cascade ties on responsive rules. */

/* ── HAMBURGER BUTTON BASE ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 8px;
  flex-shrink: 0;
  color: #aaa;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ══════════════════════════════════════════
   ≤ 1024px  TABLET LANDSCAPE / NAV
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nav-wrap { gap: 8px; padding: 0 16px; }

  /* Show hamburger, collapse nav links */
  .nav-hamburger { display: flex; }
  .nav-menu {
    display: none;
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: #141414;
    border-top: 1px solid #252525;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    z-index: 999;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 8px 0;
    margin-left: 0;
  }
  html:not([data-theme="dark"]) .nav-menu {
    background: #fff;
    border-top-color: #e8e8e8;
  }
  nav.open .nav-menu { display: flex; }

  /* Mobile nav links */
  .nav-menu > a,
  .nav-menu .nav-dd > a {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    border-bottom: 1px solid #2a2a2a;
    color: #ccc;
  }
  html:not([data-theme="dark"]) .nav-menu > a,
  html:not([data-theme="dark"]) .nav-menu .nav-dd > a {
    color: #333;
    border-bottom-color: #e8e8e8;
  }

  /* Products dropdown — click-based on mobile */
  .nav-dd { position: static; }
  .nav-dd:hover .dd { opacity: 0 !important; pointer-events: none !important; }
  .nav-dd.open .dd {
    opacity: 1 !important;
    pointer-events: all !important;
    position: static !important;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: #1e1e1e;
    width: 100%;
    padding: 4px 0;
    top: auto;
  }
  html:not([data-theme="dark"]) .nav-dd.open .dd { background: #f5f5f5; }
  .nav-dd.open .dd a {
    padding: 11px 36px;
    font-size: 14px;
    border-bottom: 1px solid #2a2a2a;
    border-radius: 0;
  }
  html:not([data-theme="dark"]) .nav-dd.open .dd a { border-bottom-color: #e8e8e8; }

  /* Hide desktop CTA button */
  .nav-cta { display: none; }

  /* Hamburger → X animation */
  nav.open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  nav.open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ══════════════════════════════════════════
   ≤ 768px  TABLET PORTRAIT / MOBILE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── HOMEPAGE HERO ── */
  .hero { height: auto; }
  .hero-inner {
    position: static;
    transform: none;
    left: auto;
    flex-direction: column;
    padding: 0;
    max-width: 100%;
    align-items: stretch;
  }
  .hero-right {
    order: -1;
    flex: none;
    height: 250px;
    padding: 0;
    justify-content: stretch;
    align-items: stretch;
  }
  .hero-photo-box {
    width: 100% !important;
    height: 250px !important;
    border-radius: 0 !important;
    opacity: 1 !important;
  }
  .hero-photo-slides { width: 100%; }
  .hero-left { width: 100%; padding: 24px 20px 20px; }
  .hero h1 { font-size: 28px; line-height: 1.1; }
  .hero-sub { font-size: 14px; max-width: 100%; }
  .hero-actions { flex-wrap: wrap; gap: 10px; }
  .hero-stats { position: static; }

  /* Shared layout */
  .wrap { padding: 0 16px; }
  section { padding: 44px 0; }
  .sec-title { font-size: 24px; }
  .page-h1 { font-size: 28px; }
  .page-hero { padding: 28px 0 36px; }
  .page-intro { font-size: 14px; }

  /* Footer 4-col → 2-col */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }

  /* CTA band → column */
  .cta-band { flex-direction: column; align-items: flex-start; padding: 24px 20px; gap: 16px; }

  /* Products listing page */
  .plist-grid { grid-template-columns: 1fr 1fr; gap: 16px; }

  /* Homepage product grid */
  .product-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Product sub-pages ── */

  /* Hero: 2-col → 1-col, image below heading */
  .hb-hero-inner { grid-template-columns: 1fr; gap: 20px; }
  .hb-hero-img { justify-content: center; }
  .hb-slider-box { aspect-ratio: 4/3; }
  .hb-hero-actions { gap: 10px; }

  /* Specs: side-by-side → stacked */
  .hb-specs-outer { grid-template-columns: 1fr; gap: 28px; }

  /* Applications: 3-col → 1-col */
  .hb-app-grid { grid-template-columns: 1fr; gap: 16px; }

  /* OEM: 4-col → 2-col */
  .hb-oem-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Gallery main image height */
  .hb-gallery-main { height: 240px; }

  /* About: story grid → stacked */
  .story-split { grid-template-columns: 1fr; gap: 20px; }

  /* Facilities: zone grid */
  .fac-zone-grid, .fac-zone-alt .fac-zone-grid { flex-direction: column; }

  /* Buttons */
  .btn-primary, .btn-ghost { padding: 12px 22px; font-size: 14px; }
}

/* ══════════════════════════════════════════
   ≤ 600px  STATS BAR COLLAPSE
   ══════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Stats bar: 4 items → 2×2 grid */
  .hb-stats-inner { grid-template-columns: repeat(2, 1fr); }
  .hb-stat:nth-child(2) { border-right: none; }
  .hb-stat:nth-child(3) { border-top: 1px solid rgba(255,255,255,.2); }
  .hb-stat:nth-child(4) { border-top: 1px solid rgba(255,255,255,.2); border-right: none; }
}

/* ══════════════════════════════════════════
   ≤ 480px  PHONE
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
  /* Homepage hero: smaller photo */
  .hero-right { height: 200px !important; }
  .hero-photo-box { height: 200px !important; }
  .hero h1 { font-size: 22px; }
  /* Footer 2-col → 1-col */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }

  /* Products listing → single column */
  .plist-grid { grid-template-columns: 1fr; }

  /* OEM: 2-col → 1-col */
  .hb-oem-grid { grid-template-columns: 1fr; }

  /* Gallery thumbs: 6 → 4 per row */
  .hb-gallery-thumbs { grid-template-columns: repeat(4, 1fr); }

  /* Typography */
  .page-h1 { font-size: 22px; }
  .sec-title { font-size: 20px; }
  .sec-label { font-size: 10px; }

  /* Spec table: prevent overflow */
  .hb-spec-table { display: block; overflow-x: auto; }
  .hb-spec-table td:first-child { width: 100px; }

  /* Breadcrumb wrap */
  .breadcrumb { flex-wrap: wrap; gap: 4px; }
}
