/* Portada con el anillo de ofertas en 3D. */
.hero.ring-hero {
  display: block;
  position: relative;
  padding: 0;
  min-height: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 46%, #ffe4c2 0%, #fdeedd 42%, #fbf5ec 78%);
  overflow: hidden;
  isolation: isolate;
}
.ring-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 34px 0;
}
.ring-head a, .ring-head .badge { pointer-events: auto; }
.ring-head .cta { margin-top: 30px; }
.ring-hero h1 {
  font-size: clamp(30px, 3.4vw, 46px);
  margin: 12px 0 0;
}
.ring-stage {
  position: relative;
  height: clamp(540px, 52vw, 660px);
}
/* Rayos de luz que giran despacio detrás de la bolsa. */
.ring-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  width: min(1300px, 150%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, #ffcf8a59 0deg 6deg, #ffcf8a00 6deg 17deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 8%, #0000 72%);
          mask-image: radial-gradient(closest-side, #000 8%, #0000 72%);
  animation: ring-rays 70s linear infinite;
  pointer-events: none;
}
@keyframes ring-rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
.ring-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 6px 11px;
  border-radius: 100px;
  background: #fff;
  color: #9b2c12;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 14px #c8501e26;
}
.ring-live[hidden] { display: none; }
.ring-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}
.ring-canvas.is-dragging { cursor: grabbing; }
.ring-canvas:focus-visible { box-shadow: inset 0 0 0 2px #8aa398; }
.ring-numbers {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.ring-numbers span {
  position: absolute;
  left: 0;
  top: 0;
  font: 700 12px/1 Arial, sans-serif;
  letter-spacing: .04em;
  color: #9aa79f;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  will-change: transform, opacity;
}
.ring-numbers span.is-front { color: #174c38; }
.ring-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 62px;
  height: auto;
  z-index: 3;
  pointer-events: none;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 6px 8px #8a3b1433);
  opacity: 0;
  transition: opacity .4s;
}
.ring-ready .ring-marker { opacity: 1; }
.ring-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .4s;
}
.ring-ready .ring-caption { opacity: 1; }
.ring-arrow {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #dcd4c7;
  background: #fff;
  color: #174c38;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ring-arrow:hover { border-color: #174c38; }
.ring-count { flex: none; color: #7b8a80; font-weight: 700; word-spacing: 4px; font-variant-numeric: tabular-nums; }
.ring-title-mask { flex: 1; min-width: 0; overflow: hidden; }
.ring-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #202621; font-weight: 700; }
.ring-title.rise { animation: ring-rise .9s cubic-bezier(.16, 1, .3, 1); }
@keyframes ring-rise { from { transform: translateY(105%); } to { transform: none; } }
.ring-price { flex: none; color: #174c38; font-size: 19px; }
.ring-buy {
  flex: none;
  background: var(--green, #174c38);
  color: #fff;
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}
.ring-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7b8a80;
  font-weight: 700;
}
.ring-ready .ring-loading { display: none; }

/* Sin WebGL2 o sin ofertas: la portada de siempre. */
.hero.ring-hero.ring-off { background: #fff2df url('portada-corre-que-vuela.png') center / cover no-repeat; }
.ring-off .ring-stage { height: 200px; }
.ring-off .ring-head { position: relative; }
.ring-off .ring-canvas, .ring-off .ring-caption, .ring-off .ring-marker, .ring-off .ring-numbers, .ring-off .ring-loading { display: none; }

@media (max-width: 650px) {
  .ring-head { position: relative; padding: 18px 18px 0; }
  .ring-head .cta { display: none; }
  .ring-hero h1 { font-size: 28px; }
  /* En el móvil: el texto sobre la escena, tarjetas grandes y el pie como una ficha debajo. */
  .ring-head { position: absolute; padding: 14px 16px 0; flex-direction: column; gap: 0; }
  .ring-head .badge { display: none; }
  .ring-live { margin: 0; }
  .ring-hero h1 { font-size: 27px; margin-top: 8px; }
  .ring-stage { height: auto; }
  .ring-stage::before { top: 36%; width: 190%; }
  .ring-canvas { position: relative; height: 540px; }
  .ring-caption {
    position: static;
    margin: 0 12px 14px;
    padding: 12px 14px 14px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 28px #7a462024;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
  }
  .ring-caption .ring-title-mask { grid-column: 1 / -1; order: -1; }
  .ring-caption .ring-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15px; line-height: 1.3; }
  .ring-caption .ring-price { font-size: 24px; }
  .ring-caption .ring-buy { grid-column: 1 / -1; margin: 2px 0 0; text-align: center; padding: 13px; font-size: 16px; border-radius: 12px; }
  .ring-title-mask { order: -1; flex-basis: 100%; }
  .ring-arrow { width: 36px; height: 36px; }
  .ring-buy { margin-left: auto; padding: 9px 12px; }
  .ring-price { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-stage::before { animation: none; }
  .ring-title.rise { animation: none; }
}
