/* =========================================================
   IVE Coacalco · Tienda
   Identidad: ../../marca/DESIGN.md (manda sobre este archivo)
   ========================================================= */
:root {
  /* Color */
  --bg: #000000;          /* Negro absoluto: base */
  --s1: #0c0c0c;          /* Franjas y secciones */
  --s2: #141414;          /* Tarjetas, paneles, diálogos */
  --s3: #1a1a1a;          /* Gris carbón: campos */
  --s4: #262626;          /* Hover de superficies */
  --line: #2b2b2b;
  --line-2: #3d3d3d;
  --fg: #ffffff;
  --fg-2: #c7c7c7;
  --fg-3: #a0a0a0;
  --red: #e60000;         /* Rojo carmesí: acciones, estado activo y dragón */
  --red-dark: #8a0000;    /* Rojo sangre: hover y presionado */
  --red-text: #ff4d4d;    /* Rojo legible para texto chico sobre negro */
  --photo: #ffffff;       /* Fondo de las fotos de proveedor */

  /* Letra */
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
  --brush: "Road Rage", "Bebas Neue", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Forma */
  --sk: -20deg;           /* Inclinación del trazo de «IVE» */
  --r: 4px;
  --wrap: 1240px;
  --gut: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 15px/1.5 var(--body); font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--line-2) var(--bg);
  caret-color: var(--red);
  accent-color: var(--red);
}
::selection { background: var(--red); color: #fff; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 400; }
svg { width: 1em; height: 1em; flex: none; }
.sprite { position: absolute; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
@media (min-width: 700px) { :root { --gut: 24px; } }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 16px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Botones: paralelogramo inclinado como el trazo del logo ---------- */
.btn {
  --b: var(--red); --c: #fff;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 28px;
  border: 0; background: none; color: var(--c);
  font: 700 14px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  transition: color .2s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--b); border-radius: 3px; transform: skewX(var(--sk));
  transition: background-color .2s, box-shadow .2s;
}
.btn svg { font-size: 18px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:focus-visible { outline: none; }
.btn:focus-visible::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.btn--red:hover, .btn--red:active { --b: var(--red-dark); }
.btn--ghost { --b: transparent; }
.btn--ghost::before { box-shadow: inset 0 0 0 1.5px var(--fg); }
.btn--ghost:hover { --b: var(--fg); --c: var(--bg); }
.btn:disabled { --b: var(--s4); --c: var(--fg-3); cursor: not-allowed; }
.btn--grow { flex: 1; }
.btn--block { display: flex; width: 100%; }

.link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 0;
  background: none; border: 0; color: var(--fg);
  font: 600 14px var(--body); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 6px;
}
.link:hover { text-decoration-color: var(--red); }
.link svg { font-size: 16px; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar__in { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 0; }
.brand img { width: 64px; height: auto; }
.brand__place { font: 22px/1 var(--display); letter-spacing: .14em; color: var(--fg-2); padding-top: 4px; }

.search { position: relative; display: block; max-width: 560px; width: 100%; justify-self: center; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; fill: none; stroke: var(--fg-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; height: 46px; padding: 0 14px 0 44px;
  background: var(--s3); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 15px; outline: none; transition: border-color .2s, background-color .2s;
}
.search input::placeholder { color: var(--fg-3); }
.search input:hover { border-color: var(--line-2); }
.search input:focus { border-color: var(--fg); background: var(--bg); }
.search input::-webkit-search-cancel-button { filter: invert(1); }

.cartbtn {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 22px; border: 0; background: none; color: #fff;
  font: 700 13px var(--body); letter-spacing: .08em; text-transform: uppercase;
}
.cartbtn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red); border-radius: 3px; transform: skewX(var(--sk)); transition: background-color .2s; }
.cartbtn:hover::before { background: var(--red-dark); }
.cartbtn svg { font-size: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cartbtn__n {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: inline-grid; place-items: center; background: #fff; color: #000;
  font: 700 12px/1 var(--body); font-variant-numeric: tabular-nums; letter-spacing: 0;
}
.cartbtn.bump { animation: bump .4s var(--ease); }

/* Cuenta de mayorista: acción secundaria junto al carrito (sin rojo: el rojo es del pedido) */
.topbar__end { display: flex; align-items: center; gap: 18px; }
.acctbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 4px;
  border: 0; background: none; color: var(--fg-2);
  font: 700 13px var(--body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  transition: color .2s;
}
.acctbtn svg { width: 20px; height: 20px; flex: none; }
.acctbtn:hover, .acctbtn[aria-expanded="true"] { color: var(--fg); }
.acctbtn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); border-radius: 2px; }
.acctbtn__label { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
.acctbtn.on { color: var(--fg); }
.maybar {
  margin: 0; padding: 7px var(--gut); border-top: 1px solid var(--line); background: var(--s1);
  text-align: center; font-size: 13px; color: var(--fg-2);
}
.maybar b { color: var(--fg); font-weight: 700; }
.maybar[hidden] { display: none; }

.acdlg { width: min(440px, 100% - 24px); }
.acdlg__lead { margin: 0; font-size: 14px; color: var(--fg-2); }
.acdlg form { display: grid; }
.acdlg .buy { margin-top: 22px; }
.acdlg__acts { flex-wrap: wrap; }
.acdlg__err { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--red-text); }
.acdlg__err[hidden] { display: none; }
.acdlg__note { margin: 18px 0 0; font-size: 13px; color: var(--fg-3); }
@keyframes bump { 35% { transform: translateY(-3px) scale(1.06); } }

/* ---------- Portada ---------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 0; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px; }
.hero h1 { display: grid; text-transform: uppercase; }
.hero__l1 { font: clamp(40px, 5.2vw, 4.5rem)/.92 var(--display); letter-spacing: .03em; }
.hero__l2 {
  font: clamp(84px, 11vw, 8.5rem)/.9 var(--brush); letter-spacing: .01em;
  margin-top: -.02em; padding-right: .2em;
  justify-self: start; transform: skewX(-12deg); transform-origin: left bottom;
  animation: stroke-in .9s var(--ease) .15s both;
}
.hero__lead { max-width: 46ch; margin: 18px 0 26px; color: var(--fg-2); font-size: clamp(15px, 1.4vw, 17px); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px 18px; padding-left: 8px; }
.hero__art { justify-self: end; width: 100%; max-width: 540px; padding: 4%; }
.hero__logo { width: 100%; height: auto; animation: stroke-in 1.1s var(--ease) both; }

/* Barrido inclinado a 20°, como una pincelada */
@keyframes stroke-in {
  from { clip-path: polygon(0 0, 0 0, -40% 100%, -40% 100%); }
  to   { clip-path: polygon(0 0, 140% 0, 100% 100%, -40% 100%); }
}

.ways {
  list-style: none; margin: clamp(28px, 4vw, 48px) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ways li { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: var(--fg-2); font-size: 14px; line-height: 1.3; }
.ways li + li::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 1px; background: var(--line-2); transform: skewX(var(--sk)); }
.ways svg { font-size: 30px; color: var(--fg); }
.ways b { display: block; font: 22px/1 var(--display); letter-spacing: .05em; color: var(--fg); text-transform: uppercase; margin-bottom: 3px; }

.promo { margin-top: 28px; }
.hero__banner { display: block; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); transition: border-color .2s; }
.hero__banner img { width: 100%; height: auto; transition: transform .6s var(--ease); }
.hero__banner:hover { border-color: var(--fg-3); }
.hero__banner:hover img { transform: scale(1.015); }

/* ---------- Encabezados de sección ---------- */
.deals, .catalog { padding: clamp(40px, 6vw, 72px) 0 0; }
.sechead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.sechead h2, .visit h2 { font: clamp(36px, 4.4vw, 56px)/.95 var(--display); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Carril de ofertas ---------- */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 216px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-bottom: 14px; margin: 0 calc(var(--gut) * -1); padding-inline: var(--gut); scroll-padding-inline: var(--gut);
  scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* ---------- Herramientas del catálogo ---------- */
.tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; font-weight: 500; color: var(--fg-2); cursor: pointer; user-select: none; }
.toggle input {
  appearance: none; width: 20px; height: 20px; margin: 0; flex: none;
  border: 1.5px solid var(--line-2); border-radius: 3px; background: var(--s3);
  display: grid; place-items: center; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.toggle input::after { content: ""; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .15s var(--ease); }
.toggle input:checked { background: var(--red); border-color: var(--red); }
.toggle input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.toggle input:checked + span { color: var(--fg); }
#sort, .field select {
  appearance: none; height: 40px; padding: 0 36px 0 12px;
  background: var(--s3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c7c7c7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; cursor: pointer;
}
#sort:hover { border-color: var(--line-2); }

/* Categorías: el marcador rojo inclinado señala la activa */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  min-height: 38px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--s2); color: var(--fg-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: border-color .2s, color .2s, background-color .2s;
}
.chip small { font-size: 11px; font-weight: 500; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--line-2); color: var(--fg); }
.chip::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px;
  background: var(--red); transform: skewX(var(--sk)) scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.chip[aria-pressed="true"] { color: var(--fg); background: var(--s3); border-color: var(--line-2); }
.chip[aria-pressed="true"] small { color: var(--fg-2); }
.chip[aria-pressed="true"]::after { transform: skewX(var(--sk)) scaleX(1); }

.resultinfo { margin: 0 0 14px; color: var(--fg-3); font-size: 13px; min-height: 1.5em; }

/* ---------- Tarjeta de producto ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--s2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: border-color .2s;
}
.card:hover { border-color: var(--line-2); }
.card__img { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--photo); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: contain; padding: 9%; transition: transform .5s var(--ease); }
.card:hover .card__img img { transform: scale(1.05); }
/* Producto sin foto: icono de pesas */
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: #f1f1f1; color: #9a9a9a; }
.ph svg { width: 42%; max-width: 120px; height: auto; aspect-ratio: 1; }

.badge {
  position: relative; padding: 4px 11px 2px;
  font: 18px/1 var(--display); letter-spacing: .04em; color: #fff; isolation: isolate; pointer-events: none;
}
.badge::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red); transform: skewX(var(--sk)); border-radius: 2px; }
.badges { position: absolute; z-index: 2; top: 10px; left: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; pointer-events: none; }
.badge--low { padding: 5px 10px 4px; font: 700 10px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; }
.badge--low::before { background: #000; }

.card__body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 12px 12px 14px; }
.card__cat { font-size: 12px; color: var(--fg-3); }
.card__name { font: 500 14px/1.35 var(--body); min-height: 2.7em; }
.card__name button {
  padding: 0; border: 0; background: none; text-align: left; color: var(--fg);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__name button:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fg-3); }
.card__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }

.price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; line-height: 1; }
.price b { font: 28px/1 var(--display); letter-spacing: .03em; font-weight: 400; font-variant-numeric: tabular-nums; }
.price .from { width: 100%; margin-bottom: 3px; font-size: 11px; font-weight: 500; color: var(--fg-3); }
.price s { font-size: 12px; color: var(--fg-3); }

.card__add, .cqty { position: relative; isolation: isolate; flex: none; height: 40px; border: 0; background: none; color: #fff; }
.card__add::before, .cqty::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red); border-radius: 3px; transform: skewX(var(--sk)); transition: background-color .2s; }
.card__add { width: 48px; display: grid; place-items: center; }
.card__add > svg { font-size: 20px; }
.card__add:hover::before { background: var(--red-dark); }
.card__add:focus-visible, .cqty button:focus-visible { outline: none; }
.card__add:focus-visible::before, .cqty:focus-within::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.card__n {
  position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; background: #fff; color: #000; font: 700 11px/1 var(--body); font-variant-numeric: tabular-nums;
}
.cqty { display: flex; align-items: center; padding: 0 4px; }
.cqty button { width: 32px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: #fff; }
.cqty button svg { font-size: 16px; }
.cqty button:hover { color: #ffd1d1; }
.cqty output { min-width: 18px; text-align: center; font: 700 14px/1 var(--body); font-variant-numeric: tabular-nums; }

.rail .card { height: 100%; }

/* ---------- Promociones (paquetes de varias piezas) ---------- */
.promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.pcard {
  position: relative; display: grid; grid-template-columns: 148px 1fr; min-width: 0;
  background: var(--s2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .2s;
}
.pcard:hover { border-color: var(--line-2); }
.pcard__img { display: grid; grid-auto-rows: 1fr; background: var(--photo); }
.pcard__img img { width: 100%; height: 100%; min-height: 0; object-fit: contain; padding: 10px; }
.pcard__img img + img { border-top: 1px solid #e6e6e6; }
.pcard__img .ph { min-height: 148px; }
.pcard__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 14px 16px; }
.pcard__body .badges { position: static; flex-direction: row; flex-wrap: wrap; }
.pcard__name { font: 26px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-wrap: balance; }
.pcard__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--fg-2); }
.pcard__list b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard__list .dim { color: var(--fg-3); }
.gift { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--red); border-radius: 2px; color: var(--red-text); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pcard__until { font-size: 12px; color: var(--fg-3); }
.pcard__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.pcard__foot .btn { white-space: nowrap; }

.prdlg { width: min(560px, 100% - 24px); }
.prdlg .pdlg__body { padding-top: 32px; }
.prpicks { display: grid; gap: 18px; }
.prpicks .fixed { margin: 0; font-size: 14px; color: var(--fg-2); }
.prpicks .fixed b { color: var(--fg); font-weight: 600; }

.noresults { grid-column: 1 / -1; padding: 56px 16px; text-align: center; color: var(--fg-2); border: 1px dashed var(--line-2); border-radius: var(--r); }
.noresults img { width: 72px; margin: 0 auto 12px; }
.noresults p { margin: 4px 0; }
.noresults p:first-child { font: 30px/1.1 var(--display); letter-spacing: .04em; color: var(--fg); text-transform: uppercase; }

.more { display: flex; justify-content: center; padding: 28px 0 0; }
.more .btn[hidden] { display: none; }

/* ---------- Visítanos ---------- */
.visit { margin-top: clamp(56px, 8vw, 96px); padding: clamp(40px, 6vw, 72px) 0; background: var(--s1); border-top: 1px solid var(--line); }
.visit__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 4vw, 56px); align-items: stretch; }
.info { margin: 24px 0 0; display: grid; gap: 18px; }
.info div { display: grid; gap: 4px; }
.info dt { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.info dt svg { font-size: 16px; color: var(--fg-2); }
.info dd { margin: 0; font-size: 16px; }
.info a { text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.info a:hover { text-decoration-color: var(--red); }
.visit h3 { margin: 36px 0 14px; font: 26px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.ship { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 16px; }
.ship li { display: flex; gap: 14px; align-items: flex-start; }
.ship svg { font-size: 26px; margin-top: 2px; }
.ship b { display: block; font-weight: 600; }
.ship span { color: var(--fg-2); font-size: 14px; }
.map { min-height: 360px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--s2); }
.map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; filter: grayscale(1) invert(.92) contrast(.88); }

/* ---------- Pie ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 0 100px; }
.foot__in { display: flex; align-items: center; gap: 20px; }
.foot img { width: 64px; height: auto; flex: none; }
.foot p { margin: 0; color: var(--fg-3); font-size: 13px; max-width: 80ch; }

/* ---------- WhatsApp flotante ---------- */
.wafab {
  position: fixed; right: 20px; bottom: 20px; z-index: 25; isolation: isolate;
  width: 60px; height: 54px; display: grid; place-items: center; color: #fff;
}
.wafab::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red); border-radius: 4px; transform: skewX(var(--sk)); box-shadow: 0 8px 20px rgba(0, 0, 0, .55); transition: background-color .2s; }
.wafab:hover::before { background: var(--red-dark); }
.wafab svg { font-size: 28px; }
.wafab:focus-visible { outline: none; }
.wafab:focus-visible::before { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }

/* ---------- Diálogos ---------- */
dialog { padding: 0; color: var(--fg); background: var(--s2); border: 1px solid var(--line-2); }
dialog::backdrop { background: rgba(0, 0, 0, .78); }
.x {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: var(--r); background: #000; color: #fff;
}
.x svg { font-size: 20px; }
.x:hover { background: var(--s4); }

.pdlg { width: min(960px, 100% - 24px); max-width: none; max-height: calc(100dvh - 24px); border-radius: 6px; overflow: auto; overscroll-behavior: contain; }
.pdlg[open] { animation: rise .35s var(--ease); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.pdlg__grid { display: grid; grid-template-columns: 1fr 1fr; }
.zoom { position: relative; background: var(--photo); overflow: hidden; }
.pdlg__img { aspect-ratio: 1; display: grid; place-items: center; }
.pdlg__img img { width: 100%; height: 100%; object-fit: contain; padding: 24px; transition: transform .2s ease-out; }
.pdlg__img .ph { aspect-ratio: 1; }
.zoom.can { cursor: zoom-in; }
.zoom.on { cursor: zoom-out; touch-action: none; }
.zoom.on img { transform: scale(var(--z, 2.5)); transition: transform .2s ease-out, transform-origin 0s; }
.zoom__hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 7px 12px; border-radius: 3px; background: rgba(0, 0, 0, .82); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; transition: opacity .2s; }
.zoom__hint:empty, .zoom.on .zoom__hint { opacity: 0; }
.pdlg__body { display: flex; flex-direction: column; gap: 14px; padding: 36px 30px 30px; }
.pdlg__cat { margin: -4px 0 0; font-size: 13px; color: var(--fg-3); }
.pdlg__body h2 { font: clamp(30px, 3.4vw, 42px)/1 var(--display); letter-spacing: .03em; text-transform: uppercase; padding-right: 40px; text-wrap: balance; }
.pdlg__body .price b { font-size: 40px; }
.pdlg__body .price s { font-size: 14px; }
.pdlg__desc { margin: 0; color: var(--fg-2); font-size: 14px; white-space: pre-line; max-width: 65ch; }
.pdlg__desc:empty { display: none; }

.variants { margin: 0; padding: 0; border: 0; min-width: 0; }
.variants legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.variants__list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 220px; overflow: auto; padding: 2px; }
.vopt { position: relative; }
.vopt input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.vopt span, .seg span {
  display: block; padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 3px;
  background: var(--s3); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.vopt span:hover, .seg span:hover { border-color: var(--fg-3); }
.vopt input:checked + span, .seg input:checked + span { border-color: var(--red); background: #2a0000; color: #fff; box-shadow: inset 0 0 0 1px var(--red); }
.vopt input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.vopt input:disabled + span { color: var(--fg-3); text-decoration: line-through; cursor: not-allowed; opacity: .55; }

.stock { margin: 0; font-size: 13px; color: var(--fg-2); }
.stock:empty { display: none; }
.stock.low { color: var(--red-text); font-weight: 600; }
.buy { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.buy .btn { white-space: nowrap; padding: 0 20px; }
.qty { display: inline-flex; align-items: center; height: 48px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--s3); }
.qty button { width: 42px; height: 100%; display: grid; place-items: center; border: 0; background: none; color: var(--fg); }
.qty button svg { font-size: 16px; }
.qty button:hover { background: var(--s4); }
.qty output { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Carrito */
.drawer {
  margin: 0 0 0 auto; width: min(440px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh;
  border-width: 0 0 0 1px; display: none; flex-direction: column;
}
.drawer[open] { display: flex; animation: slide .35s var(--ease); }
@keyframes slide { from { transform: translateX(48px); opacity: 0; } }
.drawer__head { position: relative; padding: 22px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font: 36px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.drawer__head .x { top: 14px; right: 14px; background: var(--s3); }
.drawer__body { flex: 1; overflow: auto; padding: 4px 22px 24px; overscroll-behavior: contain; }
.drawer__foot { padding: 16px 22px 20px; border-top: 1px solid var(--line); background: var(--bg); }
.drawer__foot[hidden], .checkout[hidden], .empty[hidden] { display: none; }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line__img { width: 64px; height: 64px; background: var(--photo); border-radius: 3px; overflow: hidden; }
.line__img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.line__img .ph svg { width: 60%; }
.line__name { font-size: 14px; font-weight: 500; line-height: 1.35; }
.line__var { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.line__ctrl { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.line__ctrl .qty { height: 34px; }
.line__ctrl .qty button { width: 32px; }
.line__ctrl .qty button svg { font-size: 14px; }
.line__ctrl .qty output { min-width: 22px; font-size: 13px; }
.line__rm { padding: 4px 0; border: 0; background: none; color: var(--fg-3); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.line__rm:hover { color: var(--fg); }
.line__price { font: 24px/1 var(--display); letter-spacing: .03em; font-variant-numeric: tabular-nums; }

.empty { padding: 56px 12px; text-align: center; color: var(--fg-2); display: grid; justify-items: center; gap: 4px; }
.empty img { width: 96px; margin-bottom: 8px; }
.empty p { margin: 0 0 16px; }

.checkout h3 { margin: 22px 0 12px; font: 26px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg span { height: 100%; display: grid; place-items: center; text-align: center; padding: 10px 6px; font-weight: 600; line-height: 1.25; }
.hint { margin: 10px 0 0; font-size: 13px; color: var(--fg-3); }
.field { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.field[hidden] { display: none; }
.field small { font-weight: 400; color: var(--fg-3); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--s3); color: var(--fg); font-size: 15px; font-weight: 400; outline: none; transition: border-color .15s;
}
.field select { height: 46px; }
.field textarea { resize: vertical; }
.field ::placeholder { color: var(--fg-3); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--fg); }
.field.err input, .field.err textarea { border-color: var(--red-text); box-shadow: inset 0 0 0 1px var(--red-text); }

.totals { display: grid; gap: 6px; margin-bottom: 14px; }
.totals > div { display: flex; justify-content: space-between; align-items: baseline; }
.totals b { font-variant-numeric: tabular-nums; }
.totals > div:first-child b { font: 32px/1 var(--display); letter-spacing: .03em; font-weight: 400; }
.savings span, .savings b { color: var(--fg); font-size: 14px; }
.savings b { font-weight: 700; }
.muted { color: var(--fg-3); font-size: 13px; }
.drawer__foot .btn svg { font-size: 20px; }
.fine { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--fg-3); }

/* ---------- Aviso ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100% - 32px);
  padding: 13px 18px; border-radius: var(--r); background: var(--fg); color: var(--bg);
  font-size: 14px; font-weight: 600; pointer-events: none;
  transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s .35s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .35s var(--ease); }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .visit__grid { grid-template-columns: 1fr; }
  .pdlg__grid { grid-template-columns: 1fr; }
  .pdlg__img { max-height: 50vh; width: 100%; }
  .pdlg__body { padding: 22px 18px 24px; }
}
@media (max-width: 640px) {
  .topbar__in { grid-template-columns: 1fr auto; grid-template-areas: "brand cart" "search search"; gap: 4px 12px; padding-bottom: 10px; min-height: 0; }
  .brand { grid-area: brand; }
  .brand img { width: 56px; }
  .brand__place { font-size: 19px; }
  .search { grid-area: search; max-width: none; }
  .topbar__end { grid-area: cart; gap: 12px; }
  .cartbtn { padding: 0 18px; height: 42px; }
  .cartbtn__label { display: none; }
  .acctbtn { height: 42px; min-width: 42px; justify-content: center; }
  .acctbtn svg { width: 24px; height: 24px; }
  .acctbtn__label { display: none; }
  html { scroll-padding-top: 128px; }

  .hero__l1 { font-size: clamp(40px, 12vw, 52px); }
  .hero__l2 { font-size: clamp(76px, 22vw, 96px); }
  .hero { padding-top: 20px; }
  .hero__lead { margin: 10px 0 18px; font-size: 14px; }
  .hero__cta { gap: 12px; }
  .hero__cta .btn { flex: 1; padding: 0 14px; font-size: 13px; letter-spacing: .04em; white-space: nowrap; }
  .sechead h2 { font-size: 34px; }
  .ways { margin-top: 20px; }
  .ways li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 8px 10px 14px; font-size: 12px; }
  .ways li:first-child { padding-left: 0; }
  .ways svg { font-size: 24px; }
  .ways b { font-size: 17px; }
  .promo { margin-top: 14px; }
  .deals { padding-top: 28px; }
  .sechead { margin-bottom: 14px; }

  .rail { grid-auto-columns: 46%; gap: 10px; }
  .pcard { grid-template-columns: 112px 1fr; }
  .pcard__name { font-size: 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card__body { padding: 10px 10px 12px; }
  .card__name { font-size: 13px; }
  .price b { font-size: 24px; }
  .card__add { width: 42px; height: 38px; }
  .cqty { height: 38px; padding: 0 2px; }
  .cqty button { width: 26px; }
  .badges { top: 8px; left: 10px; }
  .badge { font-size: 16px; }
  .badge--low { font-size: 9px; }

  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gut) * -1) 16px; padding: 0 var(--gut) 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .tools { width: 100%; justify-content: space-between; }

  .buy { gap: 12px; }
  .buy .btn { font-size: 13px; letter-spacing: .03em; padding: 0 14px; }
  .drawer { width: 100%; border: 0; }
  .wafab { right: 14px; bottom: 14px; width: 54px; height: 50px; }
  .foot__in { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
