/* =========================================================
   NÜMO · Caja de compra ("Elige tu café") — 25-sep-2026
   Sustituye a las tres tarjetas de precio. Una foto que muestra
   cuántos envases te llevas, los 4 packs (1·3·6·12) como atajos y
   un contador − n + pegado al botón para cualquier cantidad (1–99).
   La comparten las dos plantillas (index.html y mobile/index.html):
   se adapta con container queries al ancho que tenga, no a la
   pantalla. Todo lleva prefijo bb-/bbox para no chocar con el
   carrito, que ya usa .qty.
   Lógica en js/buybox.js; precio en js/pricing.js.
   ========================================================= */

.bbox { container-type: inline-size; }
/* El aviso se oculta con el atributo `hidden`, pero `.bbox__nudge` pone
   display:flex y lo pisaría: la hoja del móvil no trae la regla general
   `[hidden] { display: none !important }`. Sin esto sale una caja vacía. */
.bbox [hidden] { display: none !important; }
.bbox__grid { display: grid; gap: 24px; }
@container (min-width: 720px) {
  .bbox__grid { grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
  .bbox__stage { position: sticky; top: 96px; min-height: 560px; }
}

/* --- Foto: los envases que te llevas --------------------------------- */
.bbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 390px;
  padding: 20px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 50% 60%, rgba(197, 112, 77, .20), transparent 70%),
    var(--bg-1);
  overflow: hidden;
}
.bbox__bottles {
  position: relative;
  z-index: 1;
  display: grid;
  justify-content: center;
  align-content: center;
  gap: 10px 8px;
}
/* Sombra de apoyo, enganchada a la BASE de los envases (antes iba fija al
   fondo del recuadro y, como el alto de los envases cambia con la cantidad,
   quedaba flotando por debajo). z-index -1 dentro del contexto de
   .bbox__bottles: por detrás de los envases, por delante del fondo. */
/* Sobre el fondo casi negro una sombra sola no se ve: primero un charco de
   luz cálida en el "suelo" (::before) y encima la sombra de contacto (::after). */
.bbox__bottles::before,
.bbox__bottles::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.bbox__bottles::before {
  left: -22%; right: -22%;
  bottom: -26px;
  height: 56px;
  background: radial-gradient(closest-side, rgba(216, 138, 99, .22), rgba(197, 112, 77, .08) 55%, transparent);
}
.bbox__bottles::after {
  left: -3%; right: -3%;
  bottom: -8px;
  height: 18px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .95), rgba(0, 0, 0, .5) 55%, transparent);
}
.bbox__bottles img {
  height: var(--h);
  width: auto;
  max-width: none;
  justify-self: center;
  filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .65)) drop-shadow(0 4px 4px rgba(0, 0, 0, .4));
  animation: bb-pop .45s cubic-bezier(.2, .8, .2, 1.2) both;
}
@keyframes bb-pop {
  from { opacity: 0; transform: translateY(14px) scale(.92); }
  to { opacity: 1; transform: none; }
}
/* Altura del envase según cuántos se ven. Con 6 y 12 van en dos filas. */
.bb-s1  { --h: 320px; }
.bb-s3  { --h: 280px; }
.bb-s6  { --h: 170px; }
.bb-s12 { --h: 165px; gap: 8px 4px; }
@container (min-width: 720px) {
  .bb-s1  { --h: 400px; }
  .bb-s3  { --h: 340px; }
  .bb-s6  { --h: 225px; }
  .bb-s12 { --h: 205px; gap: 10px 5px; }
}
/* Más de 12: se ven 12 y una etiqueta con el resto. */
.bbox__more {
  position: absolute;
  right: -14px; top: -10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a0e08;
  font-weight: 800;
  font-size: 13px;
}

/* --- Panel ------------------------------------------------------------ */
.bbox__eyebrow {
  margin: 0 0 8px;
  color: var(--accent-hot);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
}
.bbox__title {
  margin: 0 0 18px;
  font-size: clamp(24px, 3cqi, 32px);
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
}

/* Los 4 packs: el primer número de cada tramo de precio. */
.bbox__tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.bb-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg-1);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color .2s, transform .2s, opacity .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.bb-tile:hover { transform: translateY(-2px); }
.bb-tile:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 2px; }
.bb-tile.is-on {
  border-color: var(--accent);
  background: rgba(197, 112, 77, .07);
  box-shadow: 0 0 0 1px var(--accent), 0 18px 40px -30px rgba(197, 112, 77, .5);
}
/* Cantidad libre: los packs se apagan y se marca el del tramo en el que cae. */
.bbox__tiles.is-free .bb-tile { opacity: .62; }
.bbox__tiles.is-free .bb-tile.is-tier {
  opacity: 1;
  border-color: var(--accent-glow);
  border-style: dashed;
}
.bb-tile.is-tier .bb-tile__e { color: var(--accent-hot); font-weight: 700; }
.bb-tile__n { display: block; font-size: 36px; font-weight: 800; line-height: 1; }
.bb-tile__u { display: block; margin: 4px 0 12px; font-size: 11px; letter-spacing: .2em; color: var(--ink-mute); }
.bb-tile__p { display: block; font-size: 19px; font-weight: 800; }
.bb-tile__e { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-mute); }
.bb-tile__off { display: block; margin-top: 8px; font-size: 12px; font-weight: 700; color: #7fbf8e; }
.bb-tile__off--mute { color: var(--ink-mute); }
@container (min-width: 720px) {
  .bb-tile { padding: 22px 10px 16px; }
  .bb-tile__n { font-size: 44px; }
}
.bb-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #1a0e08;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.bb-badge--muted {
  background: var(--bg-card);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}

.bbox__hint {
  margin: 0 0 12px;
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
}

/* Resumen: unidades, precio por unidad, ahorro y tramo. */
.bbox__sum {
  display: grid;
  gap: 4px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.bbox__sum p { margin: 0; line-height: 1.45; }
.bbox__line { color: var(--ink-soft); font-size: 14px; }
.bbox__line em { font-style: normal; color: #7fbf8e; font-weight: 700; white-space: nowrap; }
.bbox__tier { color: var(--ink-mute); font-size: 13px; }
.bbox__tier b { color: var(--ink-soft); font-weight: 600; }

/* Aviso "con 1 más…" / "por el mismo precio te llevas 12". */
.bbox__nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--accent-glow);
  border-radius: 10px;
  background: rgba(197, 112, 77, .10);
  font-size: 13.5px;
  line-height: 1.4;
}
.bbox__nudge b { color: var(--accent-hot); white-space: nowrap; }
.bbox__nudge button {
  flex: none;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent-hot);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* Contador − n + pegado al botón de añadir. */
.bbox__buy { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: stretch; }
.bb-qty {
  display: grid;
  grid-template-columns: 40px 48px 40px;
  align-items: center;
  height: 54px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-card);
}
.bb-qty button {
  height: 46px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bb-qty button:hover { background: rgba(255, 255, 255, .06); }
.bb-qty button:disabled { opacity: .35; cursor: default; background: transparent; }
.bb-qty input {
  width: 100%;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.bb-qty input:focus { outline: none; background: rgba(197, 112, 77, .10); border-radius: 8px; }
.bb-qty button:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: -2px; }
.bbox__cta.btn {
  width: 100%;
  min-height: 54px;
  padding: 12px 10px;
  font-size: 14px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bbox__ship {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}
.bbox__ship:empty { display: none; }
.bbox__ship.is-free { color: #7fbf8e; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .bbox__bottles img { animation: none; }
  .bb-tile { transition: none; }
}
