/* ============================================
   VARIABLES
   ============================================ */
:root {
  --bg:        #080e1a;
  --bg-card:   #0d1626;
  --bg-input:  #0a1220;
  --border:    #1a2744;
  --text:      #e2e8f0;
  --text-muted:#7a90b0;
  --accent:    #3b82f6;
  --accent2:   #6366f1;
  --success:   #10b981;
  --danger:    #ef4444;
  --radius:    0.75rem;
  --radius-sm: 0.4rem;
}

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

html, body {
  height: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   HEADER
   ============================================ */
header {
  background: #04080f;
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.ts-actualizacion {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

/* ============================================
   FILTROS
   ============================================ */
.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #04080f;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.filtros input,
.filtros select {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.filtros input:focus,
.filtros select:focus {
  border-color: var(--accent);
}

#busquedaTitulo { min-width: 220px; flex: 1; }
.filtros select  { min-width: 150px; }

.filtros button {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s, border-color 0.2s;
}
.filtros button:hover { color: var(--text); border-color: var(--text-muted); }

.contador {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - 130px);
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; height: auto; }
}

/* ============================================
   RESULTADOS (columna izquierda)
   ============================================ */
.resultados {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: max-content;
  gap: 0.85rem;
  align-content: start;
  padding-right: 0.25rem;
}

.resultados::-webkit-scrollbar { width: 6px; }
.resultados::-webkit-scrollbar-thumb { background: #1e2d45; border-radius: 3px; }

/* ============================================
   TARJETAS
   ============================================ */
.tarjeta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.tarjeta:hover {
  border-color: #2a3f6f;
  transform: translateY(-2px);
}

.tarjeta__poster {
  position: relative;
  width: 100%;
  padding-top: 56%; /* 16:9 — funciona bien con imágenes horizontales y verticales */
  overflow: hidden;
  background: #070d1a;
}

.tarjeta__poster img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.3s ease;
}

.tarjeta:hover .tarjeta__poster img {
  transform: scale(1.03);
}

.tarjeta__body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.tarjeta__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.badge-version {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid;
  letter-spacing: 0.04em;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-cadena {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.tarjeta h2 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.tarjeta__cine,
.tarjeta__fecha {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.tarjeta__horarios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.badge-hora {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}
.badge-hora.sin-hora {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border);
}

.tarjeta__link {
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

/* ============================================
   ESTADOS UI (loading / error / vacío)
   ============================================ */
.estado-ui {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
  text-align: center;
}

.estado-icon { font-size: 2.5rem; }

.estado-ui.loading p,
.estado-ui.error p,
.estado-ui.vacio p {
  font-size: 1rem;
  color: var(--text-muted);
}

.estado-ui button {
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.estado-ui button:hover { border-color: var(--accent); color: var(--accent); }

/* Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   SIDEBAR (columna derecha)
   ============================================ */
.sidebar {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.25rem;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #1e2d45; border-radius: 3px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text);
}

.card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.card h4 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* ============================================
   MAPA
   ============================================ */
.map-container {
  width: 100%;
  height: 240px;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.leaflet-popup-content-wrapper {
  background: #0d1626;
  color: var(--text);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.leaflet-popup-tip { background: #0d1626; }
.leaflet-popup-content a { color: var(--accent); }

/* ============================================
   FLATPICKR (inline)
   ============================================ */
/* flatpickr input gestionado por JS */


.flatpickr-months,
.flatpickr-weekdays { background: transparent; color: var(--text-muted); }
.flatpickr-weekday  { color: var(--text-muted); }
.flatpickr-day { background: transparent; color: var(--text); border-radius: 4px; }
.flatpickr-day:hover { background: rgba(255,255,255,0.05); }
.flatpickr-day.today { background: rgba(59,130,246,0.1); box-shadow: none; }
.flatpickr-day.selected,
.flatpickr-day.selected:focus {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* ============================================
   SLIDER DE HORAS
   ============================================ */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.slider-group { display: flex; flex-direction: column; gap: 0.5rem; }

.range-horas { margin: 0.4rem 0; }

.noUi-target {
  background: #0a1220;
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 8px;
  box-shadow: none;
}
.noUi-connect { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.noUi-handle {
  width: 16px; height: 16px;
  border-radius: 50%;
  top: -4px;
  background: #e2e8f0;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.noUi-handle::before,
.noUi-handle::after { display: none; }

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================
   BOTONES SIDEBAR
   ============================================ */
.secundario {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: color 0.2s, border-color 0.2s;
}
.secundario:hover { color: var(--text); border-color: var(--text-muted); }

/* ============================================
   INFO CARD
   ============================================ */
.card.info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.card.info p + p { margin-top: 0.5rem; }

.btn-ver-mas {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.btn-ver-mas button {
  padding: 0.6rem 2rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.btn-ver-mas button:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   SESIONES ESPECIALES
   ============================================ */
.especiales-seccion {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

.especiales-header {
  margin-bottom: 1rem;
}
.especiales-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.especiales-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.especiales-lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.especial-card {
  display: flex;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.especial-card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
}

.especial-card img {
  width: 56px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.especial-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.especial-info strong {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.especial-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.especial-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid;
  width: fit-content;
}

/* ============================================
   LANDING
   ============================================ */
#vistaLanding {
  min-height: 100vh;
  background: var(--bg);
}

.landing-header {
  background: #04080f;
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-header-inner {
  max-width: 1200px;
  margin: 0 auto 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-search {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.landing-search input {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.landing-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.landing-sugerencias {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #0d1626;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 200;
}

.landing-sug-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.landing-sug-item:hover { background: rgba(59,130,246,0.1); }
.landing-sug-item img {
  width: 32px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.landing-poster {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.2s, border-color 0.2s;
  padding-top: 150%;
}
.landing-poster:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.landing-poster img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.landing-poster-titulo {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 0.6rem 0.6rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.btn-volver {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.btn-volver:hover { color: var(--text); border-color: var(--text-muted); }

/* ============================================
   PUNTO MEDIO
   ============================================ */
.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pm-persona {
  margin-bottom: 0.85rem;
}
.pm-persona label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.pm-input-row {
  display: flex;
  gap: 0.4rem;
}
.pm-input-row input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}
.pm-input-row input:focus { border-color: var(--accent); }

.pm-pin-btn {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.pm-pin-btn:hover, .pm-pin-btn.activo {
  border-color: var(--accent2);
  color: var(--accent2);
  background: rgba(99,102,241,0.1);
}

.pm-sugerencias {
  position: relative;
  z-index: 200;
}
.pm-sug-item {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text);
  background: #0d1626;
  border: 1px solid var(--border);
  border-top: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-sug-item:hover { background: rgba(59,130,246,0.1); }

.pm-coords {
  font-size: 0.75rem;
  color: var(--success);
  display: block;
  margin-top: 0.2rem;
  min-height: 1rem;
}

.pm-buscar {
  width: 100%;
  padding: 0.55rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent2);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: opacity 0.2s;
}
.pm-buscar:disabled { opacity: 0.4; cursor: not-allowed; }
.pm-buscar:not(:disabled):hover { opacity: 0.85; }

.pm-titulo-res {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.85rem 0 0.4rem;
}

.pm-cine-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.85rem;
}
.pm-cine-item:hover { border-color: var(--accent); background: rgba(59,130,246,0.05); }
.pm-cine-item.pm-cine-top { border-color: #6366f1; background: rgba(99,102,241,0.08); }

.pm-cine-item > div { flex: 1; min-width: 0; }
.pm-cine-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-cine-item small { color: var(--text-muted); font-size: 0.75rem; }

.pm-rank { font-size: 1rem; flex-shrink: 0; }
.pm-dist { font-size: 0.78rem; color: var(--accent); font-weight: 600; flex-shrink: 0; }

/* Marcadores punto medio en el mapa */
.pm-marker {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border: 2px solid #fff;
}
.pm-marker-a   { background: #3b82f6; color: #fff; }
.pm-marker-b   { background: #10b981; color: #fff; }
.pm-marker-mid { background: #6366f1; color: #fff; }

/* ============================================
   FOOTER
   ============================================ */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .layout { padding: 0.75rem; }
  .sidebar { height: auto; }
  .map-container { height: 200px; }
}

@media (max-width: 600px) {
  .filtros { padding: 0.6rem; }
  #busquedaTitulo { min-width: 100%; }
  .resultados { grid-template-columns: 1fr; }
}

/* ============================================
   BOTÓN TOGGLE SIDEBAR MÓVIL
   ============================================ */
.btn-toggle-sidebar {
  display: none; /* oculto en desktop */
}

@media (max-width: 900px) {
  .btn-toggle-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    margin-top: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s;
  }
  .btn-toggle-sidebar:hover,
  .btn-toggle-sidebar[aria-expanded="true"] {
    color: var(--text);
    border-color: var(--accent);
  }
  .btn-toggle-sidebar[aria-expanded="true"]::before {
    content: '🗺️ Ocultar mapa';
  }
  .btn-toggle-sidebar[aria-expanded="true"] {
    /* ocultar texto original via color trick no es posible, lo hacemos en JS */
  }

  /* Sidebar oculto por defecto en móvil */
  .sidebar {
    display: none;
  }
  .sidebar.visible {
    display: flex;
  }

  /* Filtros móvil: layout en grid */
  .filtros {
    padding: 0.5rem 0.6rem;
    gap: 0.4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "busqueda busqueda"
      "cadena   cine"
      "chips    chips"
      "hora     hora"
      "contador limpiar";
  }
  #busquedaTitulo     { grid-area: busqueda; min-width: 0; width: 100%; }
  #filtroCadena       { grid-area: cadena;   min-width: 0; width: 100%; font-size: 0.85rem; }
  #filtroCine         { grid-area: cine;     min-width: 0; width: 100%; font-size: 0.85rem; }
  .fecha-chips-wrap   { grid-area: chips; }
  .hora-panel-wrap    { grid-area: hora; }
  #contadorResultados { grid-area: contador; display: flex; align-items: center; font-size: 0.78rem; }
  #btnLimpiar         { grid-area: limpiar; width: 100%; }
}


html, body { overflow-x: hidden; }
.landing-fechas { display: none !important; }
.filtro-fecha-wrap { position: relative; flex-shrink: 0; }


.btn-fecha-desplegable {
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: border-color 0.2s;
}
.btn-fecha-desplegable:hover { border-color: var(--accent); }

/* Panel desplegable escritorio */
.fecha-desplegable {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 9999;
  background: #0d1b2a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  width: 300px;
  max-width: calc(100vw - 2rem);
}

/* El input visible para flatpickr */
#selectorFecha {
  width: 100%;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Calendario dentro del panel */
.fecha-desplegable .flatpickr-calendar {
  position: static !important;
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
  width: 100% !important;
}
.fecha-desplegable .flatpickr-months { background: transparent; }
.fecha-desplegable .flatpickr-day { color: var(--text); }
.fecha-desplegable .flatpickr-day.selected { background: var(--accent); color: #fff; }
.fecha-desplegable .flatpickr-day.today { border-color: var(--accent); }

.hora-panel {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

/* Móvil: panel desde abajo con overlay */
@media (max-width: 768px) {
  .fecha-desplegable {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem !important;
    z-index: 10000 !important;
  }
  /* Overlay oscuro detrás del panel */
  .fecha-desplegable::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
    pointer-events: none;
  }
}

/* Landing grid móvil 2 columnas */
@media (max-width: 600px) {
  .landing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.75rem;
  }
}

.fecha-desplegable-titulo {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}


/* ============================================
   CHIPS DE FECHA
   ============================================ */
.fecha-chips-wrap {
  grid-column: 1 / -1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -0.6rem;
  padding: 0 0.6rem;
}
.fecha-chips-wrap::-webkit-scrollbar { display: none; }

.fecha-chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.25rem 0;
  width: max-content;
}

.chip-fecha {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  white-space: nowrap;
  transition: all 0.15s;
  min-width: 52px;
}
.chip-fecha:hover {
  border-color: var(--accent);
  color: var(--text);
}
.chip-fecha.activa {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip-fecha.futura {
  border-color: rgba(99,102,241,0.4);
  color: #a5b4fc;
}
.chip-fecha.futura.activa {
  background: var(--accent2);
  border-color: var(--accent2);
}
.chip-dia-nombre {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: capitalize;
}
.chip-dia-num {
  font-size: 0.7rem;
  opacity: 0.85;
}

/* ============================================
   PANEL HORA COLAPSABLE
   ============================================ */
.hora-panel-wrap {
  grid-column: 1 / -1;
  position: relative;
}
.btn-hora-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s;
}
.btn-hora-toggle:hover { border-color: var(--accent); color: var(--text); }

.hora-panel-desplegable {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}


/* ============================================
   PRÓXIMOS ESTRENOS
   ============================================ */
.estrenos-lista {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1rem 0.5rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.estreno-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.estreno-card:hover {
  border-color: var(--accent2);
  transform: translateY(-1px);
}
.estreno-card img {
  width: 52px;
  height: 76px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.estreno-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.estreno-info strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.estreno-fecha {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.estreno-cines {
  font-size: 0.78rem;
  color: var(--text-muted);
}

