/* STI CrossFit · Tienda
   Negro, rojo y crema de la marca; producto sobre mosaicos claros. */

:root {
  --ink: #0a0a0b;
  --ink-2: #17171a;
  --paper: #ffffff;
  --bone: #f6f5f1;
  --tile: #efeee9;
  --line: #e2e0d9;
  --muted: #6b6a66;
  --red: #e5140d;
  --red-deep: #b90f09;
  --cream: #eadfc8;
  --ok: #0f7a57;

  --display: "Anton", "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --top-h: 58px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
  overflow-x: hidden;
}

h1, h2, h3, p, ol, ul, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

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

/* ───────── Barra superior ───────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  background: rgb(10 10 11 / .86);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo { width: 36px; height: 36px; border-radius: 50%; background: var(--ink-2); object-fit: cover; }
.brand__name { font: 400 22px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.brand__name b { font-weight: 400; color: var(--red); }
.topbar__actions { display: flex; gap: 4px; }

.iconbtn {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .2s, transform .2s var(--ease);
}
.iconbtn:hover { background: rgb(255 255 255 / .12); }
.iconbtn:active { transform: scale(.92); }
.iconbtn--soft { background: var(--tile); color: var(--ink); width: 38px; height: 38px; }
.iconbtn--soft:hover { background: var(--line); }
.iconbtn--soft svg { width: 18px; height: 18px; stroke-width: 2.2; }

.badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px;
  background: var(--red); color: #fff;
  font: 700 11px/19px var(--body); text-align: center;
  font-variant-numeric: tabular-nums;
}
.badge.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45); } }

/* ───────── Hero ───────── */
.hero {
  position: relative; isolation: isolate;
  background: var(--ink); color: #fff;
  padding: 44px var(--gutter) 52px;
  overflow: hidden;
  min-height: min(76svh, 640px);
  display: flex; align-items: flex-end;
}
.hero__ghost {
  position: absolute; inset: -4% -40%; z-index: -1;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  font: 400 clamp(92px, 27vw, 250px)/.86 var(--display);
  white-space: nowrap; text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px rgb(255 255 255 / .11);
  transform: rotate(-7deg);
  pointer-events: none;
}
.hero__ghost span:nth-child(2) { -webkit-text-stroke-color: rgb(229 20 13 / .5); }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 70% at 85% 0%, rgb(229 20 13 / .30), transparent 60%),
    linear-gradient(to top, var(--ink) 12%, transparent 62%);
}
.hero__body { max-width: 620px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 18px;
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgb(229 20 13 / .7); animation: pulse 2s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px rgb(229 20 13 / 0); } }

.hero h1 {
  font: 400 clamp(64px, 19vw, 132px)/.9 var(--display);
  text-transform: uppercase; letter-spacing: .005em;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero__sub { margin-top: 18px; max-width: 34ch; color: rgb(255 255 255 / .78); font-size: 16px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ───────── Botones ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px;
  font: 600 16px/1 var(--body);
  transition: transform .2s var(--ease), background .2s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-deep); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #2a2a2e; }
.btn--ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .4); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.btn--line { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--wa { background: #128c4b; color: #fff; }
.btn--wa:hover { background: #0e733d; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }

/* ───────── Marquesina ───────── */
.marquee { background: var(--red); color: var(--ink); overflow: hidden; }
.marquee__track {
  display: flex; width: max-content;
  padding: 11px 0;
  animation: marquee 26s linear infinite;
}
.marquee span {
  font: 400 18px/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  padding: 0 18px; position: relative; white-space: nowrap;
}
.marquee span::after { content: "✕"; position: absolute; right: -6px; top: 1px; font: 700 11px/18px var(--body); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ───────── Secciones ───────── */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  margin-bottom: 14px;
}
.section-head h2 { font: 400 clamp(34px, 9vw, 56px)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.section-head p { color: var(--muted); font-size: 14px; text-align: right; }

.rail-section { padding: 36px 0 8px; }
.rail {
  display: flex; gap: 12px;
  padding: 2px var(--gutter) 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.feature {
  flex: 0 0 min(74vw, 300px);
  scroll-snap-align: start;
  position: relative;
  border-radius: 22px; overflow: hidden;
  background: var(--ink); color: #fff;
  text-align: left;
  display: flex; flex-direction: column;
  transition: transform .3s var(--ease);
}
.feature:active { transform: scale(.98); }
.feature__media { aspect-ratio: 1 / 1; min-height: 0; overflow: hidden; flex: none; background: var(--tile); display: grid; place-items: center; padding: 22px; }
.feature__info { flex: 1; align-content: start; }
.feature__media img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; transition: transform .5s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.06) rotate(-2deg); }
.feature__info { padding: 14px 16px 16px; display: grid; gap: 4px; }
.feature__cat { font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--cream); }
.feature__name { font: 400 24px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.feature__price { font-weight: 600; font-variant-numeric: tabular-nums; color: rgb(255 255 255 / .8); }
.feature__num {
  position: absolute; top: 12px; left: 14px;
  font: 400 15px/1 var(--display); letter-spacing: .08em; color: var(--ink);
  background: var(--paper); padding: 6px 9px 5px; border-radius: 999px;
}

/* ───────── Catálogo ───────── */
.catalog { padding: 28px 0 20px; }
.tools {
  position: sticky; top: var(--top-h); z-index: 20;
  background: rgb(255 255 255 / .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 10px 0 10px;
  display: grid; gap: 10px;
  border-bottom: 1px solid transparent;
}
.search {
  display: flex; align-items: center; gap: 10px;
  margin: 0 var(--gutter);
  height: 48px; padding: 0 16px;
  background: var(--tile); border-radius: 999px;
  transition: box-shadow .2s;
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.chips {
  display: flex; gap: 8px;
  padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 40px; padding: 0 18px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font: 600 14px/1 var(--body);
  transition: background .2s, color .2s, box-shadow .2s, transform .2s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip sup { font-size: 10px; color: var(--muted); margin-left: 4px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.chip[aria-pressed="true"] sup { color: rgb(255 255 255 / .6); }

.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 10px;
  padding: 14px var(--gutter) 0;
}
.card { position: relative; text-align: left; display: block; width: 100%; }
.card__open { display: block; width: 100%; text-align: left; }
.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--tile); border-radius: 18px;
  display: grid; place-items: center; padding: 16px;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transition: transform .5s var(--ease); }
.card:hover .card__media img { transform: scale(1.07); }
.card__tag {
  position: absolute; top: 10px; left: 10px;
  font: 700 10px/1 var(--body); letter-spacing: .08em;
  background: var(--ink); color: #fff; padding: 5px 7px; border-radius: 6px;
}
.card__info { padding: 10px 2px 0; display: grid; gap: 2px; }
.card__cat { font: 600 11px/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--red-deep); }
.card__name { font-weight: 600; font-size: 15px; line-height: 1.25; text-wrap: balance; }
.card__price { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.card__add {
  position: absolute; right: 8px; top: 0; z-index: 2;
  /* se ancla a la esquina inferior del mosaico cuadrado */
  margin-top: calc(100% - 52px);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgb(0 0 0 / .18);
  transition: transform .25s var(--ease), background .2s;
}
.card__add:hover { background: var(--red); }
.card__add:active { transform: scale(.86); }
.card__add svg { width: 20px; height: 20px; stroke-width: 2.4; }
.card__add.is-added { background: var(--ok); }

.ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font: 400 44px/1 var(--display); color: rgb(10 10 11 / .18); text-transform: uppercase;
}

.empty { text-align: center; padding: 48px var(--gutter); color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty[hidden] { display: none; }
.empty__title { font: 400 28px/1 var(--display); text-transform: uppercase; color: var(--ink); }
.empty .btn { margin-top: 10px; }

/* Aparición al hacer scroll (solo donde el navegador lo soporta) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, .steps li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    @keyframes rise { from { opacity: 0; translate: 0 28px; } }
    .hero__ghost { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    @keyframes drift { to { translate: -9% 0; } }
  }
}

/* ───────── Cómo funciona ───────── */
.how { padding: 44px 0 40px; background: var(--bone); margin-top: 36px; }
.steps { display: grid; gap: 10px; padding: 0 var(--gutter); }
.steps li {
  background: var(--paper); border-radius: 20px; padding: 18px 18px 20px;
  display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: start;
}
.steps b { grid-row: span 2; font: 400 44px/.9 var(--display); color: var(--red); }
.steps h3 { font: 400 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.steps p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }

/* ───────── Pie ───────── */
.footer { background: var(--ink); color: #fff; padding: 36px var(--gutter) 34px; display: grid; gap: 26px; }
.footer__brand { display: flex; gap: 14px; align-items: center; }
.footer__brand p { color: rgb(255 255 255 / .6); font-size: 13.5px; }
.footer__logo { width: 64px; height: 64px; border-radius: 50%; background: var(--ink-2); }
.footer__brand .footer__name { font: 400 28px/1 var(--display); text-transform: uppercase; color: #fff; letter-spacing: .03em; margin-bottom: 4px; }
.footer__links { display: grid; gap: 0; border-top: 1px solid rgb(255 255 255 / .14); }
.footer__links li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgb(255 255 255 / .14); font-size: 14.5px; }
.footer__links span { color: rgb(255 255 255 / .55); flex: none; }
.footer__links a { text-align: right; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(255 255 255 / .35); }
.footer__legal { color: rgb(255 255 255 / .5); font-size: 12.5px; }

/* ───────── Barra inferior ───────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgb(255 255 255 / .9);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: grid; place-items: center; align-content: center; gap: 3px;
  font: 600 11px/1 var(--body); color: var(--muted);
  transition: color .2s;
}
.tab svg { width: 23px; height: 23px; }
.tab.is-active, .tab:active { color: var(--ink); }
.tab--cart .badge { top: 7px; right: calc(50% - 24px); }

/* ───────── Hojas (dialog) ───────── */
dialog.sheet {
  position: fixed; inset: auto 0 0 0;
  width: 100%; max-width: 100%; max-height: 92dvh;
  margin: 0; padding: 0; border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--paper); color: var(--ink);
  overflow: hidden;
  translate: 0 100%;
  transition: translate .42s var(--ease), overlay .42s allow-discrete, display .42s allow-discrete;
}
dialog.sheet[open] { display: flex; flex-direction: column; translate: 0 0; }
@starting-style { dialog.sheet[open] { translate: 0 100%; } }
dialog.sheet--tall { height: 92dvh; }
dialog.sheet::backdrop {
  background: rgb(10 10 11 / 0);
  transition: background .42s, backdrop-filter .42s, overlay .42s allow-discrete, display .42s allow-discrete;
}
dialog.sheet[open]::backdrop { background: rgb(10 10 11 / .6); backdrop-filter: blur(5px); }
@starting-style { dialog.sheet[open]::backdrop { background: rgb(10 10 11 / 0); backdrop-filter: blur(0); } }

.sheet__bar {
  position: relative; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px var(--gutter) 10px;
  min-height: 62px;
}
.sheet__bar h2 { font: 400 28px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.sheet__bar .iconbtn { margin-left: auto; }
.sheet__grip { position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--gutter) 20px; }
.sheet__form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet__foot {
  flex: none;
  padding: 14px var(--gutter) calc(14px + var(--safe-b));
  border-top: 1px solid var(--line);
  display: grid; gap: 12px;
  background: var(--paper);
}
.sheet__foot:empty { display: none; }

/* Producto */
#productSheet .sheet__bar { position: absolute; inset: 0 0 auto 0; z-index: 2; pointer-events: none; }
#productSheet .sheet__bar .iconbtn { pointer-events: auto; background: var(--paper); }
#productSheet .sheet__body { padding: 0 0 0; }
.pd__media { background: var(--tile); aspect-ratio: 1 / .7; min-height: 0; overflow: hidden; display: grid; place-items: center; padding: 30px 40px 16px; }
.pd__media img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.pd__content { padding: 20px var(--gutter) 8px; display: grid; gap: 14px; }
.pd__cat { font: 600 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--red-deep); }
.pd__name { font: 400 clamp(34px, 10vw, 46px)/.98 var(--display); text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
.pd__price { font: 600 20px/1 var(--body); font-variant-numeric: tabular-nums; }
.pd__price small { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.pd__desc { color: #3b3a37; }
.pd__label { font: 600 13px/1 var(--body); margin-bottom: 10px; display: flex; justify-content: space-between; }
.pd__label i { font-style: normal; color: var(--red-deep); font-weight: 500; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sizes label { position: relative; }
.sizes input { position: absolute; opacity: 0; inset: 0; }
.sizes span {
  display: grid; place-items: center; height: 50px; border-radius: 12px;
  box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600;
  transition: box-shadow .15s, background .15s, color .15s;
}
.sizes input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.sizes input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.pd__buy { position: sticky; bottom: 0; background: var(--paper); padding: 12px var(--gutter) calc(14px + var(--safe-b)); display: flex; gap: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.pd__buy .btn { flex: 1; padding: 0 16px; }
.pd__notice { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.pd__notice b { font: 700 10px/1 var(--body); background: var(--ink); color: #fff; padding: 5px 7px; border-radius: 6px; letter-spacing: .08em; }

.stepper {
  display: inline-grid; grid-template-columns: 44px 30px 44px; align-items: center;
  height: 52px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line);
  flex: none;
}
.stepper button { height: 100%; display: grid; place-items: center; border-radius: 999px; }
.stepper button:active { background: var(--tile); }
.stepper svg { width: 18px; height: 18px; stroke-width: 2.2; }
.stepper output { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper--sm { grid-template-columns: 36px 26px 36px; height: 38px; }
.stepper--sm svg { width: 15px; height: 15px; }

/* Carrito */
.lines { display: grid; }
.line { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line__media { width: 76px; height: 76px; border-radius: 14px; background: var(--tile); padding: 8px; display: grid; place-items: center; }
.line__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.line__media .ph { font-size: 22px; }
.line__main { display: grid; gap: 8px; min-width: 0; }
.line__top { display: flex; justify-content: space-between; gap: 10px; }
.line__name { font-weight: 600; line-height: 1.25; }
.line__opt { color: var(--muted); font-size: 13.5px; }
.line__price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line__bottom { display: flex; justify-content: space-between; align-items: center; }
.linkbtn { font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.linkbtn:hover { color: var(--red-deep); }

.summary { display: grid; gap: 6px; font-size: 14.5px; }
.summary div { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.totalrow, .summary .summary__total { display: flex; justify-content: space-between; align-items: baseline; color: var(--ink); font-weight: 600; font-size: 16px; }
.totalrow strong, .summary__total strong { font: 400 28px/1 var(--display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }

.blank { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 46px 10px 30px; color: var(--muted); }
.blank__art { font: 400 84px/.9 var(--display); color: var(--tile); -webkit-text-stroke: 1.5px var(--line); text-transform: uppercase; }
.blank__title { font: 400 30px/1 var(--display); text-transform: uppercase; color: var(--ink); }
.blank .btn { margin-top: 12px; }

/* Checkout */
.field-group { padding: 16px 0 6px; display: grid; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.field-group:last-of-type { border-bottom: 0; }
.field-group legend { font: 400 20px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.field-group legend + * { clear: both; }
.field-group legend i, .field span i { font: 400 12px/1 var(--body); color: var(--muted); text-transform: none; letter-spacing: 0; font-style: normal; margin-left: 6px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 14px 16px;
  border: 0; border-radius: 14px; background: var(--tile);
  font-size: 16px; outline: 0; resize: none;
  transition: box-shadow .15s, background .15s;
}
.field input:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--ink); background: var(--paper); }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--red); }
.field__error { color: var(--red-deep); font-size: 13px; font-weight: 500; }

.choices { display: grid; gap: 8px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice__box {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  padding: 14px 16px; border-radius: 14px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .15s, background .15s;
}
.choice__box b { font-weight: 600; }
.choice__box small { grid-column: 1; color: var(--muted); font-size: 13.5px; }
.choice__box::after {
  content: ""; grid-row: 1 / span 2; grid-column: 2;
  width: 22px; height: 22px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .15s;
}
.choice input:checked + .choice__box { box-shadow: inset 0 0 0 2px var(--ink); background: var(--bone); }
.choice input:checked + .choice__box::after { box-shadow: inset 0 0 0 7px var(--ink); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--red); outline-offset: 2px; }

.switch { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 52px; height: 32px; border-radius: 16px; background: var(--line); position: relative; transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgb(0 0 0 / .2); transition: translate .25s var(--ease); }
.switch input:checked + .switch__track { background: var(--ink); }
.switch input:checked + .switch__track::after { translate: 20px 0; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--red); outline-offset: 2px; }
.switch__text { display: grid; }
.switch__text b { font-weight: 600; }
.switch__text small { color: var(--muted); font-size: 13.5px; }
.fiscal { display: grid; gap: 12px; }
.fiscal[hidden] { display: none; }
.fineprint { font-size: 13px; color: var(--muted); padding-top: 12px; }

/* Factura */
.ok {
  display: grid; justify-items: center; text-align: center; gap: 6px; padding: 6px 0 18px;
}
.ok__mark { width: 54px; height: 54px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; animation: pop .5s var(--ease) both; }
.ok__mark svg { width: 28px; height: 28px; stroke-width: 2.6; }
@keyframes pop { from { scale: .3; opacity: 0; } }
.ok .ok__title { font: 400 30px/1 var(--display); text-transform: uppercase; margin-top: 6px; color: var(--ink); max-width: none; }
.ok p { color: var(--muted); font-size: 14.5px; max-width: 32ch; }

.invoice {
  background: var(--bone); border-radius: 20px; padding: 22px 18px 20px;
  position: relative;
  font-size: 14px;
}
.invoice::before, .invoice::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px;
  background: radial-gradient(circle at 10px 0, var(--paper) 7px, transparent 7.5px) -10px 0 / 20px 10px repeat-x;
}
.invoice::before { top: 0; }
.invoice::after { bottom: 0; transform: scaleY(-1); }
.inv__head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px 0 16px; border-bottom: 1.5px dashed #cfccc2; }
.inv__logo { width: 52px; height: 52px; border-radius: 50%; background: var(--ink); }
.inv__head .inv__gym { font: 400 24px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); margin-bottom: 4px; }
.inv__head p { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.inv__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 16px 0; border-bottom: 1.5px dashed #cfccc2; }
.inv__meta dt { font: 600 10.5px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.inv__meta dd { font-weight: 600; overflow-wrap: anywhere; }
.inv__meta .wide { grid-column: 1 / -1; }
.inv__meta .inv__no { font: 400 30px/1 var(--display); letter-spacing: .04em; }
.inv__lines { width: 100%; border-collapse: collapse; margin: 12px 0 6px; }
.inv__lines th { font: 600 10.5px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 0 8px; }
.inv__lines td { padding: 7px 0; vertical-align: top; }
.inv__lines th:last-child, .inv__lines td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv__lines td small { display: block; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.inv__totals { border-top: 1.5px dashed #cfccc2; padding-top: 12px; display: grid; gap: 5px; }
.inv__totals div { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.inv__totals .grand { color: var(--ink); font-weight: 600; align-items: baseline; margin-top: 6px; }
.inv__totals .grand strong { font: 400 32px/1 var(--display); letter-spacing: .02em; }
.inv__status { display: grid; justify-items: start; gap: 8px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--paper); font-size: 13.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px; background: #fff1d6; color: #7a4b00; white-space: nowrap; }
.pill--ok { background: #dff3e4; color: #14602d; }
.pill--off { background: #ecebe6; color: #5d5c58; }
.order__state { grid-column: 1 / -1; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.inv__note { margin-top: 12px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn { padding: 0 12px; font-size: 15px; }
.actions .btn--wa { grid-column: 1 / -1; }

/* Pedidos */
.orders { display: grid; gap: 10px; padding-top: 6px; }
.order {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  width: 100%; text-align: left;
  padding: 16px; border-radius: 16px; background: var(--bone);
  transition: background .2s, transform .2s var(--ease);
}
.order:hover { background: var(--tile); }
.order:active { transform: scale(.985); }
.order__no { font: 400 20px/1 var(--display); letter-spacing: .04em; }
.order__total { font-weight: 600; font-variant-numeric: tabular-nums; }
.order__sub { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 60;
  translate: -50% 24px; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 12px 30px rgb(0 0 0 / .28);
  transition: translate .35s var(--ease), opacity .25s;
  white-space: nowrap;
}
.toast.is-on { translate: -50% 0; opacity: 1; pointer-events: auto; }
.toast span { overflow: hidden; text-overflow: ellipsis; }
.toast button { background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; height: 34px; padding: 0 14px; border-radius: 999px; flex: none; }

/* Transición entre filtros */
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: var(--ease); }

/* ───────── Escritorio ───────── */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 16px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { grid-template-columns: 1fr; row-gap: 10px; padding: 24px; }
  .steps b { grid-row: auto; }
  .tools { grid-template-columns: minmax(240px, 340px) 1fr; align-items: center; padding-inline: var(--gutter); }
  .tools .search, .tools .chips { margin: 0; padding-inline: 0; }
  .tools .search { padding: 0 16px; }
  .feature { flex-basis: 300px; }
  .footer { grid-template-columns: 1fr 1fr; align-items: start; }
  .footer__legal { grid-column: 1 / -1; }
}

@media (min-width: 960px) {
  :root { --gutter: 48px; --top-h: 64px; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .toast { bottom: 28px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { min-height: 560px; padding-block: 72px; }
  .hero__sub { font-size: 18px; }

  dialog.sheet {
    inset: 0 0 0 auto;
    width: 480px; height: 100dvh; max-height: 100dvh;
    border-radius: 26px 0 0 26px;
    translate: 100% 0;
  }
  dialog.sheet--tall { height: 100dvh; }
  @starting-style { dialog.sheet[open] { translate: 100% 0; } }
  .sheet__grip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .marquee__track { animation: none; }
}

/* ───────── Impresión: solo la factura ───────── */
@media print {
  body > *:not(#invoiceSheet) { display: none !important; }
  body { padding: 0; background: #fff; }
  dialog.sheet, dialog.sheet[open] {
    position: static; display: block; translate: none; transition: none;
    width: 100%; height: auto; max-height: none; border-radius: 0; overflow: visible;
  }
  dialog.sheet::backdrop { display: none; }
  .no-print, .ok { display: none !important; }
  .sheet__body { overflow: visible; padding: 0; }
  .invoice { background: #fff; border: 1px solid #bbb; border-radius: 0; max-width: 420px; margin: 0 auto; }
  .invoice::before, .invoice::after { display: none; }
  .inv__status { border: 1px solid #ccc; }
}
