/* Sabai Ink — shared mobile fixes
   Loaded on every page after that page's own <style> block, so these rules
   override page-local CSS at small widths. */

/* ─── Universal: prevent any body horizontal scroll ──────────────── */
html, body { overflow-x: hidden; }

/* ─── Hamburger menu trigger (injected by mobile-nav.js) ──────────── */
.mobile-menu-btn {
  display: none;
  width: 44px; height: 44px;
  background: none;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  padding: 0;
  flex-shrink: 0;
}
.mobile-menu-btn span,
.mobile-menu-btn span::before,
.mobile-menu-btn span::after {
  content: '';
  display: block;
  position: absolute;
  width: 18px; height: 1.5px;
  background: #000;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 250ms ease, opacity 250ms ease;
}
.mobile-menu-btn span::before { top: -6px; }
.mobile-menu-btn span::after  { top:  6px; }
.mobile-menu-btn.open span { background: transparent; }
.mobile-menu-btn.open span::before { top: 0; transform: rotate(45deg); }
.mobile-menu-btn.open span::after  { top: 0; transform: rotate(-45deg); }

/* Slide-down full-screen menu */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245,242,238,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 480;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
  opacity: 0; pointer-events: none;
  transition: opacity 300ms ease;
}
.mobile-menu-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-menu-overlay a, .mobile-menu-overlay button {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: #000;
  text-decoration: none;
  background: none; border: none;
  cursor: pointer;
}
.mobile-menu-overlay a:hover, .mobile-menu-overlay button:hover {
  opacity: 0.6;
}
.mobile-menu-overlay .small {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
  margin-top: 16px;
}

/* ─── Tablet & below (≤900px): nav cleanup, footer + grids collapse ──── */
@media (max-width: 900px) {
  /* Hide normal nav links + the right-side cluster so we can use hamburger */
  nav .nav-links,
  nav .nav-right .lang-toggle,
  nav .nav-right [data-account-link] {
    display: none;
  }
  /* Show hamburger */
  nav .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  /* Make sure cart stays visible on the right */
  nav .nav-right { gap: 12px; }
  nav { padding: 16px 24px !important; }
  nav.scrolled { padding: 14px 24px !important; }

  /* Footer 4-col grid → 2-col */
  footer .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 40px !important; }

  /* Shop product grid → 2 columns */
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }

  /* Account 2-col → stack */
  .account-grid { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* Contact 2-col → stack */
  .contact-body, .contact-hero-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Filter bar — let pills wrap */
  .filter-bar { flex-direction: column; align-items: flex-start !important; gap: 12px !important; padding: 12px 24px !important; }
  .filter-tabs { flex-wrap: wrap; gap: 4px 16px !important; }
  .filter-btn { padding: 8px 0 !important; }

  /* Refine row — stack groups vertically; drop the vertical divider */
  .filter-refine { padding: 12px 24px 14px !important; gap: 12px !important; }
  .filter-refine-left { gap: 12px !important; flex-direction: column; align-items: flex-start; width: 100%; }
  .filter-refine-left .filter-group + .filter-group {
    padding-left: 0 !important;
    border-left: 0 !important;
  }
  .filter-sort { width: 100%; justify-content: flex-start; }

  /* ─── Tap target enlargement (mobile only) ────────────────────────────
     WCAG / Sabai blueprint require ≥44×44 hit area on touch. Visual style
     of small pills/chips is preserved by adding padding rather than height
     so the visible pill stays compact while the hit area grows. */
  .size-pill,
  .price-pill {
    padding: 10px 16px !important;     /* was 5px 14px → ~24px → ~40px tall */
    min-height: 40px;
    display: inline-flex; align-items: center;
  }
  .filter-btn {
    padding: 14px 0 !important;        /* was 8px 0 → ~27px → ~44px tall */
    min-height: 44px;
  }
  .card-wish {
    width: 44px !important;
    height: 44px !important;
  }
  .card-quickadd, .card-quickadd-home {
    padding: 14px 22px !important;     /* was 10px 22px → ~34px → ~44px tall */
    min-height: 44px;
  }
  /* Promo-bar dismiss × — was 23×30, bump to 44×44 hit area */
  #promo-bar .promo-close {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center; justify-content: center;
  }
  /* Nav cart pill — height 34 → 44 */
  .nav-cart {
    padding: 12px 16px !important;
    min-height: 44px;
    display: inline-flex; align-items: center;
  }
  /* Sort dropdown */
  .sort-select {
    min-height: 44px;
    padding-top: 11px !important;
    padding-bottom: 11px !important;
  }
  /* Pagination buttons */
  .pagination-btn {
    min-width: 44px !important;
    height: 44px !important;
  }
  /* Newsletter Subscribe button — was 11px tall, way under threshold */
  .sabai-newsletter-form button {
    min-height: 44px !important;
    padding: 12px 18px !important;
  }
  /* Footer links — bump line-height + add inline padding for fingers */
  footer .footer-links a {
    display: inline-block;
    padding: 8px 0;
    line-height: 1.4;
  }
  /* Footer legal strip (Privacy / Terms / Shipping / Returns) */
  footer .footer-legal a {
    display: inline-block;
    padding: 10px 0;
  }
}

/* ─── Phone (≤600px): tighter padding, footer single-col, smaller hero ─ */
@media (max-width: 600px) {
  /* All "section" padding squeezed */
  section, main { padding-left: 24px !important; padding-right: 24px !important; }

  /* Page-level grids: footer 1 col, shop grid stays 2-up (storefront density) */
  footer .footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

  /* Hero tamed */
  .hero { height: auto !important; min-height: 100vh !important; padding: 100px 24px !important; }
  .hero h1 { font-size: clamp(40px, 12vw, 64px) !important; }

  /* PDP gallery + info stack */
  main > .product-grid { grid-template-columns: 1fr !important; }

  /* Form layout: one column */
  .form-row { grid-template-columns: 1fr !important; gap: 14px !important; }

  /* Footer bottom strip stack */
  footer .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start !important; }
}

/* ─── Touch devices: reveal hover-only UI permanently ─────────────── */
@media (hover: none) {
  .card-wish { opacity: 1 !important; transform: none !important; }
  .product-card:hover .card-image svg { transform: none; }
  .sabai-add-to-cart { opacity: 1 !important; transform: none !important; }
}

/* ─── iOS auto-zoom prevention: input font ≥16px ──────────────────── */
@media (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ─── Lock scroll when mobile menu is open ────────────────────────── */
body.mobile-menu-open { overflow: hidden; }
