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

  /* Paleta corporativa Midnight Slate (modo oscuro por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-hover: #172133;
  --bg-subtle: #1f2937;
  --border-card: #283548;
  --border-focus: #3b82f6;

  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #94a3b8;

  --color-green: #10b981;
  --color-green-bg: rgba(16, 185, 129, 0.12);
  --color-green-border: rgba(16, 185, 129, 0.35);

  --color-amber: #f59e0b;
  --color-amber-bg: rgba(245, 158, 11, 0.12);
  --color-amber-border: rgba(245, 158, 11, 0.35);

  --color-red: #ef4444;
  --color-red-bg: rgba(239, 68, 68, 0.12);
  --color-red-border: rgba(239, 68, 68, 0.35);

  --color-blue: #3b82f6;
  --color-blue-bg: rgba(59, 130, 246, 0.12);
  --color-blue-border: rgba(59, 130, 246, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --border-card: #e2e8f0;
  --border-focus: #2563eb;

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

  --color-green: #059669;
  --color-green-bg: #ecfdf5;
  --color-green-border: #a7f3d0;

  --color-amber: #d97706;
  --color-amber-bg: #fffbeb;
  --color-amber-border: #fde68a;

  --color-red: #dc2626;
  --color-red-bg: #fef2f2;
  --color-red-border: #fecaca;

  --color-blue: #2563eb;
  --color-blue-bg: #eff6ff;
  --color-blue-border: #bfdbfe;

  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.06);
}

/* Reset canónico y contención de viewport */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Tipografías canónicas */
h1, h2, h3, h4, h5, h6,
.brand-title,
.module-title,
.section-title,
.faq-section-title,
.timeline-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.text-mono,
.kpi-value,
.code-inline,
.legal-doc-content {
  font-family: var(--font-mono);
}

/* Layout institucional */
.main-wrapper.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: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

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

/* Tarjeta principal contenedora */
.card-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .card-main {
    padding: 1rem;
  }
}

/* Barra de pestañas de navegación táctil */
.camper-nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background-color: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .camper-nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  min-height: 42px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

[data-theme="light"] .tab-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--color-blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Contenido de pestañas */
.camper-tab-content {
  display: none;
}

.camper-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Encabezados de módulo */
.module-intro {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1rem;
}

.module-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.module-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Formularios y controles responsivos canónicos */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: var(--color-blue);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Desplegables <select> con protección canónica contra ensanchamiento */
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 0 40px 0 0.85rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease;
  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='%239ca3af' 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;
  appearance: none;
  -webkit-appearance: none;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

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

.comunidad-filter-box {
  background-color: var(--bg-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px dashed var(--border-card);
}

/* Botones de acción */
.btn-evaluar-wrapper,
.btn-calc-route-wrapper {
  margin-bottom: 1.5rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

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

/* Dictamen del Semáforo Legal */
.semaforo-resultado-card {
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.semaforo-resultado-card.state-green {
  background-color: var(--color-green-bg);
  border-color: var(--color-green-border);
}

.semaforo-resultado-card.state-amber {
  background-color: var(--color-amber-bg);
  border-color: var(--color-amber-border);
}

.semaforo-resultado-card.state-red {
  background-color: var(--color-red-bg);
  border-color: var(--color-red-border);
}

.semaforo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.semaforo-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
}

.state-green .semaforo-badge-status {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--color-green);
}

.state-amber .semaforo-badge-status {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--color-amber);
}

.state-red .semaforo-badge-status {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--color-red);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  animation: pulseDot 2s infinite;
}

.state-green .status-dot { background-color: var(--color-green); }
.state-amber .status-dot { background-color: var(--color-amber); }
.state-red .status-dot { background-color: var(--color-red); }

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.semaforo-dgt-ref {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.semaforo-veredicto-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.semaforo-veredicto-desc {
  font-size: 0.98rem;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.semaforo-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

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

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

.detail-box-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.detail-box-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.semaforo-actions-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .semaforo-actions-bar button {
    width: 100%;
  }
}

/* =================================================== */
/* PESTAÑA 2: ESTILOS DEL MAPA INTERACTIVO Y SERVICIOS  */
/* =================================================== */
.map-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.map-search-row {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .map-search-row {
    flex-direction: column;
  }
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
}

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

.search-input {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 36px 0 38px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

/* Desplegable de autocompletado en vivo para el buscador del mapa */
.map-search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  max-height: 340px;
  overflow-y: auto;
  z-index: 1050;
  padding: 0.25rem 0;
}

.search-dropdown-count {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-card);
  font-weight: 500;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-card);
  transition: background-color 0.15s ease;
  min-height: 48px;
  text-decoration: none;
  color: inherit;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background-color: var(--bg-card-hover);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 auto;
}

.suggestion-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.suggestion-type-badge {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  line-height: 1.2;
}

.badge-tipo-gratis {
  background: var(--color-green-bg);
  color: var(--color-green);
  border: 1px solid var(--color-green-border);
}

.badge-tipo-pago {
  background: var(--color-blue-bg);
  color: var(--color-blue);
  border: 1px solid var(--color-blue-border);
}

.badge-tipo-privada {
  background: var(--color-amber-bg);
  color: var(--color-amber);
  border: 1px solid var(--color-amber-border);
}

.badge-tipo-camping {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.suggestion-price {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  margin-left: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-dropdown-empty {
  padding: 1.25rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1.4;
}

.search-dropdown-empty svg {
  color: var(--text-secondary);
}

.btn-geolocate {
  white-space: nowrap;
}

.map-filters-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.chip-filter {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chip-filter:hover {
  color: var(--text-main);
  border-color: var(--color-blue);
}

.chip-filter.active {
  background-color: var(--color-blue-bg);
  border-color: var(--color-blue);
  color: var(--color-blue);
  font-weight: 700;
}

/* Contenedor Leaflet y mapa */
.map-viewport-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
  margin-bottom: 1.25rem;
}

.camper-leaflet-container {
  background-color: #0b0f17;
}

.map-floating-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background-color: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: #f3f4f6;
  z-index: 1000;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .map-floating-legend {
    display: none;
  }
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.dot-gratis { background-color: #10b981; }
.dot-pago { background-color: #3b82f6; }
.dot-privada { background-color: #f59e0b; }
.dot-camping { background-color: #8b5cf6; }

/* Tarjeta informativa de área seleccionada */
.selected-area-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  animation: fadeIn 0.2s ease-out;
}

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

.area-type-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.25rem;
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
  border: 1px solid var(--color-blue-border);
}

.area-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.area-card-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.area-price-tag {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-green);
  background-color: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.area-card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.area-services-list {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
}

.service-badge.avail {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--color-green);
}

.area-card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .area-card-actions a,
  .area-card-actions button {
    width: 100%;
  }
}

/* =================================================== */
/* PESTAÑA 3: PLANIFICADOR DE RUTA Y PARADAS CAMPER    */
/* =================================================== */
.route-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

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

.route-pin-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.pin-origin { background-color: #10b981; }
.pin-dest { background-color: #ef4444; }

.route-summary-panel {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-card);
  padding-top: 1.5rem;
}

.route-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

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

.route-kpi-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.route-stops-timeline {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.timeline-steps-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
}

.timeline-step-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  position: relative;
}

.timeline-step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--color-blue);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-step-marker.step-origin { background-color: var(--color-green); }
.timeline-step-marker.step-dest { background-color: var(--color-red); }
.timeline-step-marker.step-recommended { background-color: var(--color-amber); }

.timeline-step-body {
  flex: 1 1 0%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.timeline-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.timeline-step-km {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-blue);
  font-weight: 600;
}

.timeline-step-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.route-export-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .route-export-actions button {
    width: 100%;
  }
}

/* =================================================== */
/* PESTAÑA 4: GUÍA NORMATIVA Y TABLA DE CONCEPTOS      */
/* =================================================== */
.section-subtitle {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.table-responsive-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
}

.camper-legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.camper-legal-table th,
.camper-legal-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-card);
}

.camper-legal-table th {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.camper-legal-table tr:last-child td {
  border-bottom: none;
}

.tag-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.tag-status.status-park { background-color: var(--color-blue-bg); color: var(--color-blue); }
.tag-status.status-sleep { background-color: var(--color-green-bg); color: var(--color-green); }
.tag-status.status-camp { background-color: var(--color-red-bg); color: var(--color-red); }

.badge-legal {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-legal.legal-yes { background-color: rgba(16, 185, 129, 0.2); color: var(--color-green); }
.badge-legal.legal-no { background-color: rgba(239, 68, 68, 0.2); color: var(--color-red); }

/* Acordeones FAQ y CCAA */
.faq-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.camper-faq-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.camper-faq-card:hover {
  border-color: var(--border-focus);
}

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

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

.faq-question::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 400;
  transition: transform 0.2s ease;
}

.camper-faq-card[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 1.1rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-answer p:not(:last-child) {
  margin-bottom: 0.5rem;
}

/* Caja de alegación oficial descargable */
.legal-doc-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.legal-doc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-blue);
}

.legal-doc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.legal-doc-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.legal-doc-content {
  background-color: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1rem;
  user-select: all;
}

.legal-doc-actions {
  display: flex;
}

@media (max-width: 640px) {
  .legal-doc-actions button {
    width: 100%;
  }
}

/* =================================================== */
/* SECCIÓN SEO INFORMATIVA Y GUÍAS DE VIAJE            */
/* =================================================== */
.seo-guide-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

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

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

@media (max-width: 800px) {
  .guide-cards-grid {
    grid-template-columns: 1fr;
  }
}

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

.guide-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.guide-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.guide-card-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Modal amigable corporativo (reemplazo de alert()) */
.camper-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.camper-modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease-out;
}

.camper-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.camper-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.camper-modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.camper-modal-footer {
  display: flex;
  justify-content: flex-end;
}

/* Personalización de Popups Leaflet para respetar el tema corporativo */
.leaflet-popup-content-wrapper {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
  padding: 0.25rem !important;
}

.leaflet-popup-tip {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-card) !important;
}

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

.camper-popup-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.camper-popup-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-right: 15px;
}

.camper-popup-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-blue);
}

.camper-popup-price {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-green);
}

.camper-popup-btn {
  margin-top: 0.45rem;
  display: inline-block;
  padding: 0.35rem 0.65rem;
  background-color: var(--color-blue);
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
