/* Nido — tienda de ejemplo de MasWeb Studio.
   Paleta de avena, barro y salvia; Fraunces para títulos y DM Sans para texto.
   Todo lo que se mueve vive adentro de `prefers-reduced-motion: no-preference`. */

:root {
  --paper: #f4eee5;
  --paper-2: #ece3d5;
  --surface: #fbf8f3;
  --ink: #2b2621;
  --ink-soft: #6b6157;
  --line: rgb(43 38 33 / 0.12);
  --line-strong: rgb(43 38 33 / 0.22);
  --clay: #8e5334;
  --clay-soft: #e8d3c3;
  --sage: #6f7d62;
  --sage-soft: #dfe3d6;
  --butter: #efe2c4;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 18px;
  --radius-lg: 28px;
  --arch: 999px 999px var(--radius) var(--radius);
  --shadow-soft: 0 1px 2px rgb(60 40 20 / 0.06), 0 8px 24px -12px rgb(60 40 20 / 0.18);
  --shadow-lift: 0 2px 4px rgb(60 40 20 / 0.06), 0 24px 48px -20px rgb(60 40 20 / 0.32);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 82rem;

  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }

/* El grano de papel va en el fondo del body y no en una capa fija con
   `mix-blend-mode` encima de todo: esa capa obligaba a recomponer la página
   entera en cada frame del scroll (en Chrome headless colgaba la captura). */
body {
  margin: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .32 0 0 0 0 .25 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

em {
  font-style: italic;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--clay);
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Avisos de arriba ---------- */

.demo-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.5rem var(--gutter);
  background: var(--ink);
  color: #f4eee5;
  font-size: 0.8rem;
  text-align: center;
}
.demo-ribbon a { color: #f1d9c4; }
.demo-ribbon__dot {
  flex: none;
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: #e2a77f;
}

.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.marquee__track {
  display: flex;
  gap: 1.6rem;
  width: max-content;
  padding: 0.55rem 0;
  white-space: nowrap;
}
.marquee__track span[aria-hidden="true"]:not(:empty) { color: var(--clay); }

/* ---------- Encabezado ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(244 238 229 / 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.header[data-scrolled] { border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgb(60 40 20 / 0.5); }

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
}
.logo__mark { width: 1.9rem; height: 1.9rem; color: var(--clay); }
.logo__word {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variation-settings: "SOFT" 100;
}

.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: background-color 0.25s, color 0.25s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }

.cart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.cart-button:hover { border-color: var(--ink); box-shadow: var(--shadow-soft); }
.cart-button svg { width: 1.3rem; height: 1.3rem; }
.cart-button__count[hidden] { display: none; }
.cart-button__count {
  display: grid;
  place-items: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---------- Botones ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.button--solid { background: var(--ink); color: var(--surface); }
.button--solid:hover { background: var(--clay); box-shadow: var(--shadow-lift); }
.button--clay { background: var(--clay); color: #fff; }
.button--clay:hover { background: #7a4529; box-shadow: var(--shadow-lift); }
.button--ghost { border-color: var(--line-strong); background: transparent; }
.button--ghost:hover { border-color: var(--ink); background: var(--surface); }
.button--block { width: 100%; }
.button[disabled],
.button[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.icon-button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.2s;
}
.icon-button:hover { background: var(--paper-2); }
.icon-button svg { width: 1.3rem; height: 1.3rem; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 50, "opsz" 144;
}
.section-title--small { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.section-lead { color: var(--ink-soft); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: 2rem;
}
.section-head .eyebrow { margin-bottom: 0.6rem; }
.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}

/* ---------- Portada ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  align-items: center;
}

.hero__title {
  margin: 1rem 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7.4vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 350;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  text-wrap: balance;
}

.hero__lead {
  max-width: 32rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.hero__perks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 2.25rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.hero__perks li { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero__perks svg { width: 1.15rem; height: 1.15rem; color: var(--sage); }

.hero__visual { position: relative; padding: 0 0 2.5rem 0; }

.hero__arch {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--arch);
  background: var(--paper-2);
  box-shadow: var(--shadow-lift);
}
.hero__arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }

.hero__polaroid {
  position: absolute;
  right: -0.5rem;
  top: 12%;
  width: 34%;
  padding: 0.45rem 0.45rem 1.6rem;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  rotate: 4deg;
}
.hero__polaroid img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: 3px; }

.hero__chip {
  position: absolute;
  left: 0.75rem;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem 0.45rem 0.45rem;
  border: 1px solid rgb(255 255 255 / 0.6);
  border-radius: 999px;
  background: rgb(251 248 243 / 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lift);
  text-align: left;
  transition: transform 0.4s var(--ease);
}
.hero__chip img { width: 2.8rem; height: 2.8rem; border-radius: 50%; object-fit: cover; }
.hero__chip span { display: grid; font-size: 0.92rem; font-weight: 500; line-height: 1.25; }
.hero__chip small { font-size: 0.72rem; font-weight: 400; color: var(--ink-soft); }
.hero__chip svg { width: 1.1rem; height: 1.1rem; color: var(--clay); }
.hero__chip:hover { transform: translateY(-3px); }

@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 4rem; }
  .hero__visual { padding: 0 2rem 3rem 0; }
  .hero__polaroid { right: -1rem; width: 36%; }
  .hero__chip { left: -2rem; bottom: 1.25rem; }
}

/* ---------- Categorías ---------- */

.categories {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem);
}
.categories__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 48rem) { .categories__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; } }

.category {
  display: grid;
  gap: 0.8rem;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
}
.category__image {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: var(--arch);
  background: var(--paper-2);
}
.category__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.category:hover .category__image img { transform: scale(1.06); }
.category__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-variation-settings: "SOFT" 80;
}
.category__name small { display: block; font-family: var(--font-sans); font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Colección ---------- */

.shop {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  border-top: 1px solid var(--line);
}

.shop__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 0.9rem;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.sort select {
  min-height: 2.5rem;
  padding: 0.45rem 2.2rem 0.45rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%232b2621' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.7rem center / 1rem;
  appearance: none;
  font-size: 0.9rem;
}

.shop__count { margin: -0.75rem 0 1.5rem; font-size: 0.88rem; color: var(--ink-soft); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1rem;
}
@media (min-width: 48rem) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.75rem 1.5rem; } }
@media (min-width: 72rem) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card { position: relative; display: grid; gap: 0.85rem; align-content: start; }
.card[hidden] { display: none; }

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--paper-2);
}
.card__open {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  border-radius: inherit;
  background: none;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), opacity 0.6s;
}
.card:hover .card__media img { transform: scale(1.05); }

.card__badge {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  z-index: 2;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgb(251 248 243 / 0.9);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.card__add {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.25s, color 0.25s, opacity 0.35s, translate 0.45s var(--ease);
}
.card__add svg { width: 1rem; height: 1rem; }
.card__add:hover { background: var(--ink); color: var(--surface); }
.card__add-label { display: none; }
@media (min-width: 48rem) { .card__add-label { display: inline; } }
@media (hover: hover) and (min-width: 48rem) {
  .card__add { opacity: 0; translate: 0 0.6rem; }
  .card:hover .card__add,
  .card:focus-within .card__add { opacity: 1; translate: 0 0; }
}

.card__info { display: grid; gap: 0.15rem; }
.card__name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.25;
  font-variation-settings: "SOFT" 80;
}
.card__short { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.45; }
.card__price { margin-top: 0.3rem; font-weight: 500; }
.card__price small { font-weight: 400; color: var(--ink-soft); font-size: 0.8rem; }
.card__price small::before { content: "· "; }

/* ---------- Rincones ---------- */

.rincones { padding: clamp(3rem, 6vw, 5rem) 0; background: var(--surface); }
.rincones .section-head { padding: 0 var(--gutter); }

.rincones__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(78vw, 22rem);
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.5rem max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 1.5rem;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}

.rincon { scroll-snap-align: start; display: grid; gap: 0.9rem; align-content: start; }
.rincon__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  background: var(--paper-2);
}
.rincon__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.rincon:hover .rincon__media img { transform: scale(1.04); }
.rincon__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem 1.2rem 1.1rem;
  background: linear-gradient(to top, rgb(30 24 18 / 0.62), transparent);
  color: #fbf8f3;
}
.rincon__caption h3 { font-family: var(--font-display); font-size: 1.5rem; font-variation-settings: "SOFT" 100; }
.rincon__caption p { font-size: 0.88rem; opacity: 0.9; }
.rincon__items { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rincon__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.83rem;
  transition: border-color 0.2s, background-color 0.2s;
}
.rincon__item:hover { border-color: var(--ink); background: var(--surface); }
.rincon__item img { width: 1.9rem; height: 1.9rem; border-radius: 50%; object-fit: cover; }

/* ---------- El taller ---------- */

.taller {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
  align-items: center;
}
.taller__image { overflow: hidden; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); }
.taller__image img { width: 100%; height: 100%; object-fit: cover; }
.taller__text { display: grid; gap: 1.1rem; max-width: 34rem; }
.taller__text p:not(.eyebrow) { color: var(--ink-soft); font-size: 1.05rem; }
.taller__small {
  justify-self: start;
  width: 46%;
  margin-top: 0.75rem;
  overflow: hidden;
  border-radius: var(--arch);
  aspect-ratio: 3 / 4;
}
.taller__small img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 60rem) {
  .taller { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); gap: 5rem; }
}

/* ---------- Medios de pago ---------- */

.pagos {
  max-width: var(--max);
  margin: 0 auto clamp(3rem, 6vw, 5rem);
  padding: clamp(2rem, 4vw, 3rem) var(--gutter);
  text-align: center;
}
.pagos__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 2rem;
  text-align: left;
}
.pagos__list li {
  display: grid;
  gap: 0.35rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.pagos__list span:not(.pagos__icon) { font-size: 0.9rem; color: var(--ink-soft); }
.pagos__icon {
  display: grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  margin-bottom: 0.4rem;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage);
}
.pagos__icon svg { width: 1.3rem; height: 1.3rem; }

/* ---------- Pie ---------- */

.footer { background: var(--ink); color: #e9e1d5; }
.footer__inner {
  display: grid;
  gap: 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter);
}
.footer .logo { color: #fbf8f3; }
.footer p { font-size: 0.92rem; }
.footer a { color: #f1d9c4; }
.footer__demo { display: grid; gap: 0.9rem; max-width: 40rem; }
.footer__credits { font-size: 0.78rem !important; opacity: 0.7; }
.footer__cta { justify-self: start; background: #fbf8f3; color: var(--ink) !important; }
.footer__cta:hover { background: #f1d9c4; }
@media (min-width: 60rem) { .footer__inner { grid-template-columns: 1fr 2fr auto; align-items: start; } }

/* ---------- Diálogos ---------- */

dialog {
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
}
dialog::backdrop { background: rgb(30 24 18 / 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
html:has(dialog[open]) { overflow: hidden; }

.sheet {
  width: min(100% - 1.5rem, 62rem);
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.sheet--checkout { width: min(100% - 1.5rem, 58rem); }
.sheet--result { width: min(100% - 1.5rem, 30rem); }

@media (max-width: 40rem) {
  .sheet {
    width: 100%;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* La cruz ocupa la primera fila de la grilla de cada ventana, de ancho
   completo, y con el margen negativo esa fila no suma alto: queda encima de
   la foto o del formulario sin correr nada. */
.sheet__close {
  position: sticky;
  top: 0.75rem;
  z-index: 3;
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: end;
  margin: 0.75rem 0.75rem -3.5rem 0;
  background: rgb(251 248 243 / 0.9);
  box-shadow: var(--shadow-soft);
}

/* Ficha de producto */
.product { display: grid; grid-template-columns: minmax(0, 1fr); }
.product__media { grid-row: 2; overflow: hidden; aspect-ratio: 4 / 5; background: var(--paper-2); }
.product__media img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.6s var(--ease); }
.product__media[data-zoom] img { transform: scale(1.6); cursor: zoom-out; }
.product__info { grid-row: 3; display: grid; gap: 1.1rem; align-content: start; padding: clamp(1.4rem, 4vw, 2.6rem); }
.product__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 80, "opsz" 144;
}
.product__price { font-size: 1.35rem; font-weight: 500; }
.product__price small { display: block; font-size: 0.85rem; font-weight: 400; color: var(--sage); }
.product__desc { color: var(--ink-soft); }
.product__buy { display: flex; gap: 0.75rem; }
.product__buy .button { flex: 1; white-space: nowrap; }
.product__details { border-top: 1px solid var(--line); }
.product__details details { border-bottom: 1px solid var(--line); }
.product__details summary {
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 0;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.product__details summary::-webkit-details-marker { display: none; }
.product__details summary::after { content: "+"; font-size: 1.2rem; line-height: 1; color: var(--clay); transition: rotate 0.3s var(--ease); }
.product__details details[open] summary::after { rotate: 45deg; }
.product__details dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0 0 1rem; font-size: 0.92rem; }
.product__details dt { color: var(--ink-soft); }
.product__details dd { margin: 0; }
.product__note { font-size: 0.85rem; color: var(--ink-soft); }
.product__related h3 { margin-bottom: 0.75rem; font-family: var(--font-display); font-size: 1.15rem; }
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.related button { display: grid; gap: 0.4rem; padding: 0; border: 0; background: none; text-align: left; font-size: 0.82rem; }
.related img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 12px; transition: transform 0.5s var(--ease); }
.related button:hover img { transform: scale(1.04); }
@media (min-width: 48rem) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .product__info { grid-row: 2; }
  .product__media { aspect-ratio: auto; min-height: 100%; position: sticky; top: 0; max-height: calc(100dvh - 1.5rem); }
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.stepper button {
  display: grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.1rem;
}
.stepper button:hover { background: var(--paper-2); }
.stepper output { min-width: 1.6rem; text-align: center; font-weight: 500; }
.stepper--small button { width: 2.1rem; height: 2.1rem; }

/* Carrito */
.drawer {
  width: min(100%, 27rem);
  height: 100dvh;
  margin: 0 0 0 auto;
  display: none;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.drawer[open] { display: flex; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.drawer__head h2 { font-family: var(--font-display); font-size: 1.5rem; }
.drawer__body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 0.5rem 1.5rem; }
.drawer__foot { display: grid; gap: 0.9rem; padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.drawer__foot:empty { display: none; }

.line {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.line img { width: 4.6rem; height: 5.75rem; object-fit: cover; border-radius: 10px; }
.line__top { display: flex; justify-content: space-between; gap: 0.5rem; }
.line__name { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.25; }
.line__unit { font-size: 0.8rem; color: var(--ink-soft); }
.line__bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 0.6rem; }
.line__remove { padding: 0.25rem 0; border: 0; background: none; font-size: 0.8rem; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.line__remove:hover { color: var(--clay); }

.free-ship { display: grid; gap: 0.45rem; font-size: 0.85rem; }
.free-ship__bar { height: 0.4rem; overflow: hidden; border-radius: 999px; background: var(--paper-2); }
.free-ship__bar span { display: block; height: 100%; width: var(--progress, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--sage), #8fa07f); transition: width 0.6s var(--ease); }
.free-ship strong { color: var(--sage); font-weight: 500; }

.totals { display: grid; gap: 0.35rem; font-size: 0.95rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals dt { color: var(--ink-soft); }
.totals dd { margin: 0; }
.totals .totals__total { padding-top: 0.6rem; margin-top: 0.3rem; border-top: 1px solid var(--line); font-size: 1.15rem; font-weight: 600; }
.totals .totals__total dt { color: var(--ink); }

.empty { display: grid; justify-items: center; gap: 1rem; padding: 3rem 0.5rem; text-align: center; }
.empty img { width: 9rem; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--arch); }
.empty h3 { font-family: var(--font-display); font-size: 1.4rem; }
.empty p { color: var(--ink-soft); font-size: 0.92rem; }

/* Checkout */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr); }
.checkout__main { grid-row: 2; display: grid; gap: 1.5rem; align-content: start; padding: clamp(1.4rem, 4vw, 2.5rem); }
.checkout__aside { grid-row: 3; padding: clamp(1.4rem, 4vw, 2.5rem); background: var(--paper); }
.checkout__aside h3 { margin-bottom: 1rem; font-family: var(--font-display); font-size: 1.2rem; }
@media (min-width: 52rem) {
  .checkout { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .checkout__aside { grid-row: 2; }
  .checkout__aside { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
}
.checkout__title { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -0.02em; }
.steps { display: flex; gap: 0.5rem; font-size: 0.82rem; color: var(--ink-soft); }
.steps span { display: inline-flex; align-items: center; gap: 0.4rem; }
.steps span::before { content: attr(data-n); display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 0.72rem; }
.steps span[aria-current="step"] { color: var(--ink); font-weight: 500; }
.steps span[aria-current="step"]::before { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.steps span[data-done]::before { content: "✓"; background: var(--sage); border-color: var(--sage); color: #fff; }
.steps i { flex: 0 0 1.5rem; align-self: center; height: 1px; background: var(--line-strong); }

.fieldset { display: grid; gap: 0.75rem; margin: 0; padding: 0; border: 0; }
.fieldset legend { margin-bottom: 0.75rem; padding: 0; font-weight: 500; }

.option {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.option:hover { border-color: var(--ink); }
.option:has(input:checked) { border-color: var(--clay); background: #fdf7f2; box-shadow: 0 0 0 1px var(--clay); }
.option:has(input:focus-visible) { outline: 2px solid var(--clay); outline-offset: 2px; }
.option input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--clay); }
.option strong { display: block; font-weight: 500; }
.option small { color: var(--ink-soft); font-size: 0.84rem; }
.option__price { font-weight: 500; font-size: 0.92rem; }
.option__icon { width: 1.6rem; height: 1.6rem; color: var(--clay); }

.field { display: grid; gap: 0.35rem; font-size: 0.9rem; }
.field input {
  min-height: 3rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgb(142 83 52 / 0.15); }
.field input:user-invalid { border-color: #b3452d; }
.field-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }
.hint { font-size: 0.82rem; color: var(--ink-soft); }
.error-text { color: #a43a24; font-size: 0.9rem; }
.field input[aria-invalid="true"] { border-color: #b3452d; }
.field .error-text { font-size: 0.84rem; }

.checkout__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.link-button { padding: 0.5rem 0; border: 0; background: none; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--ink); }

.mini-lines { display: grid; gap: 0.8rem; margin-bottom: 1.25rem; }
.mini-line { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; font-size: 0.88rem; }
.mini-line img { width: 3.2rem; height: 3.2rem; object-fit: cover; border-radius: 10px; }
.mini-line__qty { position: relative; }
.mini-line__qty b {
  position: absolute; top: -0.4rem; right: -0.4rem;
  display: grid; place-items: center;
  min-width: 1.25rem; height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--ink-soft);
  color: #fff;
  font-size: 0.68rem;
}

.paybox { display: grid; gap: 1rem; padding: 1.25rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.paybox__qr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.paybox__qr img { width: 9.5rem; height: 9.5rem; padding: 0.4rem; border-radius: 14px; background: #fff; box-shadow: var(--shadow-soft); }
@media (max-width: 30rem) { .paybox__qr { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 12px; background: var(--surface); font-size: 0.92rem; }
.copy-row code { font-family: inherit; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; }
.copy-row button { flex: none; padding: 0.35rem 0.8rem; border: 1px solid var(--line-strong); border-radius: 999px; background: none; font-size: 0.8rem; }
.copy-row button:hover { border-color: var(--ink); }
.copy-row .button { flex: none; white-space: nowrap; }
.badge-demo { display: inline-flex; align-self: start; justify-self: start; padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--butter); font-size: 0.75rem; font-weight: 500; }

/* Pasarela simulada y resultado */
.result { display: grid; justify-items: center; gap: 1rem; padding: clamp(1.8rem, 5vw, 2.6rem); text-align: center; }
.result h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
.result p { color: var(--ink-soft); }
.result__icon { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--sage-soft); color: var(--sage); }
.result__icon--error { background: #f3dcd3; color: #a43a24; }
.result__icon--wait { background: var(--butter); color: #8a6a1f; }
.result__icon svg { width: 2.2rem; height: 2.2rem; }
.result__code { padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--paper); font-weight: 600; letter-spacing: 0.06em; }
.result .totals, .result .mini-lines { width: 100%; text-align: left; }
.result__actions { display: grid; gap: 0.6rem; width: 100%; }
.gateway { width: 100%; display: grid; gap: 0.8rem; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); text-align: left; }
.gateway__row { display: flex; justify-content: space-between; font-size: 0.92rem; }
.gateway__card { display: grid; gap: 0.2rem; padding: 0.9rem 1rem; border-radius: 12px; background: linear-gradient(135deg, #2b2621, #5a4a3c); color: #f4eee5; font-size: 0.85rem; letter-spacing: 0.08em; }

/* Aviso de "agregado" */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.5rem 0.6rem 0.5rem 0.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-lift);
  font-size: 0.9rem;
  translate: -50% 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, translate 0.45s var(--ease), visibility 0.35s;
}
.toast[data-show] { opacity: 1; visibility: visible; }
.toast img { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; object-fit: cover; }
.toast span { min-width: 0; line-height: 1.35; }
.toast button { flex: none; white-space: nowrap; padding: 0.45rem 0.9rem; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 0.82rem; font-weight: 500; }

.noscript { padding: 2rem; border-radius: var(--radius); background: var(--surface); text-align: center; }

/* ---------- Movimiento ---------- */

@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 48s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
  @keyframes marquee { to { transform: translateX(-50%); } }

  .reveal { opacity: 0; translate: 0 18px; transition: opacity 0.9s var(--ease), translate 0.9s var(--ease); }
  .reveal[data-visible] { opacity: 1; translate: 0 0; }

  .hero__arch img { animation: settle 1.8s var(--ease) both; }
  @keyframes settle { from { transform: scale(1.08); } }
  .hero__polaroid { animation: drop 1.1s 0.5s var(--ease) both; }
  @keyframes drop { from { opacity: 0; translate: 0 -24px; rotate: -2deg; } }
  .hero__chip { animation: rise 0.9s 0.8s var(--ease) both; }
  @keyframes rise { from { opacity: 0; translate: 0 16px; } }

  .card { animation: card-in 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
  @keyframes card-in { from { opacity: 0; translate: 0 14px; } }

  .card__media img[data-loading],
  .rincon__media img[data-loading],
  .category__image img[data-loading] { opacity: 0; }

  .sheet[open] { animation: sheet-in 0.5s var(--ease); }
  @keyframes sheet-in { from { opacity: 0; translate: 0 24px; scale: 0.98; } }
  .drawer[open] { animation: drawer-in 0.5s var(--ease); }
  @keyframes drawer-in { from { translate: 100% 0; } }
  dialog[open]::backdrop { animation: fade 0.4s ease; }
  @keyframes fade { from { opacity: 0; } }

  .cart-button[data-bump] { animation: bump 0.55s var(--ease); }
  @keyframes bump { 40% { scale: 1.12; } }

  .line { animation: card-in 0.45s var(--ease) both; }

  .result__icon svg path { stroke-dasharray: 40; animation: draw 0.8s 0.2s var(--ease) both; }
  @keyframes draw { from { stroke-dashoffset: 40; } }
  .result__icon { animation: pop 0.6s var(--ease) both; }
  @keyframes pop { from { scale: 0.6; opacity: 0; } }

  .button:active, .chip:active, .card__add:active { transform: scale(0.97); }
}

/* ---------- Celular ---------- */

@media (max-width: 47.99rem) {
  /* Las secciones quedan a un scroll; el encabezado deja lugar al carrito. */
  .nav { display: none; }
  .cart-button { margin-left: auto; padding-inline: 0.8rem; }
  .cart-button__label { display: none; }

  /* Los filtros se deslizan de costado, de borde a borde y en su propio
     renglón: compartiéndolo con "Ordenar" quedaba a la vista un filtro y medio. */
  .shop__tools { width: 100%; flex-wrap: wrap; }
  .chips {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0.15rem var(--gutter);
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .sort { flex: none; }
  .card__price small { display: block; }
  .card__price small::before { content: none; }
  .chips { mask-image: linear-gradient(to right, #000 88%, transparent); }

  /* En la ficha, comprar queda siempre a mano: la barra se pega abajo de la
     ventana mientras se leen los detalles. */
  .product__buy {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-inline: calc(clamp(1.4rem, 4vw, 2.6rem) * -1);
    padding: 0.75rem clamp(1.4rem, 4vw, 2.6rem) calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 24px -20px rgb(60 40 20 / 0.45);
  }

  /* El botón que avanza va primero y a todo el ancho, donde llega el pulgar. */
  .checkout__actions { flex-direction: column-reverse; align-items: stretch; }
  .checkout__actions .link-button { align-self: center; }

  .toast { border-radius: 22px; padding-right: 0.5rem; font-size: 0.86rem; }
}

@media (max-width: 26rem) {
  .buy__long { display: none; }
}

/* ---------- Barras de scroll ----------
   Del color de la página y no las grises del sistema. Chrome, Edge y Safari
   van por ::-webkit-scrollbar, que es lo único que da una pastilla redondeada
   y sin las flechitas de las puntas; Chrome lo ignora apenas un elemento tiene
   `scrollbar-color` o `scrollbar-width`, por eso esas dos quedan sólo para
   Firefox, que no entiende el otro camino. Una fila deslizable que esconde su
   barra con su propia clase sigue ganando: pesa más que estas reglas. */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: color-mix(in srgb, var(--clay) 45%, transparent) transparent; }
  * { scrollbar-width: thin; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: color-mix(in srgb, var(--clay) 45%, transparent) padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--clay) padding-box; }
