/* Main styles for La Terraza de Siruela */

/* Custom CSS Variables */
:root {
  --primary-brown: #6b7280;
  --primary-brown-light: #f3f4f6;
  --text-dark: #2D2D2D;
  --text-medium: #4A4A4A;
  --bg-light: #F8F8F8;
  --border-dark: #000000;
  --accent-gold: #6b7280;
  --accent-cream: #f9fafb;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.2);
  --shadow-heavy: rgba(0, 0, 0, 0.3);
  color-scheme: light;
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
}

button,
input,
select,
textarea {
  color-scheme: light;
}

input,
select,
textarea {
  color: var(--text-dark);
  background-color: #ffffff;
}

/* Header Navigation */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(210, 180, 140, 0.3);
  transition: all 0.3s ease;
}

.main-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px var(--shadow-light);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

@media (min-width: 768px) {
  .nav-container {
    justify-content: center;
    position: relative;
  }
  
  .logo {
    position: absolute;
    left: 1rem;
  }
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--primary-brown);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-brown);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-brown);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: color 0.3s ease;
}

.mobile-menu-btn:hover {
  color: var(--primary-brown);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 5px 20px var(--shadow-medium);
  border-top: 1px solid rgba(210, 180, 140, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  max-height: 300px;
}

.mobile-menu .nav-links {
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
  display: flex;
}

.mobile-menu .nav-links a {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(210, 180, 140, 0.2);
  display: block;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mobile-menu .nav-links a:hover {
  color: var(--primary-brown);
  padding-left: 0.5rem;
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hero-media-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  
  /* Optimizaciones para video HD */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
  
  /* Suavizado de video - removido para mejorar nitidez del texto */
}

.hero-poster {
  opacity: 1;
}

#hero-video {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#hero-video.is-loaded {
  opacity: 1;
}

/* Optimizaciones específicas para video */
.hero-background video,
#hero-video {
  /* Forzar aceleración por hardware */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  
  /* Optimización de rendering para texto nítido */
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  
  /* Escalado suave para texto */
  object-fit: cover;
  object-position: center center;
  
  /* Evitar blur en texto */
  filter: none;
  -webkit-filter: none;
  
  /* Mejor escalado */
  width: 100%;
  height: 100%;
}

/* Media queries para mejor calidad en pantallas HD */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-background video,
  #hero-video {
    /* Mejor rendering para texto en pantallas retina */
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    
    /* Sin filtros para mantener nitidez del texto */
    filter: none;
    -webkit-filter: none;
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
  z-index: 2;
}

.hero-content {
  text-align: center;
  z-index: 10;
  width: min(calc(100% - 2rem), 600px);
  max-width: 600px;
  padding: 2rem;
  position: relative;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.05;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 500;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.55);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero-buttons-main {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
  position: relative;
  z-index: 100;
}

.hero-btn-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.7);
  min-width: auto;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 100;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1);
}

.hero-btn-main:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-3px) scale(1.05);
}

.hero-btn-main i {
  font-size: 1.2rem;
}

.hero-btn-main span {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.whatsapp-float {
  position: fixed !important;
  inset: auto 18px 18px auto !important;
  right: 18px;
  right: max(18px, env(safe-area-inset-right));
  bottom: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 60px !important;
  height: 60px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #ffffff;
  border-radius: 50%;
  font-size: 1.75rem;
  text-decoration: none;
  opacity: 1 !important;
  visibility: visible !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  z-index: 3000 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  color: #ffffff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.38);
  outline: none;
}


.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--primary-brown);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(210, 180, 140, 0.4);
}

.hero-btn:hover {
  background: var(--primary-brown-light);
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(210, 180, 140, 0.6);
}

.hero-btn.secondary {
  background: transparent;
  color: white;
  border-color: white;
}

.hero-btn.secondary:hover {
  background: white;
  color: var(--text-dark);
}

/* Page sections */
.page-section {
  padding: 5rem 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-brown);
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 15px var(--shadow-light);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-medium);
  border-color: var(--primary-brown-light);
}

.card-header {
  background: var(--primary-brown);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border-top: 1px solid rgba(210, 180, 140, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-brown);
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--primary-brown-light);
  color: var(--text-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-brown);
  border: 2px solid var(--primary-brown);
}

.btn-secondary:hover {
  background: var(--primary-brown);
  color: white;
}

/* Footer */
.main-footer {
  background: var(--text-dark);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 5rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-brown-light);
}

.footer-section p,
.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--primary-brown-light);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-brown);
  color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--primary-brown-light);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero-buttons-main {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }
  
  .hero-btn-main {
    width: 100%;
    max-width: 250px;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .hero-btn-main i {
    font-size: 1.1rem;
  }

  .hero-background,
  #hero-video {
    object-position: center center;
  }

  .hero-title {
    font-size: clamp(2.15rem, 11vw, 3.4rem);
  }

  .hero-subtitle {
    max-width: min(100%, 300px);
    margin: 0 auto;
    line-height: 1.35;
  }

  .whatsapp-float {
    inset: auto 14px 14px auto !important;
    width: 56px !important;
    height: 56px !important;
    right: 14px;
    right: max(14px, env(safe-area-inset-right));
    bottom: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    font-size: 1.6rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .page-section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .nav-container {
    height: 60px;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .hero-content {
    padding: 1rem;
    width: min(calc(100% - 1.5rem), 600px);
  }
  
  .hero-btn-main {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    min-width: 180px;
  }
  
  .hero-btn-main i {
    font-size: 1rem;
  }
  
  .hero-btn-main span {
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}

/* Loading animations */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Upcoming Events Section - Opium Style */
.upcoming-events-section {
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #2d2d5a 100%);
  min-height: 100vh;
  padding: 4rem 0 8rem 0; /* Más padding inferior */
  position: relative;
  overflow: visible; /* Permitir que el contenido se vea completo */
  touch-action: pan-y; /* Asegurar scroll vertical en toda la sección */
}

.upcoming-events-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(15,15,35,0.8) 30%, rgba(15,15,35,1) 100%);
  z-index: 1;
}

.upcoming-events-section > .container {
  position: relative;
  z-index: 2;
  max-width: none !important; /* Eliminar limitación de Tailwind */
  width: 100% !important; /* Ancho completo */
}

.upcoming-events-title {
  font-family: 'Playfair Display', serif;
  font-size: 3rem;
  font-weight: 700;
  color: #6b8dd6;
  text-align: center;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.upcoming-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0 2rem 6rem 2rem; /* Más padding inferior */
  margin: 0 auto;
  width: 100%;
}

.upcoming-events-grid:active {
  cursor: grabbing;
}

/* Ocultar scrollbar */
.upcoming-events-grid::-webkit-scrollbar {
  display: none;
}

/* Responsive para carrusel */
@media (min-width: 768px) {
  .upcoming-events-grid {
    padding: 0 2rem 6rem 2rem; /* Más padding inferior */
    max-width: none; /* Eliminar limitación de ancho */
  }
  
  .upcoming-event-card {
    width: 320px; /* Ancho fijo en tablet */
    min-width: 320px; /* Forzar ancho mínimo */
    flex: 0 0 320px; /* Forzar ancho específico */
    align-self: flex-start; /* Evita que se estiren al mismo tamaño */
  }
}

@media (min-width: 1024px) {
  .upcoming-events-grid {
    padding: 0 2rem 6rem 2rem; /* Más padding inferior */
    max-width: none !important; /* Eliminar limitación de ancho */
    width: 100vw !important; /* Ancho de viewport completo */
    margin-left: calc(-50vw + 50%); /* Centrar pero expandir */
    position: relative;
  }
  
  .upcoming-events-grid::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 4rem;
    width: 50px;
    background: linear-gradient(to left, rgba(15,15,35,1) 0%, rgba(15,15,35,0) 100%);
    pointer-events: none;
    z-index: 10;
  }
  
  .upcoming-event-card {
    width: 350px !important; /* Ancho fijo en desktop */
    min-width: 350px !important; /* Forzar ancho mínimo */
    flex: 0 0 350px !important; /* Forzar ancho específico */
    max-width: 350px !important; /* Máximo también */
    align-self: flex-start !important; /* Evita que se estiren al mismo tamaño */
  }
}

.upcoming-event-card {
  background: white;
  border-radius: 20px;
  overflow: hidden; /* Mantener contenido dentro de la tarjeta */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto; /* No permitir que se encoja o crezca */
  width: 300px; /* Ancho fijo base */
  min-width: 300px; /* Ancho mínimo forzado */
  align-self: flex-start; /* Evita que se estiren al mismo tamaño */
  min-height: 500px; /* Altura mínima mayor para contenido expandido */
}

.upcoming-event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.event-date-header {
  background: white;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.event-day {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

.event-month {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  margin-left: 0.5rem;
}

.event-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  overflow: hidden;
  flex: 0 0 auto;
  line-height: 0;
}

.event-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.3s ease;
}

.event-poster-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.event-poster-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -6px;
}

.event-poster-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.event-poster-lightbox.active {
  display: flex;
}

.event-poster-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.86);
  cursor: zoom-out;
}

.event-poster-lightbox__figure {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 980px);
  max-height: 90vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.event-poster-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 52px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.event-poster-lightbox__caption {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.event-poster-lightbox__close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  cursor: pointer;
}

.event-poster-lightbox__close:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

body.event-poster-lightbox-open {
  overflow: hidden;
}

.site-footer {
  background: #ffffff;
  border-top: 2px solid #000000;
  border-radius: 2rem 2rem 0 0;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

.site-footer__inner {
  max-width: 768px;
  margin: 0 auto;
  text-align: center;
}

.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  color: #4A4A4A;
  font-size: 1.25rem;
}

.site-footer__links a {
  color: inherit;
  transition: color 0.3s ease, transform 0.3s ease;
}

.site-footer__links a:hover {
  color: #2D2D2D;
  transform: scale(1.25);
}

.site-footer__copy {
  color: #4A4A4A;
  margin-top: 1rem;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.site-footer__legal a {
  color: #4A4A4A;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-footer__legal a:hover,
.site-footer__legal a:focus-visible {
  color: #000000;
  border-color: #000000;
}

.legal-page {
  min-height: 100vh;
  background: #f8f8f8;
  padding-top: 96px;
}

.legal-hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 1.25rem 1.5rem;
  text-align: center;
}

.legal-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  color: #2D2D2D;
  margin-bottom: 1rem;
}

.legal-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: #4A4A4A;
  font-size: 1rem;
}

.legal-content {
  max-width: 900px;
  margin: 0 auto 4rem;
  padding: 0 1.25rem;
}

.legal-card {
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: clamp(1.5rem, 4vw, 3rem);
}

.legal-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  color: #2D2D2D;
  margin: 2rem 0 0.75rem;
}

.legal-card h2:first-child {
  margin-top: 0;
}

.legal-card p,
.legal-card li {
  color: #4A4A4A;
  line-height: 1.75;
}

.legal-card ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.legal-card a {
  color: #2D2D2D;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-updated {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.9rem;
  color: #6b7280;
}

.upcoming-event-card:hover .event-poster img {
  transform: scale(1.05);
}

.event-info {
  padding: 1.5rem;
  background: white;
  display: flex;
  flex-direction: column;
}

.event-time-price {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.event-time {
  background: white;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  border: 1px solid #000;
  color: #000;
  font-weight: 500;
  font-size: 0.8rem;
}

.event-price {
  background: white;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  border: 1px solid #000;
  color: #000;
  font-weight: 500;
  font-size: 0.8rem;
}

.event-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #d4af37;
  margin-bottom: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.3;
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-btn {
  width: 100%;
  background: #000;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.event-btn:hover {
  background: #333;
  transform: translateY(-2px);
}

.event-btn.small {
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
}

.event-btn.toggle-description.active i {
  transform: rotate(180deg);
}

.event-description {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 0 1rem;
  opacity: 0;
}

.event-description.show {
  max-height: 800px; /* Más espacio para descripciones largas */
  padding: 1rem;
  opacity: 1;
}

.event-description .description-content {
  padding: 0;
}

.event-description p {
  color: #333;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 0.8rem 0;
  font-weight: 400;
}

.event-description p:last-child {
  margin-bottom: 0;
}

.event-description p:empty {
  display: none;
}

.emoji-text {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Segoe UI Symbol', 'Android Emoji', 'EmojiSymbols';
  font-size: 1.1em;
  line-height: 1.4;
}

.event-actions {
  margin-top: 1rem;
}

.view-calendar-btn {
  display: inline-block;
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.7);
  padding: 1rem 2rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4rem;
  position: relative;
  z-index: 10;
}

.view-calendar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

/* Responsive para eventos */
@media (max-width: 768px) {
  .upcoming-events-title {
    font-size: 2rem;
  }
  
  /* Mejorar scroll vertical en móvil */
  .upcoming-events-section {
    touch-action: pan-y; /* Priorizar scroll vertical */
  }
  
  .upcoming-events-grid {
    display: flex !important;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 0 calc(50vw - 140px) 4rem calc(50vw - 140px); /* Más padding inferior */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    touch-action: pan-x; /* Solo scroll horizontal en el grid */
  }
  
  .upcoming-events-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
  
  .upcoming-event-card {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    align-self: flex-start; /* Evita que se estiren al mismo tamaño */
    touch-action: pan-y; /* Permitir scroll vertical en las tarjetas */
  }
  
  /* Destacar visualmente el evento más próximo en mobile */
  .upcoming-event-card.closest-event {
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
  }
}

/* Focus styles for accessibility */
.btn:focus,
.nav-links a:focus,
.hero-btn:focus {
  outline: 2px solid var(--primary-brown);
  outline-offset: 2px;
}

/* Home Events Section - Horizontal Scroll with Snap */
@media (max-width: 768px) {
  #upcoming-events-grid {
    display: flex !important;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden !important; /* Prevenir scroll vertical */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 0 calc(50vw - 140px) 4rem calc(50vw - 140px); /* Más padding inferior */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    touch-action: pan-x pan-y; /* Permitir pan horizontal y vertical */
  }
  
  #upcoming-events-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
  
  #upcoming-events-grid .upcoming-event-card {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    align-self: flex-start; /* Evita que se estiren al mismo tamaño */
    touch-action: manipulation; /* Permitir todos los gestos táctiles normales */
  }
  
  /* Destacar visualmente el evento más próximo en mobile */
  #upcoming-events-grid .upcoming-event-card.closest-event {
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
  }
  
  /* Distinguir eventos pasados de futuros */
  #upcoming-events-grid .upcoming-event-card.past-event {
    opacity: 0.75;
  }
  
  #upcoming-events-grid .upcoming-event-card.past-event .event-date-header {
    background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    color: #6b7280;
  }
  
  /* Eventos futuros mantienen el estilo normal del header */
  #upcoming-events-grid .upcoming-event-card.future-event .event-date-header {
    background: white;
    color: #333;
  }
  
  /* Asegurar que las tarjetas mantengan su altura independiente */
  #upcoming-events-grid .upcoming-event-card {
    height: auto !important;
    min-height: auto !important;
  }
}

/* Desktop Events Section - 3 Cards Carousel Style */
@media (min-width: 769px) {
  #upcoming-events-grid {
    display: flex !important;
    grid-template-columns: none !important; /* Anular grid anterior */
    flex-direction: row !important;
    gap: 2rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    /* Mostrar 3 tarjetas: padding calculado para centrar 3 tarjetas de 320px + 2 gaps de 2rem */
    padding: 2rem calc(50vw - 502px) 4rem calc(50vw - 502px) !important; /* Más padding inferior */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    justify-content: flex-start;
    align-items: flex-start;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }
  
  #upcoming-events-grid::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
  }
  
  /* Eliminar el degradado ::after que interfiere */
  #upcoming-events-grid::after {
    display: none !important;
  }
  
  #upcoming-events-grid .upcoming-event-card {
    flex: 0 0 320px !important;
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    align-self: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
  }
  
  /* Destacar visualmente el evento más próximo en desktop */
  #upcoming-events-grid .upcoming-event-card.closest-event {
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4);
    transform: scale(1.02);
  }
  
  /* Distinguir eventos pasados de futuros en desktop */
  #upcoming-events-grid .upcoming-event-card.past-event {
    opacity: 0.75;
  }
  
  #upcoming-events-grid .upcoming-event-card.past-event .event-date-header {
    background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%);
    color: #6b7280;
  }
  
  #upcoming-events-grid .upcoming-event-card.future-event .event-date-header {
    background: white;
    color: #333;
  }
}
