/* Fondo INDEX: color pastel liso */
:root {
  --radius: 18px;
}

body {
  /* color de respaldo si la imagen no carga */
  background-color: #ffffff;

  /* overlay cálido + imagen */
  background-image: url("https://i.imgur.com/PaaK1P6.png");

  background-position: center;
  background-repeat: repeat;
  background-size: cover; /* usá 'cover' si querés que siempre ocupe todo */
}

/* Slides del hero (crossfade) */
.hero-slide {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(0.95) contrast(0.98);
  transition: opacity 0.8s ease-in-out;
}
.opacity-0 {
  opacity: 0;
}
.opacity-100 {
  opacity: 1;
}

/* Sombra de marca (antes shadow-orange) → celeste */
.shadow-sky {
  /* sky-500 aprox: rgb(14,165,233) */
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.35);
}

/* Sombra cálida sutil (para botones si querés) */
.shadow-warm {
  /* naranja ~ #f97316 con baja opacidad */
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.22);
}

/* Panel y cards: base blanca con tinte cálido MUY leve */
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.14); /* amber-500 muy suave */
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.06);
  backdrop-filter: saturate(1.05) blur(2px);
}
.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.14);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.06);
  backdrop-filter: saturate(1.05) blur(2px);
  max-width: 100%;
}

/* miniatura con borde apenas cálido */
.thumb {
  width: 86px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 158, 11, 0.12);
}

/* Offset global extra por si hay más anclas */
[id] {
  scroll-margin-top: 6rem;
}

/* Badge del carrito */
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #111;
  color: #fff;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Quita el fondo aplicado al body solo en carrito y deja la capa fija encargarse */
.page--carrito {
  background-image: url("https://i.imgur.com/PaaK1P6.png");
  background-position: center;
  background-repeat: repeat;
  background-size: cover; /* o cover */
}

/* Empty state */
.empty-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(14, 165, 233, 0.14); /* leve celeste */
}

/* Borde con brillo suave (gradiente animado muy tenue) */
.empty-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--radius);
  background: conic-gradient(
    from 0deg,
    rgba(14, 165, 233, 0.18),
    rgba(249, 115, 22, 0.18),
    rgba(14, 165, 233, 0.18)
  );
  filter: blur(18px);
  opacity: 0.25;
  z-index: -1;
  animation: glowSpin 10s linear infinite;
}

@keyframes glowSpin {
  to {
    transform: rotate(1turn);
  }
}

/* Ilustración */
.empty-ill {
  width: 96px;
  height: 96px;
  color: #0f172a; /* slate-900 */
  opacity: 0.9;
}

/* Chispitas */
.sparkle-wrap {
  position: relative;
  width: 96px;
  height: 96px;
}
.sparkle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% + var(--dx, 0)), calc(-50% + var(--dy, 0)));
  font-size: 14px;
  opacity: 0;
  animation: sparklePop 2.6s var(--delay, 0s) ease-in-out infinite;
  pointer-events: none;
}

@keyframes sparklePop {
  0% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 0.85;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(1);
  }
  60% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(1.1);
  }
}

/* Botón Agregar: feedback táctil */
.js-add {
  position: relative;
  overflow: hidden;
  transform: translateZ(0); /* evita blur durante animación */
  transition: transform 0.06s ease, opacity 0.2s ease;
}
.js-add:active {
  transform: scale(0.97);
}

/* Ripple */
.js-add::after {
  content: "";
  position: absolute;
  left: var(--rx, 50%);
  top: var(--ry, 50%);
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
}
.js-add.rippling::after {
  animation: agRipple 0.4s ease-out forwards;
}
@keyframes agRipple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.35;
  }
  100% {
    transform: translate(-50%, -50%) scale(10);
    opacity: 0;
  }
}

/* Badge bump del carrito */
@keyframes badgeBump {
  0% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-2px) scale(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
.cart-badge.bump {
  animation: badgeBump 0.35s ease-out;
}

/* Imagen que vuela al carrito */
.fly-clone {
  position: fixed;
  z-index: 9999;
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.6s ease;
  opacity: 0.95;
}

/* --- Título mágico --- */
/* Título en negro, sin degradé ni shimmer */
.title-text {
  color: #0f172a; /* negro/slate-900 */
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  animation: none !important;
}

/* El subrayado ahora parte del inicio del texto */
.title-underline {
  left: 0; /* antes 52px cuando había ícono */
  bottom: -6px;
  height: 8px;
  width: 110%; /* 100–120% según gusto */
}

@keyframes underlinePulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scaleX(0.98);
  }
  50% {
    opacity: 0.9;
    transform: scaleX(1.06);
  }
}

.title-spark {
  position: absolute;
  left: calc(52px + var(--dx, 0));
  top: var(--dy, 0);
  font-size: 14px;
  opacity: 0;
  animation: sparkFloat 2.6s var(--delay, 0s) ease-in-out infinite;
  pointer-events: none;
}
@keyframes sparkFloat {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
    transform: translateY(-2px) scale(1);
  }
  70% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translateY(-4px) scale(1.05);
  }
}

/* chip items */
.chip-items {
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  color: #0f172a;
}

/* --- Microinteracciones en listas/paneles --- */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* aparición suave en scroll */
.reveal {
  opacity: 0;
  transform: translateY(8px) scale(0.99);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* panel con borde “mágico” leve */
.panel {
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--radius);
  background: conic-gradient(
    from 0deg,
    rgba(14, 165, 233, 0.18),
    rgba(245, 158, 11, 0.18),
    rgba(14, 165, 233, 0.18)
  );
  filter: blur(14px);
  opacity: 0.18;
  z-index: -1;
  animation: glowSpin 12s linear infinite;
}
@keyframes glowSpin {
  to {
    transform: rotate(1turn);
  }
}

.shadow-hero {
  box-shadow: 0 18px 35px rgb(0, 0, 0); /* sombra intensa debajo */
  z-index: 5; /* asegurás que quede por encima del fondo */
}

.chip {
  /* antes: white-space: nowrap; */
  white-space: normal; /* permite saltos de línea */
  overflow: hidden; /* oculta exceso si supera 2 líneas */
  text-overflow: ellipsis; /* por si no alcanza el clamp */
  display: -webkit-box; /* necesario para line-clamp */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 👉 máx. 2 líneas */
  line-clamp: 2;

  /* estilo visual que ya tenías */
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  color: #0f172a;
  max-width: 100%; /* que nunca exceda el contenedor */
  word-break: break-word; /* corta palabras muy largas */
  overflow-wrap: anywhere; /* alternativa a break-word */
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}
.thumbs button {
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.thumbs button:hover {
  transform: translateY(-2px) scale(1.02);
}
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumbs button[aria-current="true"] {
  border-color: rgba(245, 158, 11, 0.6);
}

/* Galería */
.gallery-main {
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Galería con flechas */
.gallery-main {
  position: relative;
}
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease, opacity 0.2s ease;
  opacity: 0.9;
}
.nav-arrow:hover {
  transform: translateY(-50%) scale(1.04);
}
.nav-arrow:active {
  transform: translateY(-50%) scale(0.98);
}
.nav-arrow--prev {
  left: 8px;
}
.nav-arrow--next {
  right: 8px;
}
.nav-arrow svg {
  width: 18px;
  height: 18px;
  stroke: #0f172a;
}

/* Thumbs en fila con scroll-snap y máscaras sutiles */
.thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 2px 4px 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    #000 10%,
    #000 90%,
    rgba(0, 0, 0, 0)
  );
}
.thumbs::-webkit-scrollbar {
  height: 8px;
}
.thumbs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}
.thumbs button {
  flex: 0 0 76px;
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  scroll-snap-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
}
.thumbs button:hover {
  transform: translateY(-2px) scale(1.02);
}
.thumbs button[aria-current="true"] {
  border-color: rgba(245, 158, 11, 0.6);
}

.thumbs {
  scroll-behavior: smooth;
}

#btn-add.js-add::after {
  background: rgba(255, 255, 255, 0.35);
}

/* underline animado solo debajo de la palabra */
.underline-anim {
  position: relative;
  display: inline-block;
}

.underline-anim::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px; /* separación del texto */
  height: 3px;
  width: 100%;
  background: #000; /* negro sólido */
  transform-origin: left;
  transform: scaleX(0);
  animation: underlineBounce 2s ease-in-out infinite;
  border-radius: 999px;
}

@keyframes underlineBounce {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  40% {
    transform: scaleX(1);
    transform-origin: left;
  }
  50% {
    transform: scaleX(1);
    transform-origin: right;
  }
  90% {
    transform: scaleX(0);
    transform-origin: right;
  }
  100% {
    transform: scaleX(0);
    transform-origin: left;
  }
}

/* Subrayado animado para links del nav */
header nav a {
  position: relative;
  text-decoration: none;
}

header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px; /* separación con el texto */
  height: 2px;
  width: 100%;
  background: #000; /* negro sólido */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

header nav a:hover::after,
header nav a:focus-visible::after {
  transform: scaleX(1); /* se queda extendido hasta que saques el mouse */
}

/* Subrayado animado del nombre al hover de la tarjeta (index) */
#productList .card h3 {
  position: relative;
  display: inline-block; /* el subrayado ajusta al texto */
}

#productList .card h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px; /* separación del texto */
  height: 2px;
  width: 100%;
  background: #000; /* negro sólido */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

/* Al pasar por la tarjeta, sólo subraya el nombre */
#productList .card:hover h3::after,
#productList .card:focus-within h3::after {
  transform: scaleX(1);
}

/* Subrayado trampolín solo bajo el título dinámico de productos.html */
#p-title {
  position: relative;
  display: inline-block; /* limita el ancho al texto */
}

#p-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px; /* distancia al texto */
  height: 3px;
  width: 100%;
  background: #000; /* negro sólido */
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(0);
  animation: underlineBounce 2s ease-in-out infinite;
}

/* Opcional: ligera corrección en pantallas chicas */
@media (max-width: 480px) {
  #p-title::after {
    bottom: -4px;
    height: 2.5px;
  }
}

/* Carrito: oculto el subrayado viejo para no duplicar */
.title-hero .title-underline {
  display: none;
}

/* Título "Tu Carrito": una sola línea + underline trampolín negro */
.title-hero .title-text {
  position: relative;
  display: inline-block; /* el underline calza al texto */
  white-space: nowrap; /* evita salto de línea */
  word-break: keep-all;
  /* opcional: tamaño fluido para evitar wrap en móviles muy chicos */
  font-size: clamp(1.75rem, 5.5vw, 2.5rem); /* ~ entre 28px y 40px aprox */
}

.title-hero .title-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px; /* separación del texto */
  height: 3px;
  width: 100%;
  background: #000; /* negro sólido */
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(0);
  animation: underlineBounce 2s ease-in-out infinite;
}

/* Ajuste fino en móviles muy pequeños */
@media (max-width: 420px) {
  .title-hero .title-text::after {
    bottom: -4px;
    height: 2.5px;
  }
}

.promo-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.18rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, #059669, #10b981); /* emerald 600→500 */
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
  white-space: normal; /* 👈 ahora puede saltar a otra línea */
  word-break: break-word; /* evita que se salga del contenedor */
  text-align: center; /* se ve mejor en varias líneas */
}

.promo-note {
  position: relative;
  font-size: 0.9rem;
  font-weight: 600;
  color: #065f46; /* emerald-800 */
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  padding: 0.35rem 0.6rem 0.35rem 1.6rem;
  display: -webkit-box; /* necesario para line-clamp */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 👉 máx. 2 líneas */
  line-clamp: 2;
  overflow: hidden; /* corta si hay más de 2 líneas */
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%; /* no se desborda */
}
.promo-note::before {
  content: "✓";
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  opacity: 0.9;
}

/* opcional: leve pulso al cargar */
@keyframes promoPop {
  0% {
    transform: scale(0.98);
    opacity: 0.85;
  }
  60% {
    transform: scale(1.02);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.promo-badge {
  animation: promoPop 0.35s ease-out both;
}

/* Chip de promo (verde) */
.chip--promo {
  background: linear-gradient(135deg, #059669, #10b981); /* emerald 600→500 */
  color: #fff;
  border: 0;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.25);
}

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* cuadrado para fotos */
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.5s ease; /* transición fluida */
}

.gallery-main.video-mode {
  aspect-ratio: auto; /* desactiva el cuadrado */
  height: 70vh; /* rectangular para video */
}

.gallery-main video {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #000;
  border-radius: 0.75rem;
}

/* Subrayado animado del nombre al hover de la tarjeta (index) */
#productList .card h3,
#dominoList .card h3 {
  position: relative;
  display: inline-block;
}

#productList .card h3::after,
#dominoList .card h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: #000;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

/* Al pasar por la tarjeta, subraya el nombre (en ambas listas) */
#productList .card:hover h3::after,
#productList .card:focus-within h3::after,
#dominoList .card:hover h3::after,
#dominoList .card:focus-within h3::after {
  transform: scaleX(1);
}

/* Toggle switch moderno */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

/* Activado: color verde */
input:checked + .slider {
  background-color: #22c55e; /* verde tipo tailwind emerald-500 */
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Hover suave */
.switch:hover .slider {
  background-color: #86efac; /* verde claro al pasar el mouse */
}

/* ===== Slot / Casino price roll – ajustes de tipografía ===== */
#p-price {
  display: inline-flex;
  align-items: baseline;
}

.price-roll {
  display: inline-flex;
  gap: 0.02em;
  align-items: baseline;
  height: 1em;
  line-height: 1em;
  /* números de ancho fijo para que no “bailen” */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.01em;
}

.price-roll .sep {
  opacity: 0.9;
  line-height: 1em;
}

/* cada dígito ocupa ancho fijo relativo a la fuente actual */
.reel {
  position: relative;
  overflow: hidden;
  width: 0.62em; /* si ves recortes, subí a 0.66em */
  height: 1em;
}

.reel-inner {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.1, 1);
}

.reel-digit {
  height: 1em;
  display: block;
}
