/* Module: events */
/* ===== BEAT4PASS EVENTOS - CSS COMPLETO ===== */
/* Estilo moderno tipo "app móvil" con diseño oscuro y tarjetas redondeadas */

:root {
  /* === PALETA DE COLORES === */
  --background-dark: #0a0e1a;      /* Fondo oscuro principal */
  --content-bg: #f8fafc;           /* Fondo del contenido blanco/gris muy claro */
  --card-white: #fff;              /* Tarjetas blancas */
  
  --text-primary: #0f172a;         /* Texto principal (títulos, negrita) */
  --text-secondary: #475569;       /* Texto secundario (descripciones) */
  --text-muted: #64748b;          /* Texto apagado (hints, labels) */
  --text-light: #94a3b8;          /* Texto muy claro (deshabilitado) */
  
  --accent-primary: #6366f1;       /* Púrpura principal */
  --accent-secondary: #8b5cf6;     /* Violeta secundario */
  --accent-hover: #4f46e5;         /* Hover púrpura más oscuro */
  --accent-alt: #7c3aed;           /* Hover violeta más oscuro */
  
  --success: #16a34a;              /* Verde éxito */
  --warning: #fbbf24;              /* Amarillo advertencia */
  --error: #ef4444;                /* Rojo error */
  --info: #3b82f6;                 /* Azul información */
  
  --border-light: #e2e8f0;         /* Bordes suaves */
  --border-medium: #cbd5e1;        /* Bordes medianos */
  --border-dark: #94a3b8;          /* Bordes oscuros */
  
  /* === ESPACIADO Y MEDIDAS === */
  --radius-sm: 12px;               /* Pequeño (badges, features) */
  --radius-md: 16px;               /* Medio (inputs, botones) */
  --radius-lg: 18px;               /* Grande (cards) */
  --radius-xl: 32px;               /* Extra grande (contenedor principal) */
  --radius-full: 999px;            /* Circular completo (badges) */
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.1);
  --shadow-md: 0 3px 12px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 6px 20px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 12px 36px rgba(99, 102, 241, 0.45);  /* Botones principales */
  --shadow-hover: 0 6px 20px rgba(15, 23, 42, 0.15);
  
  --element-gap: 12px;             /* Entre elementos */
  --section-gap: 28px;             /* Entre secciones */
}

/* === BASE Y RESET === */
body {
  background: var(--background-dark);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

/* === CONTENEDOR PRINCIPAL === */
.eh-public-events {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  background: var(--content-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin-top: -24px;
  position: relative;
  z-index: 3;
  padding: 20px 20px 140px;
}

/* === TÍTULO === */
.eh-title {
  text-align: center;
  font-weight: 900;
  margin: var(--section-gap) auto;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
}

/* === FILTROS === */
.eh-filters {
  display: grid;
  grid-template-columns: 1fr 160px 160px 160px auto auto;
  gap: var(--element-gap);
  margin: 10px auto 20px;
  max-width: 1080px;
}

.eh-filters input,
.eh-filters select {
  height: 44px;
  padding: 0 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--card-white);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.eh-filters input:focus,
.eh-filters select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.eh-filters button {
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--card-white);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-xl);
  transition: all 0.3s ease;
  cursor: pointer;
}

.eh-filters button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(99, 102, 241, 0.55);
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-alt));
}

.eh-filters .eh-clear {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.2s ease;
}

.eh-filters .eh-clear:hover {
  background: var(--border-medium);
  transform: translateY(-1px);
}

/* === GRID DE EVENTOS === */
.eh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--section-gap);
  max-width: 1080px;
  margin: 0 auto 32px;
}

/* === TARJETAS DE EVENTO === */
.eh-card {
  display: flex;
  flex-direction: column;
  background: var(--card-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  padding: 16px 18px;
}

.eh-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.eh-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: block;
  background: var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.eh-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eh-media-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text-light);
  font-size: 20px;
}

/* === BADGES === */
.eh-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--card-white);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.eh-badge-day {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
}

.eh-badge-low {
  background: var(--warning);
  right: 12px;
  left: auto;
  color: var(--text-primary);
}

.eh-badge-sold {
  background: var(--error);
  right: 12px;
  left: auto;
}

/* === CUERPO DE LA TARJETA === */
.eh-card-body {
  padding: 14px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eh-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
  color: var(--text-primary);
}

.eh-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eh-meta {
  list-style: none;
  padding: 0;
  margin: 4px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.eh-meta li {
  background: var(--border-light);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* === PIE DE TARJETA === */
.eh-card-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.eh-price-chip {
  background: rgba(22, 163, 74, 0.1);
  color: #168fa3;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.0rem;
}

.eh-price-chip.sold {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* === BOTÓN PRINCIPAL === */
.eh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--card-white);
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-xl);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  width: auto;
}

.eh-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(99, 102, 241, 0.55);
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-alt));
  color: var(--card-white);
  filter: none;
}

/* === ESTADO AGOTADO === */
.eh-card.item--soldout {
  position: relative;
  opacity: 0.6;
  overflow: hidden;
}

.eh-card.item--soldout::before {
  content: 'AGOTADAS';
  position: absolute;
  top: 50%;
  left: -10%;
  right: -10%;
  background: linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9));
  color: white;
  font-weight: bold;
  font-size: 16px;
  padding: 6px 0;
  text-align: center;
  transform: translateY(-50%) rotate(-12deg);
  letter-spacing: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
  pointer-events: none;
}

/* === ESTADO VACÍO === */
.eh-empty {
  text-align: center;
  color: var(--text-muted);
  margin: var(--section-gap) 0;
  font-size: 1.1rem;
}

/* === PAGINACIÓN === */
.eh-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 30px;
}

.eh-page {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--border-light);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.eh-page.current {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--card-white);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.eh-page.disabled {
  opacity: .5;
  pointer-events: none;
}

.eh-page:not(.current):hover {
  background: var(--border-medium);
  transform: translateY(-1px);
}

/* === RESPONSIVE DESIGN === */

/* Tablet */
@media (max-width: 991.98px) {
  .eh-filters {
    grid-template-columns: 1fr 1fr;
  }
  
  .eh-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  .eh-public-events {
    padding: 20px 14px 120px;
  }
}

/* Mobile */
@media (max-width: 575.98px) {
  .eh-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .eh-filters {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .eh-public-events {
    padding: 16px 12px 100px;
    border-radius: 24px 24px 0 0;
  }
  
  .eh-title {
    font-size: 1.8rem;
    margin: 20px auto;
  }
  
  .eh-card {
    padding: 14px 16px;
  }
  
  .eh-card-body {
    padding: 12px 0 6px;
  }
  
  .eh-btn {
    height: 42px;
    font-size: 0.95rem;
  }
}

/* Desktop pequeño */
@media (max-width: 1024px) and (min-width: 992px) {
  .eh-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === OFFSETS PARA WORDPRESS === */
:root {
  --eh-root-pl: 0px;
  --eh-root-pt: 0px;
}

body {
  --wp--style--root--padding-left: var(--eh-root-pl);
  --wp--style--root--padding-top: var(--eh-root-pt);
}

.eh-hero.is-flush-top {
  margin-top: var(--eh-root-pt);
}

/* Topbar detectada */
body.admin-bar,
body:has(#wpadminbar),
body:has(.eh-topbar),
body:has(.site-header.is-sticky),
body:has(header.is-sticky),
body:has(.wp-block-template-part[aria-label*="header" i]) {
  --eh-root-pt: calc(var(--wp--preset--spacing--40, 14px) * 3);
}

/* Sidebar detectada */
body:has(
  #ehSidebar,
  #ehsidebar,
  [id*="sidebar" i],
  [class*="sidebar" i],
  aside[role="complementary"],
  .wp-block-template-part[aria-label*="sidebar" i],
  .wp-block-template-part[aria-label*="barra" i],
  .wp-block-template-part[aria-label*="lateral" i],
  [data-wp-area="sidebar"]
) {
  --eh-root-pl: calc(var(--wp--preset--spacing--50, 24px) * 3);
}

/* === ANIMACIONES Y MEJORAS VISUALES === */
.eh-card-media img {
  transition: transform 0.4s ease;
}

.eh-card:hover .eh-card-media img {
  transform: scale(1.05);
}

.eh-filters input,
.eh-filters select,
.eh-filters button,
.eh-filters .eh-clear {
  transition: all 0.2s ease;
}

.eh-btn,
.eh-filters button {
  position: relative;
  overflow: hidden;
}

.eh-btn:active,
.eh-filters button:active {
  transform: translateY(-1px);
}

/* Efecto de carga suave para las tarjetas */
.eh-card {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mejora visual para inputs con valor */
.eh-filters input.is-prefilled {
  background: #f1f5f9;
  border-color: var(--border-medium);
}

/* Estados deshabilitados */
.eh-btn:disabled,
.eh-filters button:disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  transform: none !important;
}