/* =====================================================================
   CCA CAMPUS VIRTUAL — ESTILOS RULETA DE DESCUENTOS & CARRITO INTELIGENTE
   Estética de Feria de Premios, Luces de Carnaval, Alex Protagonista
   ===================================================================== */

/* Contenedor Principal de la Ruleta */
.cca-roulette-wrapper {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 2rem;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 60%, #080c14 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 40px -10px rgba(245, 158, 11, 0.15);
  overflow: hidden;
  padding: 2rem 1.5rem;
}

@media (min-width: 768px) {
  .cca-roulette-wrapper {
    padding: 3rem 2.5rem;
  }
}

/* Encabezado y Badges de Campaña */
.cca-roulette-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.2) 0%, rgba(245, 158, 11, 0.3) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fef08a;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

/* Marco de la Ruleta con Bombillas de Carnaval */
.cca-wheel-outer-ring {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 18px;
  background: conic-gradient(
    from 0deg,
    #b45309 0deg,
    #fbbf24 60deg,
    #78350f 120deg,
    #fef08a 180deg,
    #b45309 240deg,
    #fbbf24 300deg,
    #78350f 360deg
  );
  box-shadow: 
    0 0 0 4px #451a03,
    0 0 35px rgba(245, 158, 11, 0.6),
    inset 0 0 20px rgba(0, 0, 0, 0.8),
    0 15px 35px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: pan-y;
}

@media (min-width: 640px) {
  .cca-wheel-outer-ring {
    width: 380px;
    height: 380px;
    padding: 22px;
  }
}

@media (min-width: 1024px) {
  .cca-wheel-outer-ring {
    width: 440px;
    height: 440px;
    padding: 24px;
  }
}

/* Bombillas de Carnaval (Fairground Bulbs) */
.cca-carnival-bulb {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fef08a;
  border: 1px solid #78350f;
  box-shadow: 0 0 6px #fef08a, 0 0 12px #eab308;
  transform: translate(-50%, -50%);
  z-index: 15;
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .cca-carnival-bulb {
    width: 13px;
    height: 13px;
  }
}

.cca-carnival-bulb.bulb-alt {
  background: #fed7aa;
  box-shadow: 0 0 6px #fed7aa, 0 0 12px #f97316;
}

.cca-carnival-bulb.bulb-flash {
  animation: carnival-bulb-pulse 0.4s infinite alternate ease-in-out;
}

@keyframes carnival-bulb-pulse {
  0% {
    filter: brightness(0.6);
    box-shadow: 0 0 2px #fef08a;
  }
  100% {
    filter: brightness(1.6);
    box-shadow: 0 0 14px #ffffff, 0 0 25px #fbbf24;
  }
}

/* Canvas de la Ruleta */
.cca-wheel-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.7);
}

.cca-wheel-canvas-container:active {
  cursor: grabbing;
}

#cca-roulette-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Puntero Superior (Ticker Indicator) */
.cca-wheel-ticker {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 42px;
  z-index: 30;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.8));
  pointer-events: none;
  transform-origin: 50% 10px;
  transition: transform 0.08s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cca-wheel-ticker.tick-bounce {
  transform: translateX(-50%) rotate(-14deg);
}

/* Escudo Central Oficial de CCA */
.cca-wheel-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef08a 0%, #d97706 60%, #78350f 100%);
  border: 4px solid #fef3c7;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.6);
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 8px;
}

@media (min-width: 640px) {
  .cca-wheel-center-hub {
    width: 92px;
    height: 92px;
    padding: 10px;
  }
}

.cca-wheel-center-hub img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Personaje Alex Protagonista */
.cca-alex-companion-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.cca-alex-img-wrap {
  position: relative;
  width: 240px;
  max-width: 100%;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.7));
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .cca-alex-img-wrap {
    width: 300px;
  }
}

.cca-alex-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Bocadillo de Diálogo de Alex (Speech Bubble) */
.cca-alex-speech-bubble {
  position: relative;
  background: #1e293b;
  border: 2px solid rgba(245, 158, 11, 0.4);
  border-radius: 1.25rem;
  padding: 1rem 1.25rem;
  color: #f8fafc;
  font-size: 0.85rem;
  line-height: 1.45;
  max-width: 340px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.1);
  margin-bottom: 1rem;
}

.cca-alex-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: #1e293b transparent transparent;
  display: block;
  width: 0;
}

/* Cartel de Felicitación y Victoria */
.cca-victory-card {
  position: relative;
  border-radius: 1.75rem;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.3), inset 0 0 30px rgba(245, 158, 11, 0.15);
  padding: 2rem 1.5rem;
  text-align: center;
  overflow: hidden;
}

.cca-victory-glow-disc {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

/* Temporizador Digital LED de 24 Horas */
.cca-roulette-timer-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #020617;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 1rem;
  padding: 0.75rem 1.25rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 15px rgba(245, 158, 11, 0.2);
}

.cca-roulette-timer-digit {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
  letter-spacing: 0.05em;
  min-width: 2.2rem;
  text-align: center;
}

@media (min-width: 640px) {
  .cca-roulette-timer-digit {
    font-size: 1.75rem;
    min-width: 2.7rem;
  }
}

.cca-roulette-timer-sep {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 1.35rem;
  font-weight: 900;
  color: #d97706;
  animation: timer-colon-blink 1s infinite;
}

@keyframes timer-colon-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Confeti de Celebración */
.cca-confetti-particle {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  z-index: 50;
  animation: confetti-fall 3.2s linear forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(350px) rotate(720deg) scale(0.4);
  }
}

/* =====================================================================
   CARRITO INTELIGENTE & DRAWER MODAL
   ===================================================================== */

/* Botón Flotante del Carrito en Navegación */
.cca-cart-nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.8);
  color: #cbd5e1;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cca-cart-nav-btn:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.cca-cart-nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #f59e0b;
  color: #020617;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  border: 2px solid #080c14;
}

/* Drawer Lateral del Carrito */
.cca-cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cca-cart-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cca-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #0b1120;
  border-left: 1px solid rgba(51, 65, 85, 0.8);
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cca-cart-drawer.active {
  transform: translateX(0);
}

/* Items del Carrito */
.cca-cart-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(30, 41, 59, 0.9);
  transition: border-color 0.2s ease;
}

.cca-cart-item:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

.cca-cart-item-thumb {
  width: 60px;
  height: 48px;
  border-radius: 0.5rem;
  object-fit: cover;
  background: #020617;
  flex-shrink: 0;
}

/* Badge de Ahorro Máximo en Carrito */
.cca-savings-callout {
  border-radius: 0.875rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.2) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.75rem 1rem;
  color: #6ee7b7;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
