/*
 * ═══════════════════════════════════════════════════════════
 * TIMED EVENTS
 * Layout: tev-right ancho completo (flex row)
 *         tev-hero-img a la izquierda | tev-product-info a la derecha
 *         tev-bg-img como fondo decorativo de tev-right
 * ═══════════════════════════════════════════════════════════
 */

/* ── Contenedor: tarjetas apiladas ──────────────────────── */

.timed-events-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* ── Card (ahora <a> para SEO) ──────────────────────────── */

.timed-event-item {
  display: block;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .18);
  transition: transform .3s ease;
  text-decoration: none;
  color: inherit;
}

.timed-event-item:link,
.timed-event-item:visited {
  text-decoration: none;
  color: inherit;
}

.timed-event-item:hover {
  transform: translateY(-5px);
  text-decoration: none;
}

.timed-event-item:focus {
  outline: 2px solid rgba(17, 87, 238, 0.5);
  outline-offset: 4px;
}

/* ── Panel principal: ancho completo ─────────────────────── */

.tev-right {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 220px;

  background:#0c1f2c;
}

/* Capa oscura semitransparente sobre el bg_color para legibilidad */
.tev-right::before {
  content:"";
  position:absolute;
  left:0;
  bottom:0;
  width:100%;
  height:65%;
  background:linear-gradient(
      to top,
      rgba(0,0,0,.50),
      rgba(0,0,0,0)
  );
  z-index:1;
}

/* Luz radial superior */
.tev-right::after {
  content:"";
  position:absolute;
  top:-10%;
  left:-50%;
  width:160%;
  height:160%;
  background:radial-gradient(
      circle,
      rgba(255,255,255,.18),
      transparent 60%
  );
  transform:rotate(-18deg);
  z-index:1;
}

/* ── Imagen de fondo decorativa (cubre todo el panel) ───── */

.tev-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .25;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 0;
}

/* ── Wrapper de imagen hero (ancla para el ícono flotante) ── */

.tev-hero-wrap {
  position: relative;
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Imagen hero del producto ────────────────────────────── */

.tev-hero-img {
  position: relative;
  z-index: 2;
  width: 260px;
  height: 210px;
  object-fit: contain;
  padding: 1rem 0.5rem 1rem 1.5rem;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .5));
  transition: transform .5s ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.timed-event-item:hover .tev-hero-img {
  transform: rotate(-5deg) scale(1.06);
}

/* ── Info del producto ──────────────────────────────────── */

.tev-product-info {
  position: relative;
  z-index: 3;
  flex: 1;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: #f9fafb;
  box-sizing: border-box;
}

/* Badge + descuento */
.tev-top-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 20px;
}

.tev-discount-pct {
  display: inline-block;
  background: #ff3d3d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  padding: .18rem .48rem;
  border-radius: 6px;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(255, 61, 61, .45);
}

/* Título — color viene de inline style (bg_color del evento) */
.tev-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  flex: 1 1 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* fallback si bg_color no está disponible */
  background: linear-gradient(90deg, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Descripción */
.tev-desc {
  font-size: 0.8rem;
  line-height: 1.55;
  margin: 0;
  color: rgba(255, 255, 255, .75);
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Precios */
.tev-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tev-price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -.02em;
}

.tev-currency {
  font-size: 0.95rem;
  font-weight: 700;
  opacity: .92;
}

.tev-old-price {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, .55);
  text-decoration: line-through;
}

/* Timer */
.tev-timer {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tev-time-box {
  background: rgba(0, 0, 0, .3);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  text-align: center;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, .12);
}

.tev-time-box .countdown-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: block;
  line-height: 1.1;
}

.tev-time-box .countdown-unit {
  font-size: 0.5rem;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: block;
  margin-top: 1px;
}

/* Urgencia */
.tev-timer.countdown-urgent .tev-time-box {
  background: rgba(255, 160, 0, .25);
  border-color: rgba(255, 160, 0, .4);
}
.tev-timer.countdown-urgent .countdown-value {
  color: #ffd166;
}
.tev-timer.countdown-critical .tev-time-box {
  background: rgba(220, 53, 69, .4);
  border-color: rgba(220, 53, 69, .6);
}
.tev-timer.countdown-critical .countdown-value {
  color: #ff8fa3;
  animation: tev-blink .8s ease-in-out infinite;
}

@keyframes tev-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

/* Fila inferior: ahorro (izq) + botón (der) */
.tev-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.5rem;
}

/* Ahorro */
.tev-savings {
  font-size: 0.7rem;
  font-weight: 600;
  color: #ffd166;
  background: rgba(255, 209, 102, .15);
  padding: .15rem .45rem;
  border-radius: 5px;
}

/* Botón carrito: ajuste de tamaño para la card */
.tev-bottom-row .btn-add-cart {
  font-size: 0.72rem;
  margin-top: 0;
  flex: 0 0 auto;     /* 👈 CLAVE */
  width: auto;        /* 👈 evita 100% heredado */
}

/* Activar efecto gradient-shift en hover directo del botón
   (normalmente lo dispara .cm-card-base:hover, aquí lo reactivamos) */
.tev-right:hover .btn-add-cart.cm-effect-btn-gradient-shift::before {
  left: 100%;
}

.tev-right:hover .btn-add-cart.cm-effect-btn-gradient-shift::after {
  opacity: 1;
}

.tev-right:hover .btn-add-cart.cm-effect-btn-gradient-shift {
  transform: translateY(-2px);
  box-shadow: var(--cm-btn-shadow-hover);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* Tablet: reducir imagen hero */
@media (max-width: 900px) {
  .tev-hero-img {
    flex: 0 0 200px;
    width: 200px;
    height: 175px;
  }
}

/* Mobile: imagen arriba (pequeña), info abajo */
@media (max-width: 600px) {
  .tev-right {
    flex-direction: column;
    align-items: stretch;
  }

  .tev-hero-img {
    flex: none;
    width: 100%;
    height: 160px;
    padding: 1rem 2rem 0.5rem;
  }

  .tev-product-info {
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .tev-price {
    font-size: 1.4rem;
  }

  .tev-title {
    font-size: 0.95rem;
    -webkit-line-clamp: 2;
  }

  .tev-btn {
    align-self: flex-end;
  }
}
