/* ==========================================================================
   Fijate Tools - Mejores Alojamientos de España (Scoring Bayesiano)
   Estilos CSS Canónicos: Paleta Midnight Slate, Modo Claro/Oscuro y Responsive
   ========================================================================== */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta Modo Oscuro (Por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-hover: #182332;
  --bg-subtle: #1a2433;
  --bg-input: #101721;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-active: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent-gold: #f59e0b;
  --accent-gold-bg: rgba(245, 158, 11, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: rgba(0, 0, 0, 0.09);
  --border-hover: rgba(0, 0, 0, 0.18);
  --border-active: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --accent-gold-bg: rgba(245, 158, 11, 0.12);
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-bg: rgba(37, 99, 235, 0.08);
  --accent-emerald-bg: rgba(16, 185, 129, 0.1);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Reset y Contención Global */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.section-title,
.algorithm-title,
.card-hotel-name,
.modal-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.mono {
  font-family: var(--font-mono);
}

/* Layout Canónico */
.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Tarjeta Principal */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .card-main {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
}

/* Hero Header */
.hero-header {
  margin-bottom: 1.75rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: 1.85rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.6rem;
}

.hero-desc {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 820px;
  margin: 0;
}

/* Cuadro de Mando del Algoritmo Bayesiano */
.algorithm-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.75rem;
}

.algorithm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.algorithm-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.algorithm-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.algorithm-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.algorithm-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  align-items: center;
}

@media (max-width: 900px) {
  .algorithm-body {
    grid-template-columns: 1fr;
  }
}

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

.formula-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  margin-bottom: 0.4rem;
}

.formula-math {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.3rem 0;
}

.math-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.1;
  padding: 0 0.15rem;
}

.math-num {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 1px;
}

.math-den {
  padding-top: 1px;
}

.formula-caption {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.control-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.control-hint {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin: 0.4rem 0 0;
  line-height: 1.4;
}

/* Panel de Filtros */
.filters-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 1.2fr;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .filters-grid {
    grid-template-columns: 1fr;
  }
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Desplegables Select con Contención Móvil Estricta */
.select-wrapper {
  position: relative;
  width: 100%;
}

.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 40px 0 0.85rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Campo de Búsqueda */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 0 32px 0 36px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-clear:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

/* Barra de Resumen de Filtros */
.filters-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.results-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.results-stats strong {
  color: var(--text-main);
}

.view-toggle-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.btn-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 32px;
}

.btn-view-toggle:hover {
  color: var(--text-main);
}

.btn-view-toggle.active {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  font-weight: 600;
}

/* Sección del Mapa Satelital Leaflet */
.map-section-wrapper {
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.map-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
}

.btn-map-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-map-action:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.leaflet-map-container {
  width: 100%;
  height: 480px;
  background: #0b0f17;
}

@media (max-width: 768px) {
  .leaflet-map-container {
    height: 340px;
  }
}

.map-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.6rem 1rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-parador { background-color: #f59e0b; }
.dot-lujo { background-color: #8b5cf6; }
.dot-boutique { background-color: #3b82f6; }
.dot-rural { background-color: #10b981; }
.dot-resort { background-color: #06b6d4; }
.dot-termas { background-color: #f43f5e; }

/* Rejilla de Alojamientos */
.accommodations-section {
  margin-bottom: 2.5rem;
}

.accommodations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .accommodations-grid {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta Individual de Alojamiento */
.hotel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.hotel-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.badge-parador { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-lujo { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-boutique { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-rural { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-resort { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-termas { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

.stars-val {
  color: var(--accent-gold);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.price-tier-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.card-hotel-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  margin: 0 0 0.35rem;
}

.card-location {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.card-scores-block {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.score-main-box {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
}

.score-main-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-emerald);
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.score-main-val {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
}

.score-max {
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.score-raw-box {
  border-left: 1px solid var(--border-color);
  padding-left: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-raw-label {
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.score-raw-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.score-reviews-val {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.card-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.highlight-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
}

.card-desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  margin-top: auto;
}

.btn-card-map {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  min-height: 40px;
}

.btn-card-map:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-card-booking {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  min-height: 40px;
}

.btn-card-booking:hover {
  background: var(--accent-blue-hover);
}

/* Estado Vacío */
.empty-state-card {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-card svg {
  margin-bottom: 0.75rem;
  color: var(--text-subtle);
}

.empty-state-card h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.empty-state-card p {
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  min-height: 40px;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: background-color var(--transition-fast);
  min-height: 40px;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

/* Sección Educativa y FAQ */
.educational-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 1.5rem;
}

.educational-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 860px) {
  .educational-grid {
    grid-template-columns: 1fr;
  }
}

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

.edu-icon {
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.edu-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.edu-card p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

/* Acordeón FAQ */
.faq-container {
  margin-top: 2rem;
}

.faq-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 1rem;
}

.faq-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.faq-answer p {
  margin: 0;
}

/* Modal Accesible de Ficha de Alojamiento */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  border-radius: 4px;
}

.btn-modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin: 0 0 0.4rem;
}

.modal-location {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.modal-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 500px) {
  .modal-scores-grid {
    grid-template-columns: 1fr;
  }
}

.modal-score-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
}

.modal-score-box.bayes-highlight {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-bg);
}

.score-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.2rem;
}

.modal-score-box.bayes-highlight .score-label {
  color: var(--accent-emerald);
}

.score-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.score-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-subheading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}

.modal-desc-box {
  margin-bottom: 1.25rem;
}

.modal-desc-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.highlights-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-footer button,
  .modal-footer a {
    width: 100%;
  }
}

/* Toast de Notificación Canónico (Cero alert) */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-active);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transition: all var(--transition-normal);
  z-index: 20000;
}

.toast-notification.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Estilos Personalizados de Popups Leaflet */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0.85rem !important;
  line-height: 1.4 !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

.popup-hotel-box {
  min-width: 220px;
}

.popup-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.2rem;
}

.popup-title {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.popup-loc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.popup-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
}

.popup-score-bayes {
  color: var(--accent-emerald);
  font-weight: 700;
}

.popup-btn {
  display: block;
  text-align: center;
  background: var(--accent-blue);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem;
  border-radius: 4px;
}
