/* The Outfit House — shared site styles
   Used by Homepage.html, Product.html, Category.html
   Builds on colors_and_type.css */

* { box-sizing: border-box; }
html {
  margin: 0; background: var(--bg); color: var(--fg); scroll-behavior: smooth;
  overflow-x: clip; /* clip (not hidden) — preserves position:sticky on child elements */
}
body { margin: 0; background: var(--bg); color: var(--fg); animation: page-in var(--dur-slow) var(--ease-out) both; overflow-x: clip; }
img { display: block; max-width: 100%; }

/* ============ SKIP LINK (a11y) ============ */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--accent); color: var(--accent-on);
  padding: 8px 16px; z-index: 999;
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  text-decoration: none; border-bottom: none;
  transition: top var(--dur-fast);
}
.skip-link:focus { top: 8px; border-bottom: none; }

/* ============ FOCUS VISIBLE (a11y baseline) ============ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Suppress ring only on elements that handle their own focus style via :focus-visible */
:focus:not(:focus-visible) { outline: none; }

/* ============ SCREEN-READER ONLY ============ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:root {
  --wa: #25D366;
  --wa-dark: #1FB857;
  --container: 1280px;
  --pad-x: 32px;
}

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x); }

/* ============ NAV ============ */
header.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--overlay-nav); backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
/* Spacer so page content doesn't hide under the fixed nav */
#header-mount { min-height: 68px; }
@media (max-width: 900px) { #header-mount { min-height: 60px; } }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x); max-width: var(--container); margin: 0 auto;
  gap: 32px; height: 68px;
}

/* Brand — left */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  border-bottom: none; flex-shrink: 0;
  height: 100%;
}
.brand img { width: 26px; height: 26px; object-fit: contain; display: block; }
.brand .name {
  font-family: var(--font-display); font-size: 20px; line-height: 1;
  text-transform: uppercase; color: var(--fg); letter-spacing: 0.4px;
  white-space: nowrap;
}

/* Primary nav — center */
.nav-links {
  display: flex; align-items: center; gap: 28px; flex: 1;
  justify-content: center;
  font-family: var(--font-heading); font-size: 11px; font-weight: 600;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  height: 100%;
}
.nav-links a {
  display: inline-flex; align-items: center; height: 100%;
  color: var(--fg-muted); border-bottom: none;
  transition: color var(--dur-fast);
  position: relative;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
}

/* Utility cluster — right */
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 100%;
}
.icon-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--fg-muted); border-bottom: none;
  transition: color var(--dur-fast);
}
.icon-link:hover { color: var(--fg); }
.icon-link svg { width: 18px; height: 18px; }
.nav-wa {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-on);
  padding: 0 18px; height: 44px;
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  border: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out);
}
.nav-wa:hover { background: var(--accent-hover, var(--accent)); }
.nav-wa svg { width: 14px; height: 14px; }

/* mobile nav toggle */
.nav-toggle {
  display: none; background: transparent; border: none; color: var(--fg);
  cursor: pointer; width: 44px; height: 44px; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }

/* Hide desktop nav at smaller widths so things don't crowd */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-inner { justify-content: space-between; gap: 16px; }
  .brand { order: 2; flex: 1; justify-content: center; }
  .nav-toggle { order: 1; }
  .nav-cta { order: 3; }
}

/* ============ NAV DROPDOWN ============ */
.nav-dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.nav-dropdown-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 100%;
  font-family: var(--font-heading); font-size: 11px; font-weight: 600;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-muted); background: transparent; border: none;
  cursor: pointer; padding: 0; position: relative;
  transition: color var(--dur-fast);
}
.nav-dropdown-btn:hover { color: var(--fg); }
.nav-dropdown-btn.active { color: var(--accent); }
.nav-dropdown-btn.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
}
.nav-dropdown-btn svg { width: 10px; height: 10px; transition: transform var(--dur-base) var(--ease-out); }
.nav-dropdown:hover .nav-dropdown-btn svg,
.nav-dropdown.open .nav-dropdown-btn svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: -12px;
  background: var(--surface-dropdown); border: 1px solid var(--border);
  min-width: 180px; z-index: 100;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.nav-dropdown-menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-family: var(--font-heading); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--fg-muted); border-right: none;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { color: var(--fg); background: var(--surface-hover); border-color: var(--border); }
.nav-dropdown-menu a.active { color: var(--accent); }
.nav-dropdown-menu .num { font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle); }

/* ============ BUTTONS ============ */
.btn-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--wa); color: var(--accent-on); padding: 18px 26px;
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  border: none; cursor: pointer; transition: all var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn-wa:hover { background: var(--wa-dark); transform: translateY(-1px); }
.btn-wa svg { width: 18px; height: 18px; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--fg);
  border: 1px solid var(--border-strong); padding: 18px 26px;
  font-family: var(--font-heading); font-size: 13px; font-weight: 700;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  cursor: pointer; transition: all var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn-ghost:hover { background: var(--fg); color: var(--accent-on); }

/* ============ SECTION HEAD ============ */
.sec { padding: 112px 0; }
.sec-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 56px; gap: 24px;
}
.sec-head .eyebrow {
  display: block; font-family: var(--font-heading); font-size: 11px;
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px; font-weight: 600;
}
.sec-head h2 {
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 72px);
  text-transform: uppercase; line-height: 0.95; margin: 0; max-width: 820px;
}
.sec-head .right { font-family: var(--font-body); color: var(--fg-muted);
  max-width: 320px; font-size: 14px; line-height: 1.6; }

/* ============ PRODUCT CARD (shared) ============ */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pc {
  background: var(--bg-elev); border: 1px solid var(--bg-elev);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  display: flex; flex-direction: column; color: inherit;
  position: relative; backface-visibility: hidden; isolation: isolate;
  will-change: transform;
}
.pc:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.pc-img {
  aspect-ratio: 4/3; background: var(--bg-elev); position: relative; overflow: hidden;
}
.pc-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.pc:hover .pc-img img { transform: scale(1.04); }
.pc-grade {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--accent); color: var(--accent-on);
  font-family: var(--font-heading); font-size: 10px; font-weight: 700;
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  padding: 5px 10px; transition: opacity var(--dur-base) var(--ease-out);
}
.pc:hover .pc-grade { opacity: 0.75; }
.pc-grade.entry    { background: var(--bg-light); color: var(--accent-on); }
.pc-grade.standard { background: var(--accent); color: var(--accent-on); }
.pc-grade.vault    { background: var(--bg); color: var(--accent); border: 1px solid var(--accent); }
.pc-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.pc-brand { font-family: var(--font-heading); font-size: 10px;
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  color: var(--fg-muted); font-weight: 600; }
.pc-name { font-family: var(--font-display); font-size: 22px;
  text-transform: uppercase; color: var(--fg); line-height: 1.05; margin-top: 2px;
  display: block; border-bottom: none; }
.pc-name:hover { color: var(--accent); border-bottom: none; }
.pc-name::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pc-price { font-family: var(--font-heading); font-weight: 700;
  color: var(--fg); margin-top: 8px; font-size: 15px; }
.pc-price s { color: var(--fg-subtle); font-weight: 400; margin-left: 8px; font-size: 13px; }
.pc-cta {
  margin-top: 18px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; background: transparent; color: var(--fg);
  border: 1px solid var(--border-strong); padding: 14px;
  min-height: 44px;
  font-family: var(--font-heading); font-size: 11px; font-weight: 700;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  cursor: pointer; transition: all var(--dur-base) var(--ease-out);
  position: relative; z-index: 2;
}
.pc-cta:hover { background: var(--wa); color: var(--accent-on); border-color: var(--wa); }
.pc-cta svg { width: 13px; height: 13px; }

/* ============ FOOTER ============ */
footer { border-top: 1px solid var(--border); padding: 56px var(--pad-x) 32px; }
.ft { max-width: var(--container); margin: 0 auto; display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; }
.ft img { width: 130px; margin-bottom: 14px; }
.ft p { font-size: 13px; color: var(--fg-muted); line-height: 1.6; max-width: 280px; margin: 0; }
.ft h5 { font-family: var(--font-heading); font-size: 11px;
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  color: var(--fg-muted); font-weight: 600; margin: 0 0 14px; }
.ft ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ft ul a { color: var(--fg); border-bottom: none; font-size: 13px; }
.ft ul a:hover { color: var(--accent); }
.ft-bot {
  max-width: var(--container); margin: 40px auto 0; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; font-family: var(--font-mono);
  font-size: 11px; color: var(--fg-subtle); gap: 16px;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
}

/* ============ STICKY WHATSAPP FAB ============ */
.wa-fab {
  position: fixed;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  right: 24px; z-index: 100;
  background: var(--wa); color: var(--accent-on);
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45), 0 0 0 3px rgba(37,211,102,0.18);
  transition: all var(--dur-base) var(--ease-out);
}
.wa-fab:hover { background: var(--wa-dark); transform: translateY(-2px) scale(1.04); }
.wa-fab svg { width: 24px; height: 24px; }
.wa-fab .pulse {
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(37,211,102,0.45);
  animation: pulse 2.6s ease-out infinite; pointer-events: none;
  will-change: transform, opacity;
}
@keyframes pulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  100% { transform: scale(1.85); opacity: 0; }
}

/* ============ PAGE TRANSITIONS ============ */
@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes page-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
body.leaving {
  animation: page-out 0.18s ease-in forwards !important;
  pointer-events: none;
}

/* ============ SCROLL REVEAL ============ */
/* JS adds .peek to below-fold elements; IO adds .show on scroll-into-view.
   Uses !important to beat transition:all on .tier and similar elements.
   JS removes both classes after transitionend so hover transforms resume normally. */
.peek {
  opacity: 0 !important;
  transform: translateY(20px) !important;
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.peek.show {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ============ BUTTON PRESS STATES ============ */
.btn-wa:active  { transform: translateY(0) scale(0.97) !important; transition-duration: 0.07s !important; }
.btn-ghost:active { transform: scale(0.97) !important; transition-duration: 0.07s !important; }
.pc-cta:active  { transform: scale(0.97); transition-duration: 0.07s !important; }
.nav-wa:active  { transform: scale(0.97); transition-duration: 0.07s !important; }

/* ============ REDUCED MOTION ============ */
/* Only disable continuous looping animations — hover transforms are brief
   intentional feedback and are retained for all users */
@media (prefers-reduced-motion: reduce) {
  .wa-fab .pulse { animation: none; }
  html { scroll-behavior: auto; }
  body, body.leaving { animation: none !important; }
  /* Reduced-motion: keep opacity fade (not jarring) but remove translateY movement */
  .peek { transform: none !important; transition: opacity 0.5s ease !important; }
  .peek.show { transform: none !important; }
}

/* ============ MOBILE NAV DRAWER ============ */

/* Backdrop — dims the page behind the panel */
.mob-backdrop {
  position: fixed; inset: 0;
  background: var(--overlay-backdrop);
  z-index: 199;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}
.mob-backdrop.open { opacity: 1; pointer-events: auto; }

/* Drawer panel — slides in from the right */
.mob-nav {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(300px, 84vw);
  background: var(--surface-dropdown);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex; flex-direction: column;
  visibility: hidden; pointer-events: none;
  transform: translateX(100%);
  transition:
    transform var(--dur-slow) var(--ease-out),
    visibility 0s var(--dur-slow);
}
.mob-nav.open {
  visibility: visible; pointer-events: auto;
  transform: translateX(0);
  transition:
    transform var(--dur-slow) var(--ease-out),
    visibility 0s 0s;
}

/* Drawer header row */
.mob-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 20px; height: 60px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mob-nav-label {
  font-family: var(--font-heading); font-size: 10px; font-weight: 600;
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  color: var(--fg-muted);
}
.mob-close {
  background: transparent; border: none; color: var(--fg);
  cursor: pointer; padding: 12px;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--dur-fast);
}
.mob-close:hover { color: var(--accent); }
.mob-close svg { width: 20px; height: 20px; }

/* Nav links list */
.mob-nav-links {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
}
.mob-nav-links a {
  color: var(--fg); border-bottom: none;
  padding: 18px 20px;
  font-family: var(--font-display); font-size: 26px; text-transform: uppercase;
  line-height: 1; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.mob-nav-links a:first-child { border-top: none; }
.mob-nav-links a:hover { color: var(--accent); background: var(--surface-hover-subtle); }
.mob-nav-links a svg { width: 14px; height: 14px; opacity: 0.35; flex-shrink: 0; }

/* Footer CTA at the bottom of the drawer */
.mob-nav-foot {
  padding: 16px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.mob-nav-foot .btn-wa {
  width: 100%; justify-content: center; padding: 16px 20px; font-size: 12px;
}

/* ============ TABLET — 1080px (nav-collapse zone) ============ */
@media (max-width: 1080px) {
  .ft { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
}

/* ============ TABLET MID — 720px ============ */
@media (max-width: 720px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ft { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 420px) {
  .products-grid { grid-template-columns: 1fr; }
}

/* ============ MOBILE — 900px ============ */
@media (max-width: 900px) {
  :root { --pad-x: 20px; }
  .sec { padding: 72px 0; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 36px; }
  .sec-head .right { max-width: 100%; }
  .nav-inner { height: 60px; }
  .brand .name { font-size: 17px; }
  .brand img { width: 24px; height: 24px; }
  .nav-wa span.lbl { display: none; }
  .nav-wa { padding: 0 12px; }
  .icon-link { width: 44px; height: 44px; }
  .nav-toggle { width: 44px; height: 44px; }
  .pc-name { font-size: 17px; }
  .pc-body { padding: 14px 14px 16px; gap: 3px; }
  .pc-cta { padding: 12px; font-size: 10px; }
  .ft { grid-template-columns: 1fr 1fr; gap: 32px; }
  .ft-bot { flex-direction: column; }
}
