/* ==========================================================================
   Base: reset, typography, layout primitives, buttons, utilities
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

/* "hidden" must always win over component display rules (grid/flex) */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }
/* Decorative overflow (rotated strips, sliders) must never cause sideways scrolling */
main { overflow-x: clip; }

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--heading-font);
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  letter-spacing: var(--heading-tracking);
  line-height: 1.05;
  text-wrap: balance;
}
.h1 { font-size: var(--fs-hero); }
.h2 { font-size: var(--fs-3xl); }
.h3 { font-size: var(--fs-2xl); }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--lime); color: var(--black); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.stack > * + * { margin-top: var(--stack, var(--sp-4)); }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.section-head__text { max-width: 40rem; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-label);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
}
.lead { font-size: var(--fs-lg); color: var(--ink-muted); max-width: 38rem; }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--btn-bg);
  --_ink: var(--btn-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 1.6rem;
  border: 1.5px solid var(--_bg);
  border-radius: var(--btn-radius);
  background: var(--_bg);
  color: var(--_ink);
  font-family: var(--font-label);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--alt { --_bg: var(--btn-alt-bg); --_ink: var(--btn-alt-ink); border-color: currentColor; }
.btn--ghost { --_bg: transparent; --_ink: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--lime { --_bg: var(--lime); --_ink: var(--black); }
.btn--dark { --_bg: var(--black); --_ink: #fff; }
.btn--whatsapp { --_bg: #1faa53; --_ink: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 1rem; font-size: var(--fs-xs); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-label);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Icons ---------- */
.icon { width: 22px; height: 22px; flex: none; }

/* ---------- Forms ---------- */
.field {
  width: 100%;
  min-height: 48px;
  padding: 0 1rem;
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 16px; /* prevents iOS zoom */
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { outline: none; border-color: var(--ink); }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 999;
  background: var(--lime); color: var(--black);
  padding: 0.75rem 1rem; font-weight: 700;
}
.skip-link:focus { top: 1rem; }
.muted { color: var(--ink-muted); }
.price { font-variant-numeric: tabular-nums; font-weight: 700; }
.price s { color: var(--ink-faint); font-weight: 500; margin-left: 0.4em; }

/* Horizontal scroll rail used on mobile for product lists */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(62%, 1fr);
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .rail { grid-auto-columns: minmax(40%, 1fr); } }
@media (min-width: 1024px) {
  .rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
}

.grid-products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5) var(--sp-3);
}
@media (min-width: 768px) { .grid-products { grid-template-columns: repeat(3, 1fr); gap: var(--sp-6) var(--sp-4); } }
@media (min-width: 1100px) { .grid-products { grid-template-columns: repeat(4, 1fr); } }

/* Reveal-on-scroll (progressive: content is visible if JS is off) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* Space for the fixed mobile bottom nav */
@media (max-width: 1023px) {
  body { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom)); }
}
