/* Raztro en la landing, sin fondo. Los videos vienen en verde y rastro-key.js quita el verde
   en un <canvas>; mientras carga (o sin movimiento) se ve una imagen fija transparente. */
.rastro {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  pointer-events: none;
}
.rastro-poster,
.rastro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.35s;
}
.rastro-canvas { opacity: 0; }
.rastro.is-playing .rastro-canvas { opacity: 1; }
.rastro.is-playing .rastro-poster,
.rastro.is-entering .rastro-poster { opacity: 0; }
html:not(.js) .rastro.is-entering .rastro-poster { opacity: 1; }
/* El video solo alimenta al canvas: queda invisible pero activo (Safari no decodifica display:none). */
.rastro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
/* En oscuro, un borde de luz naranja lo separa del fondo; en claro, una sombra suave. */
[data-theme="dark"] .rastro { filter: drop-shadow(0 0 26px rgba(255, 106, 31, 0.22)); }
[data-theme="light"] .rastro { filter: drop-shadow(0 22px 28px rgba(80, 40, 20, 0.18)); }

/* Hero: como Tipi, Raztro grande al lado del titular. En celular va arriba del título. */
.rastro--hero {
  order: -1;
  width: min(52vw, 220px);
  margin: -2rem auto 0;
}
.rastro--hero .rastro-bubble { display: none; }
@media (min-width: 1100px) {
  .hero-inner:has(.rastro--hero) {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
    align-items: center;
    justify-items: start;
    text-align: left;
  }
  .hero-inner:has(.rastro--hero) > :not(.rastro--hero) { grid-column: 1; }
  .hero-inner:has(.rastro--hero) .hero-title { font-size: clamp(3.2rem, 5.3vw, 5.4rem); }
  .hero-inner:has(.rastro--hero) .hero-cta,
  .hero-inner:has(.rastro--hero) .hero-trust { justify-content: flex-start; }
  .rastro--hero {
    order: 0;
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: center;
    width: min(100%, 560px);
    margin: 0;
  }
  .rastro--hero .rastro-bubble { display: block; }
}

.rastro-bubble {
  position: absolute;
  right: 74%;
  top: 6%;
  width: max-content;
  max-width: 230px;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--ember, #ff6a1f) 45%, transparent);
  border-radius: 14px;
  background: #241a16;
  color: #f5ede8;
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s, transform 0.4s;
}
.rastro-bubble b { color: var(--ember-2, #ff6a1f); }
.rastro-bubble::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 22px;
  width: 12px;
  height: 12px;
  background: #241a16;
  border-top: 1px solid color-mix(in srgb, var(--ember, #ff6a1f) 45%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--ember, #ff6a1f) 45%, transparent);
  transform: rotate(45deg);
}
.rastro.is-talking .rastro-bubble { opacity: 1; transform: none; }

/* Cómo funciona: su cara pensando junto a la receta. */
.rastro-chip {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #14100E;
  box-shadow: 0 0 0 2px var(--ember, #ff6a1f);
}
.rastro-chip video,
.rastro-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pane-head .rastro-chip { margin-left: auto; }

/* Módulos: se asoma sobre la ventana de recomendaciones y señala la tarjeta. */
.mod-visual { position: relative; }
.rastro--mod {
  position: absolute;
  z-index: 2;
  top: -190px;
  right: -60px;
  width: 260px;
  display: none;
}
@media (min-width: 1100px) {
  .rastro--mod { display: block; }
}

/* Cierre: pulgar arriba encima del título. */
.rastro--cta { width: clamp(220px, 24vw, 300px); margin: -1rem auto 1.2rem; }

/* Sección de Raztro: se asoma por detrás de la ventana del chat. */
.rastro--copilot { display: none; }
@media (min-width: 900px) {
  .rastro--copilot {
    display: block;
    position: relative;
    z-index: 0;
    width: clamp(230px, 22vw, 290px);
    margin: -0.5rem clamp(1rem, 6vw, 5rem) calc(clamp(230px, 22vw, 290px) * -0.46) auto;
  }
  .copilot .chat { position: relative; z-index: 1; }
}

/* Copiloto: avatar con su cara. */
.bot-avatar img,
.chat-face { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.bot-avatar:has(img) { padding: 0; overflow: hidden; border-radius: 50%; background: #14100E; }
.chat-face { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--ember, #ff6a1f); }

/* Cookies: Raztro con su galleta. */
.cookie-rastro {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #14100E;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ember, #ff6a1f) 60%, transparent);
}
.cookie-main:has(.cookie-rastro) { justify-content: flex-start; }
.cookie-main:has(.cookie-rastro) .cookie-actions { margin-left: auto; }
@media (max-width: 640px) {
  .cookie-rastro { width: 48px; height: 48px; }
}

/* Botón flotante de WhatsApp con la cara de Raztro. */
.sticky-wa:has(.sticky-face) { padding: 0; overflow: hidden; background: #14100E; box-shadow: 0 0 0 2px var(--ember, #ff6a1f), 0 14px 34px -10px color-mix(in srgb, var(--ember, #ff6a1f) 80%, transparent); }
.sticky-face { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (prefers-reduced-motion: reduce) {
  .rastro-video, .rastro-canvas { display: none; }
  .rastro-bubble { transition: none; }
}
