/* ==========================================================================
   Monitor de embalses y reservas de agua de España
   Fijate Tools • Suite Canónica de Herramientas Web
   ========================================================================== */

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

  /* Tema Oscuro (Predeterminado) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #182234;
  --bg-card-hover: #1f2c42;
  --border-color: #243046;
  --border-light: #2d3c58;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --water-primary: #0ea5e9;
  --water-hover: #0284c7;
  --water-light: rgba(14, 165, 233, 0.15);
  --water-glow: rgba(14, 165, 233, 0.25);

  /* Semáforo de sequía */
  --status-normal: #10b981;
  --status-normal-bg: rgba(16, 185, 129, 0.14);
  --status-prealerta: #eab308;
  --status-prealerta-bg: rgba(234, 179, 8, 0.14);
  --status-alerta: #f97316;
  --status-alerta-bg: rgba(249, 115, 22, 0.14);
  --status-emergencia: #ef4444;
  --status-emergencia-bg: rgba(239, 68, 68, 0.16);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

[data-theme="light"],
body.light-theme {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #e2e8f0;
  --border-light: #cbd5e1;

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

  --water-primary: #0284c7;
  --water-hover: #0369a1;
  --water-light: rgba(2, 132, 199, 0.1);
  --water-glow: rgba(2, 132, 199, 0.2);

  --status-normal: #059669;
  --status-normal-bg: #ecfdf5;
  --status-prealerta: #d97706;
  --status-prealerta-bg: #fffbeb;
  --status-alerta: #ea580c;
  --status-alerta-bg: #fff7ed;
  --status-emergencia: #dc2626;
  --status-emergencia-bg: #fef2f2;

  --shadow-card: 0 4px 18px -2px rgba(15, 23, 42, 0.08);
}

/* Reset y caja base */
*, *::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;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.hero-title,
.faq-section-title {
  font-family: var(--font-heading);
}

.mono,
.kpi-num,
.stat-val,
.code-num {
  font-family: var(--font-mono);
}

/* Enlaces y botones base */
a {
  color: var(--water-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  text-decoration: underline;
}

/* Layout del contenedor */
.tool-layout {
  max-width: 1240px;
  width: 100%;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1rem;
}

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

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Banner superior publicitario */
.tools-ad-banner-section {
  width: 100%;
}
.ad-banner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.ad-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ad-banner-card {
  width: 100%;
  min-height: 90px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Barra lateral publicidad desktop */
.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
}
.ad-sticky-box {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.ad-unit-card {
  width: 300px;
  height: 600px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ==========================================================================
   Componentes Principales de la Herramienta
   ========================================================================== */

/* Tarjetas base */
.card-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

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

/* Cabecera del Hero */
.hero-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.hero-text {
  flex: 1 1 280px;
}
.hero-title {
  margin: 0 0 0.4rem 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}
.hero-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-action:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--water-primary);
  text-decoration: none;
}
.btn-action-primary {
  background-color: var(--water-primary);
  border-color: var(--water-primary);
  color: #ffffff;
}
.btn-action-primary:hover {
  background-color: var(--water-hover);
  color: #ffffff;
}

/* ==========================================================================
   Semáforo Nacional y Dashboard Hídrico
   ========================================================================== */
.national-dashboard {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .national-dashboard {
    grid-template-columns: 1fr;
  }
}

.gauge-panel {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(15, 23, 42, 0) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gauge-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.gauge-meta-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  font-weight: 600;
}
.gauge-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-status-normal {
  background-color: var(--status-normal-bg);
  color: var(--status-normal);
  border: 1px solid var(--status-normal);
}
.badge-status-prealerta {
  background-color: var(--status-prealerta-bg);
  color: var(--status-prealerta);
  border: 1px solid var(--status-prealerta);
}
.badge-status-alerta {
  background-color: var(--status-alerta-bg);
  color: var(--status-alerta);
  border: 1px solid var(--status-alerta);
}
.badge-status-emergencia {
  background-color: var(--status-emergencia-bg);
  color: var(--status-emergencia);
  border: 1px solid var(--status-emergencia);
}

.gauge-numbers {
  margin: 1rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.gauge-main-pct {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}
.gauge-sub-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.gauge-vol-ratio {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.gauge-variacion {
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.val-up {
  color: var(--status-normal);
}
.val-down {
  color: var(--status-emergencia);
}
.val-neutral {
  color: var(--text-muted);
}

/* Barra de progreso de llenado segmentada */
.water-progress-track {
  width: 100%;
  height: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  margin: 0.85rem 0 0.5rem;
}
.water-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
}
.water-progress-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-faint);
  padding: 0 0.2rem;
}

/* Tarjetas de comparativas históricas */
.historical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 540px) {
  .historical-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}
.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.kpi-main-val {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.kpi-diff-pill {
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.kpi-foot-note {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ==========================================================================
   Mapa y Filtros Cartográficos
   ========================================================================== */
.map-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.map-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 360px;
}

.filter-input-wrap {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
}

.search-icon-svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-faint);
}

.input-search-reservoirs {
  width: 100%;
  min-height: 40px;
  padding: 0.45rem 0.85rem 0.45rem 2.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.input-search-reservoirs:focus {
  border-color: var(--water-primary);
}

.select-filter {
  min-height: 40px;
  padding: 0.45rem 2.5rem 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  appearance: none;
  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;
}
.select-filter option {
  background-color: var(--bg-card);
  color: var(--text-main);
}
.select-filter:focus {
  border-color: var(--water-primary);
}

.map-layer-toggles {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.map-container-wrap {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#reservoirs-leaflet-map {
  width: 100%;
  height: 100%;
  background-color: #1a2234;
}

/* Leyenda del mapa */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot-normal { background-color: var(--status-normal); box-shadow: 0 0 6px var(--status-normal); }
.legend-dot-prealerta { background-color: var(--status-prealerta); box-shadow: 0 0 6px var(--status-prealerta); }
.legend-dot-alerta { background-color: var(--status-alerta); box-shadow: 0 0 6px var(--status-alerta); }
.legend-dot-emergencia { background-color: var(--status-emergencia); box-shadow: 0 0 6px var(--status-emergencia); }

/* Custom Popup de Leaflet */
.leaflet-popup-content-wrapper {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
  padding: 0.25rem !important;
}
.leaflet-popup-tip {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-light);
}
.reservoir-popup {
  padding: 0.5rem;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.popup-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}
.popup-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
.popup-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0.3rem 0;
  padding: 0.35rem 0.5rem;
  background-color: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
}
.popup-pct {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--water-primary);
}
.popup-btn-detail {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--water-primary);
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-top: 0.25rem;
  cursor: pointer;
  display: block;
}

/* ==========================================================================
   Cuencas Hidrográficas (Silo Hídrico)
   ========================================================================== */
.basins-section {
  margin-bottom: 2rem;
}
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.basins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.9rem;
}

.basin-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}
.basin-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--water-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.basin-card.active-basin {
  border-color: var(--water-primary);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, var(--bg-card-subtle) 100%);
}

.basin-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.basin-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}
.basin-badge-pct {
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}
.basin-bar-wrap {
  width: 100%;
  height: 8px;
  background-color: var(--bg-card);
  border-radius: 9999px;
  overflow: hidden;
}
.basin-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}
.basin-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Rankings Hídricos y Listados
   ========================================================================== */
.rankings-section {
  margin-bottom: 2rem;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.tab-btn {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background-color: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-card-subtle);
}
.tab-btn.active-tab {
  background-color: var(--water-light);
  color: var(--water-primary);
  border-color: var(--water-primary);
}

.ranking-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-card-subtle);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}
.ranking-table th {
  padding: 0.85rem 1rem;
  background-color: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.ranking-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}
.ranking-table tr:last-child td {
  border-bottom: none;
}
.ranking-table tr:hover td {
  background-color: var(--bg-card-hover);
}

.ranking-rank {
  font-weight: 800;
  color: var(--text-faint);
  width: 40px;
  text-align: center;
}
.reservoir-name-cell {
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}
.reservoir-name-cell:hover {
  color: var(--water-primary);
}
.reservoir-sub-cell {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.sparkline-svg-wrap svg {
  display: block;
  max-width: 100px;
  height: 24px;
}

/* ==========================================================================
   Buscador Global de Embalses
   ========================================================================== */
.directory-section {
  margin-bottom: 2rem;
}
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modal Canónico de Embalse
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.modal-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}
.modal-subtitle {
  margin: 0.2rem 0 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn-modal-close {
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-modal-close:hover {
  background-color: var(--status-emergencia-bg);
  border-color: var(--status-emergencia);
  color: var(--status-emergencia);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
@media (max-width: 480px) {
  .modal-stat-grid {
    grid-template-columns: 1fr;
  }
}

.modal-kpi {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}
.modal-kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
}
.modal-kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Sección FAQ y Contenido Educativo SEO
   ========================================================================== */
.faq-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.faq-card {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.faq-question {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.faq-answer {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Hoja Oficial de Impresión A4 (.print-sheet)
   ========================================================================== */
.print-sheet {
  display: none;
}

@media print {
  /* Ocultar elementos web no deseados */
  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .fijate-footer,
  .hero-actions,
  .map-toolbar,
  .ranking-tabs,
  .faq-section,
  .card-main,
  #btn-theme-toggle {
    display: none !important;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .print-sheet {
    display: block !important;
    max-width: 210mm;
    margin: 0 auto;
    padding: 15mm;
  }

  .print-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .print-title {
    font-size: 18pt;
    font-weight: 800;
    margin: 0;
  }
  .print-date {
    font-size: 10pt;
    color: #444444;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 9.5pt;
  }
  .print-table th, .print-table td {
    border: 1px solid #cccccc;
    padding: 6px 8px;
    text-align: left;
  }
  .print-table th {
    background-color: #f2f2f2;
    font-weight: bold;
  }

  .print-signatures {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
  }
  .print-signature-box {
    width: 45%;
    border-top: 1px solid #000000;
    padding-top: 5px;
    text-align: center;
    font-size: 9pt;
  }
}
