/* ===========================
   CARRERA DE NAVIDAD MANZANARES 2025
   ESTILOS COMUNES
   =========================== */

/* ===========================
   VARIABLES CSS - PALETA
   =========================== */
:root {
  /* Colores principales */
  --rojo-navidad: #C41E3A;
  --rojo-brillante: #DC143C;
  --verde-pino: #2D5F4C;
  --verde-claro: #5A8A72;
  --dorado: #D4AF37;
  --dorado-claro: #FFD700;
  --blanco-nieve: #FFFFFF;
  --gris-suave: #F8F9FA;
  --azul-profundo: #1E3A5F;
  --azul-medio: #2C5282;
  
  /* Sombras */
  --sombra-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --sombra-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --sombra-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --sombra-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Transiciones */
  --trans-rapida: 150ms ease-in-out;
  --trans-media: 300ms ease-in-out;
  --trans-lenta: 500ms ease-in-out;
}

/* ===========================
   RESET Y BASE
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
}

/* ===========================
   TIPOGRAFÍA
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Mountains of Christmas', cursive, sans-serif;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

/* ===========================
   COMPONENTES REUTILIZABLES
   =========================== */

/* Botones */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border-radius: 50px;
  transition: all var(--trans-media);
  cursor: pointer;
  border: none;
  box-shadow: var(--sombra-lg);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--dorado) 0%, var(--dorado-claro) 100%);
  color: var(--azul-profundo);
  animation: pulse-glow 2s ease-in-out infinite;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: var(--sombra-xl), 0 0 30px rgba(212, 175, 55, 0.6);
}

.btn-secondary {
  background: var(--rojo-navidad);
  color: var(--blanco-nieve);
}

.btn-secondary:hover {
  background: var(--rojo-brillante);
  transform: scale(1.05);
}

/* Cards */
.card {
  background: var(--blanco-nieve);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--sombra-md);
  transition: all var(--trans-media);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--sombra-xl);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--rojo-navidad);
  color: var(--blanco-nieve);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0.25rem;
}

.badge-gold {
  background: var(--dorado);
  color: var(--azul-profundo);
}

.badge-green {
  background: var(--verde-pino);
}

/* ===========================
   ANIMACIONES
   =========================== */

/* Brillo dorado pulsante */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.8);
  }
}

/* Bounce suave */
@keyframes bounce-soft {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Fade in up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Efecto nieve */
@keyframes snowfall {
  0% {
    transform: translateY(-10vh) translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) translateX(100px);
    opacity: 0.3;
  }
}

.snowflake {
  position: absolute;
  top: -10vh;
  color: var(--blanco-nieve);
  font-size: 1.5rem;
  opacity: 0.8;
  animation: snowfall linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* Shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  background-size: 1000px 100%;
  animation: shimmer 3s infinite;
}

/* Rotate */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Scale pulse */
@keyframes scale-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ===========================
   UTILIDADES
   =========================== */

/* Contenedor principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Sección */
.section {
  padding: 4rem 0;
}

.section-dark {
  background: var(--azul-profundo);
  color: var(--blanco-nieve);
}

.section-light {
  background: var(--gris-suave);
}

.section-green {
  background: var(--verde-pino);
  color: var(--blanco-nieve);
}

.section-red {
  background: var(--rojo-navidad);
  color: var(--blanco-nieve);
}

/* Grid responsive */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-gradient {
  background: linear-gradient(135deg, var(--dorado) 0%, var(--dorado-claro) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Espaciado */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* ===========================
   NAVIGATION
   =========================== */
#main-nav {
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--azul-profundo);
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: var(--rojo-navidad);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--rojo-navidad);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--azul-profundo);
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background: var(--gris-suave);
    color: var(--rojo-navidad);
}

/* ===========================
   HEADER STICKY
   =========================== */
.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--rojo-navidad), var(--rojo-brillante));
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.header-sticky.visible {
    transform: translateY(0);
}

/* ===========================
   MODAL
   =========================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: fadeInUp 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: var(--rojo-navidad);
  color: var(--blanco-nieve);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--trans-rapida);
}

.modal-close:hover {
  background: var(--rojo-brillante);
  transform: rotate(90deg);
}

/* ===========================
   COUNTDOWN TIMER
   =========================== */
.countdown {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.countdown-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  min-width: 100px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.countdown-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--dorado-claro);
  display: block;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.countdown-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
  opacity: 0.9;
}

/* ===========================
   TABLA RESPONSIVE
   =========================== */
.table-responsive {
  overflow-x: auto;
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanco-nieve);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sombra-md);
}

thead {
  background: var(--azul-profundo);
  color: var(--blanco-nieve);
}

th, td {
  padding: 1rem;
  text-align: left;
}

tbody tr:nth-child(even) {
  background: var(--gris-suave);
}

tbody tr:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* ===========================
   ACORDEÓN
   =========================== */
.accordion-item {
  background: var(--blanco-nieve);
  border-radius: 12px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--sombra-sm);
}

.accordion-header {
  padding: 1.5rem;
  background: var(--gris-suave);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background var(--trans-rapida);
}

.accordion-header:hover {
  background: rgba(212, 175, 55, 0.1);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--trans-media);
}

.accordion-content.active {
  max-height: 5000px;
}

.accordion-body {
  padding: 1.5rem;
  line-height: 1.8;
}

/* ===========================
   TABS
   =========================== */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gris-suave);
  flex-wrap: wrap;
}

.tab {
  padding: 1rem 2rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  transition: all var(--trans-rapida);
  border-bottom: 3px solid transparent;
}

.tab:hover {
  color: var(--rojo-navidad);
}

.tab.active {
  color: var(--rojo-navidad);
  border-bottom-color: var(--rojo-navidad);
}

.tab-content {
  display: none;
  animation: fadeInUp 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

/* ===========================
   ICONOS SVG
   =========================== */
.icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.icon-lg {
  width: 48px;
  height: 48px;
}

.icon-xl {
  width: 64px;
  height: 64px;
}

/* ===========================
   GALERÍA
   =========================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--trans-media);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* ===========================
   STICKY CTA MÓVIL
   =========================== */
.sticky-cta {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: none;
  animation: bounce-soft 2s ease-in-out infinite;
}

.sticky-cta.visible {
  display: block;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .countdown-item {
    min-width: 80px;
    padding: 1rem 0.5rem;
  }
  
  .countdown-number {
    font-size: 2rem;
  }
  
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  th, td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .countdown-number {
    font-size: 1.5rem;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   ACCESIBILIDAD
   =========================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

*:focus-visible {
  outline: 3px solid var(--dorado);
  outline-offset: 2px;
}

/* ===========================
   PRINT
   =========================== */
@media print {
  .header-sticky,
  .sticky-cta,
  .btn,
  .modal {
    display: none !important;
  }
}
