/* Chamito Café: estilos */

:root {
  /* Paleta de marca */
  --cafe: #3b1f0f;
  --tostado: #8b4e2d;
  --kraft: #d9b892;
  --hueso: #f8f3e8;
  --verde: #2f5d46;
  --terracota: #c65a3c;
  --mostaza: #d9a441;

  /* Derivados */
  --crema: var(--hueso);
  --crema-2: #f1e7d5;
  --crema-3: #e4d3b5;
  --cafe-2: var(--tostado);
  --cafe-suave: #6b4a36;
  --terracota-osc: #a8472c;
  --oliva: var(--verde);
  --kraft-osc: #c49e72;
  --blanco: #fffcf6;

  --bolsa-clasico: #5a3220;
  --bolsa-origen: var(--verde);
  --bolsa-intenso: #b8532f;

  --fuente-marca: "Fredoka", "Nunito", system-ui, sans-serif;
  --fuente-texto: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radio: 22px;
  --radio-chico: 12px;
  --ancho: 1160px;
  --sombra: 0 14px 40px rgba(59, 31, 15, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--hueso);
  color: var(--cafe);
  font-family: var(--fuente-texto);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--terracota-osc);
  text-underline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--fuente-marca);
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.8rem, 6.2vw, 5.1rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.4rem;
}

p {
  margin: 0 0 1em;
}

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

.contenedor {
  width: min(100% - 2.5rem, var(--ancho));
  margin-inline: auto;
}

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

.saltar {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--cafe);
  color: var(--crema);
  padding: 0.6rem 1rem;
  border-radius: var(--radio-chico);
  z-index: 100;
}

.saltar:focus {
  top: 1rem;
}

/* Botones */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 1.05rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 2px solid var(--cafe);
  background: var(--cafe);
  color: var(--hueso);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.boton svg {
  width: 20px;
  height: 20px;
  transition: translate 0.15s ease;
}

.boton:hover {
  transform: translateY(-2px);
  background: var(--tostado);
  border-color: var(--tostado);
}

.boton:hover svg {
  translate: 3px 0;
}

.boton--terracota {
  background: var(--terracota);
  border-color: var(--terracota);
  color: var(--blanco);
}

.boton--terracota:hover {
  background: var(--terracota-osc);
  border-color: var(--terracota-osc);
}

.boton--borde {
  background: transparent;
  color: var(--cafe);
}

.boton--borde:hover {
  background: var(--cafe);
  border-color: var(--cafe);
  color: var(--hueso);
}

.boton--ancho {
  width: 100%;
}

.boton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Aviso */

.aviso {
  background: var(--cafe);
  color: var(--hueso);
  text-align: center;
  font-size: 0.92rem;
  padding: 0.55rem 1rem;
  margin: 0;
}

.aviso strong {
  font-family: var(--fuente-marca);
  font-weight: 600;
  color: var(--mostaza);
}

/* Encabezado */

.encabezado {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 243, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--crema-3);
}

.encabezado__fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 78px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--cafe);
}

.logo__personaje {
  height: 50px;
  width: auto;
}

.logo__marca {
  height: 44px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav a {
  color: var(--cafe);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
}

.nav a:hover {
  color: var(--terracota);
}

.acciones {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.boton-carrito {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--cafe);
  color: var(--hueso);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.05rem;
  font-family: var(--fuente-marca);
  font-size: 1rem;
  cursor: pointer;
}

.boton-carrito svg {
  width: 20px;
  height: 20px;
}

.contador {
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--mostaza);
  color: var(--cafe);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
}

.boton-menu {
  display: none;
  background: transparent;
  border: 2px solid var(--cafe);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--cafe);
}

.boton-menu svg {
  width: 22px;
  height: 22px;
}

/* Portada */

.portada {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  overflow: hidden;
}

.portada__grilla {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 2rem;
}

.etiqueta {
  display: inline-block;
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 1rem;
}

.portada h1 {
  max-width: 11ch;
}

.subrayado {
  position: relative;
  white-space: nowrap;
}

.subrayado::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 6%;
  bottom: -0.12em;
  height: 0.22em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 15C55 4 140 2 197 9' fill='none' stroke='%238b4e2d' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
}

.portada__bajada {
  font-size: 1.18rem;
  max-width: 36ch;
  color: var(--cafe-suave);
  margin-top: 1.4rem;
}

.portada__botones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.portada__visual {
  position: relative;
  height: clamp(380px, 44vw, 540px);
}

.portada__hojas {
  position: absolute;
  right: -12%;
  top: 2%;
  width: 70%;
  opacity: 0.35;
  rotate: -12deg;
  pointer-events: none;
}

.portada__visual::before {
  content: "";
  position: absolute;
  inset: 10% 8% 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--crema-2), rgba(241, 231, 213, 0));
}

.portada__personaje {
  position: absolute;
  left: -2%;
  bottom: 0;
  width: clamp(120px, 15vw, 190px);
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(59, 31, 15, 0.15));
}

.portada__visual:not(:has(.bolsa3d--lista)) .portada__personaje {
  display: none;
}

.portada__mockups {
  width: 82%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portada__mockups img {
  width: 35%;
  height: auto;
  border-radius: 4% 4% 7% 7%;
  filter: drop-shadow(0 12px 12px rgba(59, 31, 15, 0.2));
}

.portada__mockups img:first-child { transform: translateX(18%) rotate(-9deg); }
.portada__mockups img:nth-child(2) { z-index: 1; width: 39%; }
.portada__mockups img:last-child { transform: translateX(-18%) rotate(9deg); }

/* Bolsa 3D */

.bolsa3d {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.portada__visual .bolsa3d {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.bolsa3d__lienzo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.bolsa3d__lienzo:active {
  cursor: grabbing;
}

.bolsa3d--lista > :not(canvas) {
  display: none;
}

.girar {
  position: absolute;
  left: 50%;
  bottom: 0.9rem;
  translate: -50% 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 252, 246, 0.85);
  border: 1px solid var(--crema-3);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--cafe-suave);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}

.girar svg {
  width: 15px;
  height: 15px;
}

.tarjeta__visual .girar {
  top: 1rem;
  bottom: auto;
  left: auto;
  right: 1rem;
  translate: none;
}

.girar--portada {
  bottom: 0.2rem;
  left: 58%;
}

:not(:has(> .bolsa3d--lista)) > .girar {
  display: none;
}

:has(> .bolsa3d--tocada) > .girar {
  opacity: 0;
}

/* Fotos de producto (equipos lentos) */

.fotos-producto {
  position: absolute;
  inset: 0;
  display: none;
  cursor: pointer;
  overflow: hidden;
}

.fotos-producto--ok {
  display: block;
}

.bolsa3d:has(.fotos-producto--ok) > .bolsa,
[data-bolsas="fotos"] .tarjeta__visual:has(.fotos-producto--ok)::before {
  display: none;
}

.fotos-producto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease, scale 0.6s ease;
}

.fotos-producto img + img {
  opacity: 0;
}

.fotos-producto--girada.fotos-producto--doble img + img {
  opacity: 1;
}

@media (hover: hover) {
  [data-bolsas="fotos"] .tarjeta__visual:hover .fotos-producto--doble img + img {
    opacity: 1;
  }

  [data-bolsas="fotos"] .tarjeta__visual:hover .fotos-producto img {
    scale: 1.03;
  }
}

/* Bolsa en CSS (respaldo sin 3D) */

.bolsa {
  position: relative;
  width: 170px;
  aspect-ratio: 0.62;
  background: linear-gradient(180deg, #e2c8a2 0%, #d3b185 100%);
  border-radius: 6px 6px 10px 10px;
  box-shadow: var(--sombra), inset 0 -10px 18px rgba(59, 31, 15, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 14px 14px;
  --color: var(--bolsa-clasico);
}

.bolsa--origen {
  --color: var(--bolsa-origen);
}

.bolsa--intenso {
  --color: var(--bolsa-intenso);
}

.bolsa__solapa {
  position: absolute;
  top: 0;
  left: 37%;
  width: 26%;
  height: 22px;
  background: var(--color);
}

.bolsa__logo {
  width: 78%;
}

.bolsa__personaje {
  width: 46%;
  margin: 6px 0;
}

.bolsa__etiqueta {
  background: var(--color);
  color: var(--hueso);
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  text-align: center;
}

.bolsa__peso {
  margin-top: auto;
  align-self: flex-end;
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 0.85rem;
}

/* Valores */

.valores {
  border-block: 1px solid var(--crema-3);
  background: var(--blanco);
}

.valores__lista {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  margin-block: 0;
  padding: 0;
  list-style: none;
}

.valores li {
  min-width: 0;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 0.8rem;
  background: transparent;
  color: var(--cafe);
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 1.05rem;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.valores li + li {
  border-left: 1px solid var(--crema-3);
}

.valores svg {
  width: 38px;
  height: 38px;
  color: var(--tostado);
  flex: none;
  transition: color 0.25s ease;
}

.valores__texto {
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.valores__frase {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  opacity: 0;
  font-family: var(--fuente-texto);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-wrap: pretty;
  transition: max-height 0.25s ease, margin 0.25s ease, opacity 0.2s ease;
}

.valores li:focus-visible {
  outline: 3px solid var(--terracota);
  outline-offset: -3px;
  background: var(--cafe);
  color: var(--hueso);
}

.valores li:focus-visible svg {
  color: var(--crema-2);
}

.valores li:focus-visible .valores__frase {
  max-height: 3.5rem;
  margin-top: 0.25rem;
  opacity: 1;
}

@media (hover: hover) {
  .valores li:hover {
    background: var(--cafe);
    color: var(--hueso);
  }

  .valores li:hover svg {
    color: var(--crema-2);
  }

  .valores li:hover .valores__frase {
    max-height: 3.5rem;
    margin-top: 0.25rem;
    opacity: 1;
  }
}

/* Secciones */

.seccion {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.seccion--crema-2 {
  background: var(--crema-2);
}

.seccion--cafe {
  background: var(--cafe);
  color: var(--crema);
}

.seccion--cafe a {
  color: var(--crema);
}

.seccion__cabeza {
  max-width: 640px;
  margin-bottom: 3rem;
}

.seccion__cabeza p {
  color: var(--cafe-suave);
  font-size: 1.15rem;
}

.seccion--cafe .seccion__cabeza p {
  color: var(--crema-3);
}

.seccion--cafe .etiqueta {
  color: var(--kraft);
}

/* Tarjetas de producto */

.productos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border-radius: var(--radio);
  border: 1px solid var(--crema-3);
  box-shadow: var(--sombra);
  overflow: hidden;
  --color: var(--bolsa-clasico);
}

.tarjeta--origen {
  --color: var(--bolsa-origen);
}

.tarjeta--intenso {
  --color: var(--bolsa-intenso);
}

.tarjeta__visual {
  position: relative;
  height: 320px;
  background:
    radial-gradient(60% 55% at 50% 58%, rgba(255, 252, 246, 0.95), rgba(255, 252, 246, 0) 70%),
    linear-gradient(180deg, var(--crema-2), var(--hueso));
  border-bottom: 1px solid var(--crema-3);
}

.tarjeta__visual::before {
  content: "";
  position: absolute;
  inset: auto -10% 0 -10%;
  height: 90px;
  background: url("../assets/hojas-patron.svg") repeat-x center / auto 90px;
  opacity: 0.18;
  pointer-events: none;
}

.sello {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 4;
  background: var(--color);
  color: var(--hueso);
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
}

.tarjeta__info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.2rem 1.25rem 1.25rem;
}

.tarjeta__tueste {
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color);
  margin: 0 0 0.35rem;
}

.tarjeta__info h3 {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.tarjeta__descripcion {
  color: var(--cafe-suave);
  font-size: 0.94rem;
  line-height: 1.35;
  margin: 0 0 0.55rem;
}

.notas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
  color: var(--cafe-suave);
  font-size: 0.82rem;
  line-height: 1.3;
}

.notas li {
  font-weight: 700;
  white-space: nowrap;
}

.notas li + li::before {
  content: "·";
  display: inline-block;
  margin-inline: 0.35rem;
  color: var(--kraft-osc);
}

.tarjeta__compra {
  margin-top: 0.25rem;
}

.tamanos {
  display: flex;
  gap: 0.4rem;
  border: 0;
  padding: 0;
  margin: 0 0 0.55rem;
}

.tamanos input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tamanos label {
  flex: 1;
  text-align: center;
  border: 2px solid var(--crema-3);
  border-radius: 999px;
  padding: 0.35rem 0.5rem;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--hueso);
  transition: border-color 0.15s, background 0.15s;
}

.tamanos input:checked + label {
  background: var(--cafe);
  border-color: var(--cafe);
  color: var(--hueso);
}

.tamanos input:focus-visible + label {
  outline: 3px solid var(--terracota);
  outline-offset: 2px;
}

.tarjeta__precio {
  font-family: var(--fuente-marca);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
}

.producto__transferencia {
  color: var(--verde);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tarjeta__compra-fila {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
}

.tarjeta__compra-fila .boton {
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.7rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

.confirmacion {
  min-height: 1.6em;
  margin: 0.8rem 0 0;
  font-weight: 700;
  color: var(--verde);
}

.tarjeta .confirmacion {
  font-size: 0.92rem;
  margin-top: 0.6rem;
  min-height: 0;
}

.campo {
  margin-bottom: 1.2rem;
  border: 0;
  padding: 0;
}

.campo legend,
.campo > label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.5rem;
  padding: 0;
}

/* Franja de hojas: patrón vectorial continuo (herramientas/marca_svg.py) que se desliza muy despacio.
   El tramo animado mide exactamente un período del patrón (1334 × 127), así el bucle no salta. */

.franja-hojas {
  --alto: 110px;
  position: relative;
  height: var(--alto);
  overflow: hidden;
  background: var(--hueso);
}

.franja-hojas::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% + var(--alto) * 1334 / 127);
  background: url("../assets/hojas-patron.svg") repeat-x 0 50% / auto var(--alto);
  opacity: 0.9;
  animation: hojas-deriva 120s linear infinite;
  will-change: transform;
}

@keyframes hojas-deriva {
  to {
    transform: translateX(calc(var(--alto) * -1334 / 127));
  }
}

/* Pasos */

.pasos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  counter-reset: paso;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pasos li {
  background: var(--blanco);
  border: 2px solid var(--crema-3);
  border-radius: var(--radio);
  padding: 2rem 1.6rem;
  position: relative;
}

.pasos li::before {
  counter-increment: paso;
  content: counter(paso);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terracota);
  color: var(--blanco);
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.pasos p {
  margin: 0;
  color: var(--cafe-suave);
}

/* Historia */

.historia {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4.5rem;
  align-items: center;
}

.historia__visual {
  background: var(--crema);
  border-radius: 50%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12%;
}

.historia__cita {
  font-family: var(--fuente-marca);
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--kraft);
  margin: 1.5rem 0 0;
  padding-left: 1rem;
  border-left: 4px solid var(--terracota);
}

/* Preparación */

.metodos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.metodo {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 1.6rem 1.4rem;
  border: 2px solid var(--crema-3);
}

/* Dibujos 3D de las cafeteras: se generan con herramientas/metodos3d.mjs */
.metodo__dibujo {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto 1rem;
}

.metodo h3 {
  font-size: 1.25rem;
}

.metodo dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.8rem;
  font-size: 0.95rem;
}

.metodo dt {
  font-weight: 800;
}

.metodo dd {
  margin: 0;
  color: var(--cafe-suave);
}

.metodo p {
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
  color: var(--cafe-suave);
}

/* Club */

.club {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  background: var(--terracota);
  color: var(--blanco);
  border-radius: var(--radio);
  padding: clamp(2rem, 5vw, 3.5rem);
}

/* El patrón de marca queda detrás del contenido y no intercepta el formulario. */
.club::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--cafe);
  opacity: 0.14;
  /* hojas-trama.svg repite la franja en filas que se solapan, así cubre todo el fondo sin cortes. */
  -webkit-mask: url("../assets/hojas-trama.svg") repeat center top / auto clamp(250px, 30vw, 400px);
  mask: url("../assets/hojas-trama.svg") repeat center top / auto clamp(250px, 30vw, 400px);
}

.club .etiqueta {
  color: var(--crema-2);
}

.club ul {
  padding-left: 1.2rem;
  margin: 0 0 1.5rem;
}

.club ul li {
  margin-bottom: 0.3rem;
}

.formulario-linea {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.formulario-linea input {
  flex: 1 1 220px;
}

.club .boton {
  background: var(--cafe);
  border-color: var(--cafe);
}

.club__visual {
  display: grid;
  place-items: center;
}

/* Emblema del Club como un posavasos de cartón que flota sobre la tarjeta. En reposo se ve inclinado y
   js/emblema3d.js lo gira hacia el mouse (--tx y --ty, de -1 a 1). El canto son sombras sólidas apiladas
   hacia el lado que se acerca, así se ve igual en todos los navegadores (sin depender de preserve-3d). */
.emblema3d {
  --tx: 0;
  --ty: 0;
  --canto: 24px;
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
}

.emblema3d__sombra {
  position: absolute;
  inset: 16% 0 -10% 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(59, 31, 15, 0.5), rgba(59, 31, 15, 0.2) 62%, rgba(59, 31, 15, 0));
  filter: blur(12px);
  translate: calc(12px - var(--tx) * 14px) calc(16px - var(--ty) * 10px);
  animation: emblema-sombra 7s ease-in-out infinite;
}

.emblema3d__flota {
  position: absolute;
  inset: 0;
  perspective: 1100px;
  animation: emblema-flota 7s ease-in-out infinite;
}

.emblema3d__cara {
  /* Hacia dónde asoma el canto: el seno del giro, aproximado en forma lineal. */
  --ex: calc((0.24 - var(--tx) * 0.28) * var(--canto));
  --ey: calc((0.21 - var(--ty) * 0.21) * var(--canto));
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: rotateX(calc(12deg - var(--ty) * 12deg)) rotateY(calc(-14deg + var(--tx) * 16deg));
  will-change: transform;
  background:
    radial-gradient(circle at calc(32% + var(--tx) * 30%) calc(26% + var(--ty) * 30%), rgba(255, 252, 246, 0.85), rgba(255, 252, 246, 0) 52%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .12 0 0 0 0 .06 .4 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 46% 42%, var(--blanco) 0 50%, var(--hueso) 72%, var(--crema-2) 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 252, 246, 0.7),
    inset -10px -14px 26px rgba(139, 78, 45, 0.16),
    inset 6px 8px 18px rgba(255, 252, 246, 0.9),
    calc(var(--ex) * 0.1) calc(var(--ey) * 0.1) 0 #e9d8b9,
    calc(var(--ex) * 0.2) calc(var(--ey) * 0.2) 0 #e2cca8,
    calc(var(--ex) * 0.3) calc(var(--ey) * 0.3) 0 #dbc19a,
    calc(var(--ex) * 0.4) calc(var(--ey) * 0.4) 0 var(--kraft),
    calc(var(--ex) * 0.5) calc(var(--ey) * 0.5) 0 #d1b088,
    calc(var(--ex) * 0.6) calc(var(--ey) * 0.6) 0 #c9a77d,
    calc(var(--ex) * 0.7) calc(var(--ey) * 0.7) 0 var(--kraft-osc),
    calc(var(--ex) * 0.8) calc(var(--ey) * 0.8) 0 #b99367,
    calc(var(--ex) * 0.9) calc(var(--ey) * 0.9) 0 #ac875c,
    var(--ex) var(--ey) 0 #9c7852;
}

.emblema3d__cara img {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  filter: drop-shadow(0 1px 0 rgba(255, 252, 246, 0.8));
}

@keyframes emblema-flota {
  50% {
    translate: 0 -10px;
  }
}

@keyframes emblema-sombra {
  50% {
    scale: 0.9;
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .emblema3d__flota,
  .emblema3d__sombra {
    animation: none;
  }
}

/* Formularios */

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--cafe);
  background: var(--blanco);
  border: 2px solid var(--crema-3);
  border-radius: var(--radio-chico);
  padding: 0.75rem 0.9rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cafe);
}

.formulario label {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.formulario .fila {
  margin-bottom: 1rem;
}

.formulario .fila--doble {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.ayuda {
  font-size: 0.88rem;
  color: var(--cafe-suave);
}

/* Preguntas frecuentes */

.preguntas__disposicion {
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(180px, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.preguntas__ilustracion {
  display: grid;
  place-items: center;
}

.preguntas__ilustracion img {
  display: block;
  width: min(100%, 250px);
  height: auto;
}

@media (max-width: 768px) {
  .preguntas__disposicion { grid-template-columns: minmax(0, 1fr); }
  .preguntas__ilustracion { display: none; }
}

.preguntas {
  max-width: 820px;
}

.preguntas details {
  border-bottom: 2px solid var(--crema-3);
  padding: 1.2rem 0;
}

.preguntas summary {
  font-family: var(--fuente-marca);
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.preguntas summary::-webkit-details-marker {
  display: none;
}

.preguntas summary::after {
  content: "+";
  font-size: 1.6rem;
  line-height: 1;
  color: var(--terracota);
  transition: rotate 0.2s;
}

.preguntas details[open] summary::after {
  rotate: 45deg;
}

.preguntas details p {
  margin: 0.8rem 0 0;
  color: var(--cafe-suave);
}

/* Pie */

.pie {
  background: var(--cafe);
  color: var(--crema-3);
  padding: 4rem 0 2rem;
  font-size: 0.95rem;
}

.pie a {
  color: var(--crema);
}

.pie__grilla {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
}

.pie h4 {
  color: var(--crema);
  font-size: 1.1rem;
}

.pie ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pie li {
  margin-bottom: 0.45rem;
}

.pie .logo {
  color: var(--crema);
  margin-bottom: 1rem;
}



.arrepentimiento {
  display: inline-block;
  margin-top: 0.6rem;
  border: 2px solid var(--crema);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  text-decoration: none;
  font-weight: 800;
}

.arrepentimiento:hover {
  background: var(--crema);
  color: var(--cafe);
}

.pie__legal {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(239, 226, 203, 0.2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

/* Pie completo (portada y ficha): una invitación con Chamito, los enlaces y una firma gigante que se llena
   de café al llegar al final. Las páginas legales conservan el pie simple. */

.pie--completo {
  position: relative;
  overflow: clip; /* hidden lo volvería contenedor de scroll y la firma no se llenaría */
  padding: clamp(3.5rem, 7vw, 5.5rem) 0 1.5rem;
  background:
    radial-gradient(60% 70% at 88% 0%, rgba(198, 90, 60, 0.24), rgba(198, 90, 60, 0) 70%),
    radial-gradient(45% 55% at 0% 100%, rgba(217, 164, 65, 0.1), rgba(217, 164, 65, 0) 70%),
    var(--cafe);
}

.pie .etiqueta {
  color: var(--mostaza);
}

.pie__cierre {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid rgba(239, 226, 203, 0.16);
}

.pie__titular {
  margin: 0 0 1.3rem;
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--hueso);
}

.pie__resalte {
  position: relative;
  white-space: nowrap;
  color: var(--mostaza);
}

.pie__resalte::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 5%;
  bottom: -0.1em;
  height: 0.16em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 15C55 4 140 2 197 9' fill='none' stroke='%23c65a3c' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat center / 100% 100%;
}

.pie__bajada {
  max-width: 36ch;
  margin: 0 0 1.8rem;
  font-size: 1.15rem;
  color: var(--crema-3);
}

.pie__acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.6rem;
}

.pie__club {
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration-color: rgba(248, 243, 232, 0.4);
  text-underline-offset: 5px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.pie__club:hover,
.pie__club:focus-visible {
  color: var(--mostaza);
  text-decoration-color: currentColor;
}

.pie__personaje {
  position: relative;
  width: clamp(150px, 16vw, 200px);
  margin-right: clamp(0rem, 4vw, 3.5rem);
}

.pie__personaje img {
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
  animation: pie-saludo 4.5s ease-in-out infinite;
}

.pie__globo {
  position: absolute;
  top: -4%;
  right: 86%;
  display: grid;
  margin: 0;
  padding: 0.6rem 1.05rem;
  border-radius: 20px 20px 4px 20px;
  background: var(--hueso);
  color: var(--cafe);
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  rotate: -4deg;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.pie__globo span {
  grid-area: 1 / 1;
  opacity: 0;
  animation: pie-frase 12s infinite;
}

.pie__globo span:nth-child(2) {
  animation-delay: 3s;
}

.pie__globo span:nth-child(3) {
  animation-delay: 6s;
}

.pie__globo span:nth-child(4) {
  animation-delay: 9s;
}

/* Con JavaScript (js/main.js) el globo mide lo que la frase visible y cambia de ancho al rotar. */
.pie__globo--vivo {
  justify-content: start;
  overflow: hidden;
  transition: width 0.45s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.pie__globo--vivo span {
  justify-self: start;
  animation: none;
  translate: 0 6px;
  transition: opacity 0.3s ease, translate 0.3s ease;
}

.pie__globo--vivo span.is-activa {
  opacity: 1;
  translate: 0 0;
  transition-delay: 0.15s;
}

.pie--completo h4 {
  color: var(--mostaza);
}

.pie__grilla ul a {
  text-decoration-color: rgba(248, 243, 232, 0.3);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.pie__grilla ul a:hover,
.pie__grilla ul a:focus-visible {
  color: var(--mostaza);
  text-decoration-color: currentColor;
}

/* La firma recorta el patrón de granos; --pie-lleno controla cuánto se revela desde abajo. */
@property --pie-lleno {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}

.pie__firma {
  position: relative;
  aspect-ratio: 374 / 117;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  -webkit-mask: url("../assets/firma-chamito.svg") center / contain no-repeat;
  mask: url("../assets/firma-chamito.svg") center / contain no-repeat;
  background: rgba(217, 184, 146, 0.12);
}

.pie__firma::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/granos-patron.svg") repeat 0 0 / clamp(64px, 7vw, 112px) auto, var(--kraft);
  clip-path: inset(calc(100% - var(--pie-lleno, 100%)) 0 0);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .pie__firma::before {
      animation: pie-llenar linear both;
      animation-duration: auto;
      animation-timeline: view();
      animation-range: entry 10% entry 100%;
    }
  }
}

@keyframes pie-llenar {
  from {
    --pie-lleno: 0%;
  }

  to {
    --pie-lleno: 100%;
  }
}

@keyframes pie-frase {
  0% {
    opacity: 0;
    translate: 0 6px;
  }

  3%,
  22% {
    opacity: 1;
    translate: 0 0;
  }

  25%,
  100% {
    opacity: 0;
    translate: 0 -6px;
  }
}

@keyframes pie-saludo {
  0%,
  100% {
    rotate: -3deg;
  }

  50% {
    rotate: 3deg;
  }
}

/* En celulares Chamito va arriba, con el globo a su derecha, y la invitación usa todo el ancho. */
@media (max-width: 640px) {
  .pie__cierre {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.5rem;
  }

  .pie__personaje {
    order: -1;
    width: 112px;
    margin: 0;
  }

  .pie__globo {
    top: 6%;
    right: auto;
    left: 92%;
    font-size: 0.9rem;
    border-radius: 20px 20px 20px 4px;
    rotate: 3deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .franja-hojas::before,
  .pie__personaje img,
  .pie__globo span {
    animation: none;
  }

  .pie__globo span:first-child {
    opacity: 1;
  }
}

/* Carrito (panel lateral) */

.capa {
  position: fixed;
  inset: 0;
  background: rgba(58, 34, 22, 0.45);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.capa.activa {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  background: var(--crema);
  z-index: 70;
  display: flex;
  flex-direction: column;
  translate: 100% 0;
  visibility: hidden;
  transition: translate 0.25s ease, visibility 0s 0.25s;
  box-shadow: -10px 0 40px rgba(58, 34, 22, 0.2);
}

.panel.abierto {
  translate: 0 0;
  visibility: visible;
  transition: translate 0.25s ease;
}

.panel__cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 2px solid var(--crema-3);
}

.panel__cabeza h2 {
  font-size: 1.6rem;
  margin: 0;
}

.cerrar {
  background: transparent;
  border: 2px solid var(--cafe);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--cafe);
}

.panel__cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.5rem;
}

.panel__pie {
  padding: 1.2rem 1.5rem 1.5rem;
  border-top: 2px solid var(--crema-3);
  background: var(--crema-2);
}

.vacio {
  text-align: center;
  padding: 2rem 0;
  color: var(--cafe-suave);
}

.vacio img {
  width: 120px;
  margin: 0 auto 1rem;
  opacity: 0.8;
}

.items {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 0.3rem 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--crema-3);
}

.item__nombre {
  font-weight: 800;
}

.item__detalle {
  font-size: 0.9rem;
  color: var(--cafe-suave);
}

.item__precio {
  font-weight: 800;
  text-align: right;
}

.item__controles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  grid-column: 2 / -1;
}

.item__controles button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--cafe);
  background: transparent;
  cursor: pointer;
  color: var(--cafe);
}

.item__controles .quitar {
  width: auto;
  border: 0;
  margin-left: auto;
  text-decoration: underline;
  font-size: 0.88rem;
  color: var(--terracota-osc);
}

.totales {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  margin: 0 0 1rem;
}

.totales dt {
  color: var(--cafe-suave);
}

.totales dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.totales .total {
  font-family: var(--fuente-marca);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cafe);
}

.panel__nota {
  font-size: 0.85rem;
  color: var(--cafe-suave);
  margin: 0.7rem 0 0;
  text-align: center;
}

/* Páginas legales */

.legal {
  padding: 3.5rem 0 5rem;
}

.legal .contenedor {
  max-width: 780px;
}

.legal h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
}

.legal h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

.legal .tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--sombra);
  margin-top: 2rem;
}

.pendiente {
  background: #fde7c7;
  border-radius: 4px;
  padding: 0 0.25rem;
}

/* Carrito y checkout */

.panel__paso {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.panel__paso[hidden] {
  display: none;
}

.item__bolsa {
  width: 34px;
  height: 46px;
  border-radius: 6px 6px 9px 9px;
  background: linear-gradient(180deg, var(--kraft) 0%, var(--kraft-osc) 100%);
  position: relative;
  grid-row: span 2;
}

.item__bolsa::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 6px;
  height: 9px;
  border-radius: 2px;
  background: var(--bolsa-clasico);
}

.item__bolsa::before {
  content: "";
  position: absolute;
  top: 0;
  left: 35%;
  width: 30%;
  height: 8px;
  background: var(--bolsa-clasico);
}

.item__bolsa--origen::before,
.item__bolsa--origen::after {
  background-color: var(--bolsa-origen);
}

.item__bolsa--intenso::before,
.item__bolsa--intenso::after {
  background-color: var(--bolsa-intenso);
}

.envio-gratis {
  background: var(--crema-2);
  border-radius: var(--radio-chico);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  margin: 0;
}

.boton-texto,
.volver {
  background: none;
  border: 0;
  padding: 0.4rem 0;
  font: inherit;
  font-weight: 700;
  color: var(--terracota-osc);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.boton-texto {
  display: block;
  margin: 0.6rem auto 0;
  font-size: 0.95rem;
}

.volver {
  margin-bottom: 0.8rem;
  text-decoration: none;
}

.formulario__titulo {
  font-family: var(--fuente-marca);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.4rem 0 0.8rem;
}

.campo legend.formulario__titulo {
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.pagos {
  display: grid;
  gap: 0.5rem;
}

.pagos input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pagos label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--blanco);
  border: 2px solid var(--crema-3);
  border-radius: var(--radio-chico);
  padding: 0.75rem 1rem;
  cursor: pointer;
  margin: 0;
}

.pagos label span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cafe-suave);
  text-align: right;
}

.pagos input:checked + label {
  border-color: var(--cafe);
  box-shadow: inset 0 0 0 1px var(--cafe);
}

.pagos input:checked + label span {
  color: var(--oliva);
}

.pagos input:focus-visible + label {
  outline: 3px solid var(--terracota);
  outline-offset: 2px;
}

.formulario .casilla {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

.casilla input {
  width: 18px;
  height: 18px;
  accent-color: var(--cafe);
}

.trampa {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.error {
  color: var(--terracota-osc);
  font-weight: 700;
  min-height: 0;
  margin: 0.6rem 0 0;
}

.error:empty {
  display: none;
}

.espera {
  text-align: center;
  padding-top: 2rem;
}

.espera img {
  width: 130px;
  margin: 0 auto 1rem;
}

.espera .etiqueta {
  margin-bottom: 0.6rem;
}

.espera h3 {
  font-size: 1.55rem;
  line-height: 1.2;
}

.espera h3:focus {
  outline: none;
}

.espera p {
  color: var(--cafe-suave);
}

.espera strong {
  color: var(--cafe);
}

.espera__resumen {
  text-align: left;
  background: var(--blanco);
  border: 2px solid var(--crema-3);
  border-radius: var(--radio-chico);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0 1.4rem;
  font-size: 0.95rem;
}

.espera__resumen ul {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
}

.espera__resumen p {
  margin: 0;
  color: var(--cafe);
}

/* Página de producto */

.tarjeta__info h3 a {
  color: inherit;
  text-decoration: none;
}

.tarjeta__info h3 a:hover {
  color: var(--color);
}

.tarjeta__detalle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  margin-top: 0.55rem;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--color);
  text-decoration: none;
}

.tarjeta__detalle svg {
  width: 17px;
  height: 17px;
  transition: translate 0.15s ease;
}

.tarjeta__detalle:hover svg {
  translate: 3px 0;
}

.pagina-producto {
  padding: 1.4rem 0 4.5rem;
}

.migas {
  display: flex;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--cafe-suave);
  margin-bottom: 1.4rem;
}

.migas a {
  color: var(--cafe-suave);
}

.detalle {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  --color: var(--bolsa-clasico);
}

.detalle--origen {
  --color: var(--bolsa-origen);
}

.detalle--intenso {
  --color: var(--bolsa-intenso);
}

.galeria {
  position: sticky;
  top: 100px;
}

.galeria__principal {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radio);
  background: var(--fondo);
  overflow: hidden;
}

.galeria__vista {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

[data-activa="3d"] > [data-vista="3d"],
[data-activa="frente"] > [data-vista="frente"],
[data-activa="inclinada"] > [data-vista="inclinada"] {
  opacity: 1;
  visibility: visible;
}

.galeria__vista--3d .bolsa3d {
  position: absolute;
  inset: 0;
}

.galeria__vista--3d .bolsa {
  width: 38%;
}

[data-bolsas="fotos"] [data-vista="3d"],
[data-bolsas="fotos"] .miniatura--3d {
  display: none;
}

.galeria__miniaturas {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.miniatura {
  width: 84px;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radio-chico);
  overflow: hidden;
  cursor: pointer;
  background: var(--crema-2);
  outline-offset: 2px;
}

.miniatura[aria-pressed="true"] {
  border-color: var(--cafe);
}

.miniatura img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.miniatura--3d {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.1rem;
  background: var(--fondo);
  color: var(--hueso);
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 1.1rem;
}

.miniatura--3d svg {
  width: 24px;
  height: 24px;
}

.detalle__cabeza {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.detalle__marca {
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color);
  margin: 0 0 0.4rem;
}

.detalle h1 {
  font-size: clamp(3rem, 6.2vw, 5.2rem);
  line-height: 0.9;
  margin: 0;
}

.detalle__grano {
  width: clamp(64px, 7vw, 92px);
  flex: none;
  fill: var(--color);
}

.detalle__fila {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  flex-wrap: wrap;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--crema-3);
}

.detalle__notas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.detalle__notas {
  flex: 1 1 260px;
}

.detalle__precios {
  margin-left: auto;
  text-align: right;
}

.detalle__precio {
  font-family: var(--fuente-marca);
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 0.2rem;
}

.detalle__transferencia {
  color: var(--verde);
  font-weight: 800;
  font-size: 0.9rem;
  margin: 0;
}

.detalle__bloque {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--crema-3);
}

.detalle__perfil {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
}

.escalas {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.4rem 1.2rem;
  margin: 0;
}

.escalas dt {
  font-weight: 800;
  font-size: 0.95rem;
}

.escala {
  display: inline-flex;
  gap: 5px;
  margin: 0;
}

.escala span {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--color);
}

.escala span.lleno {
  background: var(--color);
}

.recomendamos p {
  font-weight: 800;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.recomendamos ul {
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recomendamos li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recomendamos svg {
  width: 40px;
  height: 40px;
}

.detalle__historia {
  font-size: 1.08rem;
  color: var(--cafe-suave);
  margin: 0;
}

.detalle__compra {
  display: grid;
  gap: 1rem;
}

.detalle__campo {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 0.5rem 1rem;
}

.detalle__rotulo {
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detalle .tamanos {
  margin: 0;
}

.cantidad {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  border: 2px solid var(--cafe);
  border-radius: 999px;
  overflow: hidden;
}

.cantidad button {
  width: 46px;
  height: 46px;
  background: transparent;
  border: 0;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--cafe);
}

.cantidad output {
  min-width: 2.5rem;
  text-align: center;
  font-weight: 800;
}

.detalle__botones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.detalle .confirmacion {
  min-height: 0;
  margin: 0;
}

.acordeones details {
  border-bottom: 1px solid var(--crema-3);
}

.acordeones summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-family: var(--fuente-marca);
  font-weight: 500;
  font-size: 1.25rem;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.acordeones summary::-webkit-details-marker {
  display: none;
}

.acordeones summary::after {
  content: "+";
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color);
  transition: rotate 0.2s;
}

.acordeones details[open] summary::after {
  rotate: 45deg;
}

.acordeones details > :not(summary) {
  margin: 0 0 1.3rem;
}

.acordeones p {
  color: var(--cafe-suave);
}

.trazabilidad {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
}

.trazabilidad dt {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color);
}

.trazabilidad dd {
  margin: 0;
  font-weight: 700;
}

.receta {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.receta + .receta {
  margin-top: 1rem;
}

.receta svg {
  width: 44px;
  height: 44px;
  flex: none;
}

.receta h4 {
  font-size: 1.1rem;
  margin: 0 0 0.2rem;
}

.receta p {
  margin: 0;
  font-size: 0.98rem;
}

.relacionados {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

.relacionados h2 {
  margin-bottom: 1.5rem;
}

.relacionados__grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
}

.relacionado {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--cafe);
  text-decoration: none;
}

.relacionado__fotos {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radio);
  overflow: hidden;
  background: var(--fondo);
  margin-bottom: 0.6rem;
}

.relacionado__fotos img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

.relacionado__fotos img + img {
  opacity: 0;
}

.relacionado:hover .relacionado__fotos img + img {
  opacity: 1;
}

.relacionado__notas {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cafe-suave);
}

.relacionado__nombre {
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.relacionado__precio {
  font-weight: 800;
}

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

  .galeria {
    position: static;
  }
}

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

  .detalle__botones {
    grid-template-columns: 1fr;
  }

  .detalle__notas {
    font-size: 1.1rem;
  }

  .detalle__precios {
    text-align: left;
  }

  .miniatura {
    width: 72px;
  }

  .relacionados__grilla {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .relacionado__nombre {
    font-size: 1.1rem;
  }

  .relacionado__notas {
    font-size: 0.72rem;
  }
}

/* Cursor de Chamito (solo con mouse) */

.con-cursor-chamito,
.con-cursor-chamito * {
  cursor: none !important;
}

.con-cursor-chamito .valores li,
.con-cursor-chamito .valores li * {
  cursor: default !important;
}

.con-cursor-chamito :is(input:not([type="radio"]):not([type="checkbox"]), textarea, select) {
  cursor: auto !important;
}

.cursor-chamito {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  margin: -23px 0 0 -23px;
  padding: 3px;
  border: 2px solid var(--cafe);
  border-radius: 999px;
  background: var(--hueso);
  box-shadow: 0 6px 18px rgba(59, 31, 15, 0.22);
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cursor-chamito--visible {
  opacity: 1;
}

.cursor-chamito--oculto {
  opacity: 0 !important;
}

.cursor-chamito__cara {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hueso) url("../assets/cara.png") 50% 60% / 104% no-repeat;
  transition: scale 0.12s ease, rotate 0.3s ease;
}

.cursor-chamito__texto {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--fuente-marca);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--hueso);
  transition: max-width 0.3s ease, padding 0.3s ease;
}

.cursor-chamito--frase {
  background: var(--cafe);
  border-color: var(--hueso);
}

.cursor-chamito--frase .cursor-chamito__cara {
  rotate: -12deg;
}

.cursor-chamito--frase .cursor-chamito__texto {
  max-width: 260px;
  padding: 0 0.75rem 0 0.45rem;
}

.cursor-chamito--apretado .cursor-chamito__cara {
  scale: 0.82;
}

@media (prefers-reduced-motion: reduce) {
  .cursor-chamito__texto {
    transition: none;
  }
}

/* Responsive */

@media (max-width: 1000px) {
  .productos {
    grid-template-columns: 1fr;
    max-width: 540px;
    margin-inline: auto;
  }

  .metodos {
    grid-template-columns: repeat(2, 1fr);
  }

  .pie__grilla {
    grid-template-columns: 1fr 1fr;
  }

  .valores__lista {
    grid-template-columns: repeat(2, 1fr);
  }

  .valores li:nth-child(3) {
    border-left: 0;
  }

  .valores li:nth-child(n + 3) {
    border-top: 1px solid var(--crema-3);
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--hueso);
    border-bottom: 1px solid var(--crema-3);
    padding: 0.5rem 1.25rem 1rem;
  }

  .nav.abierta {
    display: flex;
  }

  .nav a {
    padding: 0.7rem 0;
    width: 100%;
    font-size: 1.1rem;
  }

  .boton-menu {
    display: inline-grid;
    place-items: center;
  }

  .portada__grilla,
  .historia,
  .club {
    grid-template-columns: 1fr;
  }

  .portada__visual {
    height: 360px;
    order: -1;
  }

  .portada {
    padding-top: 1rem;
  }

  .pasos {
    grid-template-columns: 1fr;
  }

  .historia__visual {
    max-width: 320px;
    margin-inline: auto;
  }

  .club__visual {
    display: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 1rem;
  }

  .logo__personaje {
    height: 40px;
  }

  .logo__marca {
    height: 34px;
  }

  .boton-carrito .texto {
    display: none;
  }

  .portada__visual {
    height: 300px;
    margin-inline: -0.5rem;
  }

  .tarjeta__visual {
    height: 260px;
  }

  .tarjeta__info {
    padding: 1rem 1.1rem 1.1rem;
  }

  .tarjeta__compra-fila {
    gap: 0.5rem;
  }

  .tarjeta__precio {
    font-size: 1.28rem;
  }

  .tarjeta__compra-fila .boton {
    padding-inline: 0.45rem;
    font-size: 0.88rem;
  }

  .tarjeta__compra .tamanos {
    gap: 0.3rem;
  }

  .tarjeta__compra .tamanos label {
    padding-inline: 0.25rem;
    font-size: 0.84rem;
  }

  .valores li {
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
    font-size: 0.95rem;
  }

  .valores li svg {
    width: 34px;
    height: 34px;
  }

  .valores__texto {
    align-items: center;
    text-align: center;
  }

  .valores__frase {
    max-height: none;
    margin-top: 0.3rem;
    opacity: 1;
    font-size: 0.78rem;
  }

  .metodos {
    grid-template-columns: 1fr;
  }

  .pie__grilla {
    grid-template-columns: 1fr;
  }

  .formulario .fila--doble {
    grid-template-columns: 1fr;
  }

  .franja-hojas {
    --alto: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Detalles editoriales de la experiencia de compra y preparación. */
.pasos { gap: 0; border-block: 1px solid var(--crema-3); }
.pasos li { background: transparent; border: 0; border-radius: 0; padding: 2rem clamp(1rem, 3vw, 2.5rem); }
.pasos li + li { border-left: 1px solid var(--crema-3); }
.pasos li::before { content: '0' counter(paso); width: auto; height: auto; display: block; background: none; color: var(--tostado); font-size: .85rem; letter-spacing: .12em; margin-bottom: 1.5rem; }
.paso__icono { width: 70px; height: 70px; padding: 12px; color: var(--cafe); background: var(--crema-3); border-radius: 45% 55% 50% 42%; margin-bottom: 1.25rem; }
.pasos li:nth-child(2) .paso__icono { border-radius: 52% 42% 48% 55%; }
.pasos li:nth-child(3) .paso__icono { border-radius: 42% 55% 45% 55%; }
.pasos li { transition: background-color .25s ease, color .25s ease, border-radius .25s ease; }
.pasos li::before, .pasos h3, .pasos p, .paso__icono { transition: color .25s ease, background-color .25s ease; }
.pasos li::before { border-radius: 0; }
.paso__frase {
  display: block;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  opacity: 0;
  color: currentColor;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
  text-wrap: pretty;
  transition: max-height .25s ease, margin .25s ease, opacity .2s ease;
}
.pasos li:focus-visible {
  z-index: 1;
  border-radius: var(--radio-chico);
  outline: 3px solid var(--terracota);
  outline-offset: -3px;
  background: var(--cafe);
  color: var(--hueso);
}
.pasos li:focus-visible::before { color: var(--crema-2); }
.pasos li:focus-visible p { color: var(--crema-2); }
.pasos li:focus-visible .paso__icono { color: var(--cafe); background: var(--hueso); }
.pasos li:focus-visible .paso__frase { max-height: 3.5rem; margin-top: .45rem; opacity: 1; }
@media (hover: hover) {
  .pasos li:hover {
    z-index: 1;
    border-radius: var(--radio-chico);
    background: var(--cafe);
    color: var(--hueso);
  }
  .pasos li:hover::before { color: var(--crema-2); }
  .pasos li:hover p { color: var(--crema-2); }
  .pasos li:hover .paso__icono { color: var(--cafe); background: var(--hueso); }
  .pasos li:hover .paso__frase { max-height: 3.5rem; margin-top: .45rem; opacity: 1; }
}
.metodos { gap: 1rem; }
.metodo { position: relative; overflow: hidden; border-width: 1px; padding: 1.8rem; transition: transform .3s ease, border-color .3s ease; }
.metodo dl { border-top: 1px solid var(--crema-3); padding-top: 1rem; }
.metodo p { border-top: 1px solid var(--crema-3); padding-top: 1rem; margin-top: 1rem; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .metodo:hover { transform: translateY(-5px); border-color: var(--tostado); }
}

/* Al pasar por la tarjeta, cada cafetera hace lo suyo: fuego y vapor, émbolo, gotas, chorro y presión. */
.m3d-llama { transform-box: fill-box; transform-origin: 50% 100%; }
.m3d-aguja { transform-box: fill-box; transform-origin: 0 100%; }
.m3d-embolo, .m3d-aguja { transition: transform .9s cubic-bezier(.3, .7, .2, 1); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .metodo:hover .m3d-llama { animation: m3d-llama .55s ease-in-out infinite alternate; }
  .metodo:hover .m3d-llama:nth-child(2n) { animation-duration: .42s; animation-delay: -.2s; }
  .metodo:hover .m3d-llama:nth-child(3n) { animation-duration: .62s; animation-delay: -.35s; }
  .metodo:hover .m3d-brasa,
  .metodo:hover .m3d-luz { animation: m3d-pulso 1.1s ease-in-out infinite alternate; }
  .metodo:hover .m3d-vapor path { animation: m3d-vapor 2.4s ease-in-out infinite; }
  .metodo:hover .m3d-vapor path + path { animation-delay: -1.2s; }
  .metodo:hover .m3d-embolo { transform: translateY(5px); }
  .metodo:hover .m3d-gota { animation: m3d-gota 1.2s linear infinite; }
  .metodo:hover .m3d-gota:nth-child(2) { animation-delay: -.4s; }
  .metodo:hover .m3d-gota:nth-child(3) { animation-delay: -.8s; }
  .metodo:hover .m3d-chorro { stroke-dasharray: 3 2.2; animation: m3d-chorro .5s linear infinite; }
  .metodo:hover .m3d-aguja { transform: rotate(28deg); }
}
@keyframes m3d-llama { from { transform: scale(.94, .82); } to { transform: scale(1.04, 1.12); } }
@keyframes m3d-pulso { from { opacity: .55; } to { opacity: 1; } }
@keyframes m3d-vapor {
  0% { transform: translateY(0); opacity: 1; }
  55% { transform: translateY(-6px); opacity: 0; }
  56% { transform: translateY(4px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes m3d-gota { 0% { transform: translateY(-5px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(6px); opacity: 0; } }
@keyframes m3d-chorro { to { stroke-dashoffset: -5.2; } }
@media (max-width: 860px) {
  .pasos li + li { border-left: 0; border-top: 1px solid var(--crema-3); }
  .pasos li { padding-inline: 0; }
  .paso__frase { max-height: none; margin-top: .45rem; opacity: 1; }
}

/* Del grano a la taza: la mesa de trabajo 3D (herramientas/proceso3d.mjs + js/proceso.js).
   La mesa sale del círculo a los costados; el anillo marca el avance de las cuatro etapas. */
.historia__lado {
  display: grid;
  justify-items: center;
  gap: 2.6rem;
}

.historia__visual--proceso {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  isolation: isolate;
  outline: none;
  background:
    radial-gradient(circle at 50% 58%, rgba(196, 158, 114, .26), transparent 46%),
    radial-gradient(circle, var(--blanco) 0 56%, var(--crema-2) 80%, var(--crema-3) 100%);
  box-shadow: inset 0 0 0 1px rgba(59, 31, 15, .08), 0 26px 60px rgba(0, 0, 0, .28);
}

.historia__visual--proceso:focus-visible {
  box-shadow: 0 0 0 3px var(--cafe), 0 0 0 5px var(--kraft), 0 26px 60px rgba(0, 0, 0, .28);
}

.historia__anillo {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  rotate: -90deg;
  overflow: visible;
  pointer-events: none;
}

.anillo__pista,
.anillo__progreso {
  fill: none;
  stroke-linecap: round;
}

.anillo__pista {
  stroke: rgba(139, 78, 45, .22);
  stroke-width: .5;
  stroke-dasharray: .4 1.6;
}

.anillo__progreso {
  stroke: var(--terracota);
  stroke-width: 1.3;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.proceso__dibujo {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: -17%;
  width: 128%;
  height: auto;
  overflow: visible;
  translate: 0 -46%;
  cursor: pointer;
  touch-action: pan-y;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .18));
}

/* Estación activa: resplandor en la mesa y punto terracota en la regla. */
.proceso__halo {
  opacity: 0;
  transition: opacity .6s ease;
}

.proceso__marca {
  fill: var(--crema-3);
  transition: fill .4s ease;
}

.historia__visual--proceso[data-etapa="0"] [data-p="halo-0"],
.historia__visual--proceso[data-etapa="1"] [data-p="halo-1"],
.historia__visual--proceso[data-etapa="2"] [data-p="halo-2"],
.historia__visual--proceso[data-etapa="3"] [data-p="halo-3"] {
  opacity: 1;
}

.historia__visual--proceso[data-etapa="0"] [data-p="marca-0"],
.historia__visual--proceso[data-etapa="1"] [data-p="marca-1"],
.historia__visual--proceso[data-etapa="2"] [data-p="marca-2"],
.historia__visual--proceso[data-etapa="3"] [data-p="marca-3"] {
  fill: var(--terracota);
}

.proceso__fuego {
  opacity: 0;
  transition: opacity .5s ease;
}

.historia__visual--proceso[data-etapa="1"] .proceso__fuego {
  opacity: 1;
}

.proceso__aparece,
.proceso__gotas,
.proceso__chorro,
.proceso__vapor,
.proceso__molido {
  transition: opacity .35s ease;
}

.proceso__chorro {
  stroke-dasharray: 3.2 2;
}

.historia__estado {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 0;
  max-width: calc(100% - 1rem);
  padding: .55rem 1.1rem;
  transform: translate(-50%, 50%);
  border: 2px solid var(--kraft);
  border-radius: 999px;
  background: var(--cafe);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
  color: var(--hueso);
  font-size: .82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.proceso__etapas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
}

.proceso__etapas button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem .4rem .45rem;
  border: 1.5px solid rgba(217, 184, 146, .45);
  border-radius: 999px;
  background: transparent;
  color: var(--kraft);
  font: 700 .82rem/1.2 var(--fuente-texto);
  cursor: pointer;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.proceso__etapas button span {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(217, 184, 146, .18);
  font-size: .72rem;
}

.proceso__etapas button:hover,
.proceso__etapas button:focus-visible {
  border-color: var(--kraft);
  color: var(--hueso);
}

.proceso__etapas button[aria-pressed="true"] {
  border-color: var(--terracota);
  background: var(--terracota);
  color: var(--hueso);
}

.proceso__etapas button[aria-pressed="true"] span {
  background: rgba(255, 252, 246, .22);
}

@media (prefers-reduced-motion: no-preference) {
  .historia__visual--proceso[data-etapa="1"] .m3d-llama { animation: m3d-llama .55s ease-in-out infinite alternate; }
  .historia__visual--proceso[data-etapa="1"] .m3d-llama:nth-child(2n) { animation-duration: .42s; animation-delay: -.2s; }
  .historia__visual--proceso[data-etapa="1"] .m3d-llama:nth-child(3n) { animation-duration: .62s; animation-delay: -.35s; }
  .historia__visual--proceso[data-etapa="3"] .m3d-gota { animation: m3d-gota 1.1s linear infinite; }
  .historia__visual--proceso[data-etapa="3"] .m3d-gota:nth-child(2) { animation-delay: -.37s; }
  .historia__visual--proceso[data-etapa="3"] .m3d-gota:nth-child(3) { animation-delay: -.74s; }
  .historia__visual--proceso[data-etapa="3"] .proceso__chorro { animation: m3d-chorro .45s linear infinite; }
  .historia__visual--proceso[data-etapa="3"] .proceso__vapor path { animation: m3d-vapor 2.4s ease-in-out infinite; }
  .historia__visual--proceso[data-etapa="3"] .proceso__vapor path + path { animation-delay: -1.2s; }
}

@media (max-width: 860px) {
  .historia__lado {
    gap: 2.4rem;
  }

  .historia__visual--proceso {
    width: min(100%, 340px);
  }

  .proceso__dibujo {
    left: -9%;
    width: 116%;
  }
}

@media (max-width: 480px) {
  .proceso__etapas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 320px);
  }
}


/* Ver de cerca: botón y visor con zoom (js/visor.js) */

.ver-de-cerca {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  border: 1.5px solid var(--crema-3);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.94);
  color: var(--cafe);
  font-family: var(--fuente-texto);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(59, 31, 15, 0.14);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

a.ver-de-cerca {
  text-decoration: none;
}

.ver-de-cerca svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.ver-de-cerca:hover {
  transform: translateY(-2px);
  background: var(--cafe);
  border-color: var(--cafe);
  color: var(--hueso);
}

.ver-de-cerca:focus-visible {
  outline: 3px solid var(--cafe);
  outline-offset: 2px;
}

.ver-de-cerca--galeria {
  top: 1rem;
  bottom: auto;
}

.galeria__vista:not([data-vista="3d"]) {
  cursor: zoom-in;
}

html.visor-abierto {
  overflow: hidden;
}

.visor {
  inset: 0;
  width: min(1080px, 100% - 3rem);
  height: min(880px, 100% - 3rem);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radio);
  background: var(--hueso);
  color: var(--cafe);
  overflow: hidden;
  overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(30, 15, 6, 0.35);
}

.visor[open] {
  display: flex;
  flex-direction: column;
}

.visor [hidden] {
  display: none !important;
}

.visor::backdrop {
  background: rgba(43, 24, 14, 0.62);
  backdrop-filter: blur(3px);
}

.visor__cabeza {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem 0.9rem 1.4rem;
  border-bottom: 2px solid var(--crema-3);
}

.visor__titulo {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visor__vistas {
  display: flex;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: var(--crema-2);
}

.visor__vistas button {
  padding: 0.4rem 0.95rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cafe-suave);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.visor__vistas button:hover {
  color: var(--cafe);
}

.visor__vistas button[aria-pressed="true"] {
  background: var(--cafe);
  color: var(--hueso);
}

.visor__cerrar {
  flex: none;
}

.visor__escenario {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--fondo, var(--crema-2));
  container-type: size;
}

.visor__3d,
.visor__3d .bolsa3d {
  position: absolute;
  inset: 0;
}

.visor .bolsa3d__lienzo {
  touch-action: none;
}

.visor__marco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}

.visor__marco--cerca {
  cursor: grab;
}

.visor__marco--moviendo {
  cursor: grabbing;
}

.visor__foto {
  position: absolute;
  top: 0;
  left: 0;
  width: min(100cqw, 100cqh);
  height: min(100cqw, 100cqh);
  max-width: none;
  object-fit: contain;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.visor__foto--suave {
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.visor__pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem 0.75rem 1.4rem;
  border-top: 2px solid var(--crema-3);
}

.visor__ayuda {
  margin: 0;
  color: var(--cafe-suave);
  font-size: 0.88rem;
  font-weight: 700;
}

.visor__zoom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
}

.visor__zoom button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 2px solid var(--cafe);
  border-radius: 50%;
  background: transparent;
  color: var(--cafe);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.visor__zoom button svg {
  width: 20px;
  height: 20px;
}

.visor__zoom button:not(:disabled):hover {
  background: var(--cafe);
  color: var(--hueso);
}

.visor__zoom button:disabled {
  opacity: 0.3;
  cursor: default;
}

.visor__zoom .visor__nivel {
  width: auto;
  min-width: 4.8rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
  .visor[open] {
    animation: visor-entra 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .visor[open]::backdrop {
    animation: visor-fondo 0.28s ease;
  }
}

@keyframes visor-entra {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
}

@keyframes visor-fondo {
  from { opacity: 0; }
}

@media (max-width: 640px) {
  .visor {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .visor__cabeza {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 0.75rem 0.75rem 1rem;
  }

  .visor__titulo {
    font-size: 1.15rem;
  }

  .visor__vistas {
    order: 3;
    width: 100%;
  }

  .visor__vistas button {
    flex: 1;
  }

  .visor__pie {
    padding: 0.6rem 0.75rem 0.6rem 1rem;
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  }

  .visor__ayuda {
    font-size: 0.8rem;
  }

  .ver-de-cerca {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .ver-de-cerca--galeria {
    top: 0.75rem;
    bottom: auto;
  }
}
