@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --panel-bg: rgba(15, 12, 41, 0.88);
  --card-border: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --transition: 0.25s ease;
  --panel-width: 400px;
}

/* Material Symbols Base */
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  width: 1em;
  height: 1em;
}

/* â”€â”€ Layout full-screen â”€â”€ */
html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* â”€â”€ Panel flotante â”€â”€ */
#panel {
  position: fixed;
  top: 16px;
  bottom: 16px;
  left: 16px;
  width: var(--panel-width);
  overflow-y: auto;
  z-index: 1000;
  background: var(--panel-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Scrollbar del panel */
#panel::-webkit-scrollbar {
  width: 4px;
}

#panel::-webkit-scrollbar-track {
  background: transparent;
}

#panel::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* â”€â”€ Header â”€â”€ */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.2rem;
}

.header-main {
  flex: 1;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(90deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.config-trigger {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  flex-shrink: 0;
  margin-left: 10px;
}

.config-trigger:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-light);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.config-trigger__icon {
  font-size: 1.2rem;
  line-height: 1;
}

.stop-nav-trigger {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  flex-shrink: 0;
  margin-left: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.stop-nav-trigger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #f87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.stop-nav-trigger span {
  font-size: 1.25rem;
  line-height: 1;
}

/* â”€â”€ Formulario â”€â”€ */
#route-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 5px;
}

label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

/* â”€â”€ Inputs â”€â”€ */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

input[type="text"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input[type="text"]::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input[type="text"]:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.input-with-button {
  display: flex !important;
}

.input-with-button input {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: none !important;
}

.icon-btn {
  width: auto;
  padding: 0 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-left: none;
  border-radius: 8px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.icon-btn:hover {
  background: rgba(167, 139, 250, 0.1);
  color: var(--accent-light);
  transform: none;
  box-shadow: none;
}

.icon-btn--active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.3) !important;
}

.icon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(1);
}

#my-location-btn {
  border-radius: 50px;
  padding: 7px;
  margin-left: 10px;
  border-left: 1px solid var(--card-border);
}

/* â”€â”€ Dropdown autocompletado â”€â”€ */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e1b3a;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
}

.autocomplete-list.open {
  display: block;
  animation: fadeIn 0.15s ease;
}

.autocomplete-list li {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.4;
  transition: background var(--transition);
}

.autocomplete-list li:last-child {
  border-bottom: none;
}

.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

.autocomplete-list li .place-type {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.autocomplete-list::-webkit-scrollbar {
  width: 4px;
}

.autocomplete-list::-webkit-scrollbar-track {
  background: transparent;
}

.autocomplete-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* â”€â”€ Botones â”€â”€ */
button {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

#calculate-btn {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  margin-top: 10px;
}

#calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

#calculate-btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

#calculate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* â”€â”€ BotÃ³n inline entre paradas â”€â”€ */
.add-stop-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.15rem 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition), color var(--transition);
  margin: 5px 0 0 0;
  letter-spacing: 0.02em;
}

.add-stop-btn::before,
.add-stop-btn::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  transition: background var(--transition);
}

.add-stop-btn:hover {
  opacity: 1;
  color: var(--accent-light);
  transform: none;
  box-shadow: none;
}

.add-stop-btn:hover::before,
.add-stop-btn:hover::after {
  background: rgba(167, 139, 250, 0.35);
}

/* â”€â”€ Waypoints intermedios â”€â”€ */
#stops-middle {
  display: flex;
  flex-direction: column;
}

.waypoint-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 5px 0;
}

.waypoint-item .wp-inputs {
  flex: 1;
  min-width: 0;
}

.waypoint-item .wp-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.waypoint-item .wp-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  margin-top: 16px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #f87171;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.waypoint-item .wp-remove:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: #f87171;
  transform: none;
  box-shadow: none;
}

/* â”€â”€ Resultado / Tarjetas de ruta â”€â”€ */
#result-section {
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
  animation: fadeIn 0.3s ease;
}

#result-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}

.result-error {
  color: #f87171;
}

/* Header origen â†’ destino */
.routes-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  line-height: 1.4;
  display: none;
}

.routes-arrow {
  font-size: 0.75rem;
  opacity: 0.5;
  padding-left: 2px;
}

/* Lista de tarjetas */
.routes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Tarjeta individual */
.route-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  position: relative;
}

.route-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.route-card--active {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--route-color, var(--accent-light));
  box-shadow: 0 0 0 1px var(--route-color, var(--accent-light));
}

/* Badge de nÃºmero con color de ruta */
.route-card__badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f0c29;
}

.route-card__info {
  flex: 1;
  min-width: 0;
}

.route-card__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.route-card__stats {
  display: flex;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.route-card__error {
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: rgba(248, 113, 113, 0.08);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.72rem;
  line-height: 1.4;
  font-weight: 500;
  border: 1px solid rgba(248, 113, 113, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.route-card__check {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--route-color, var(--accent-light));
  flex-shrink: 0;
}

/* â”€â”€ Fuel Configuration â”€â”€ */
#fuel-section {
  margin-top: 8px;
  margin-bottom: 4px;
}

/* Toggle button */
.fuel-toggle-btn {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.fuel-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.fuel-toggle-btn[aria-expanded="true"] {
  border-color: var(--accent-light);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: rgba(255, 255, 255, 0.06);
}

.fuel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.fuel-header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.fuel-range-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(167, 139, 250, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* Primera línea: título + chevron */
.fuel-toggle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fuel-toggle-label {
  font-weight: 600;
  font-size: 0.85rem;
}

.fuel-toggle-chevron {
  font-size: 1.2rem;
  color: var(--muted);
  transition: transform 0.25s ease;
}

.fuel-toggle-btn[aria-expanded="true"] .fuel-toggle-chevron {
  transform: rotate(-180deg);
}

/* Segunda lÃ­nea: resumen (solo visible cuando estÃ¡ cerrado) */
.fuel-summary {
  font-size: 0.74rem;
  color: var(--muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-height: 1.2em;
  opacity: 1;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}

.fuel-toggle-btn[aria-expanded="true"] .fuel-summary {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Collapsible body */
.fuel-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, padding 0.3s ease;
  border: 1px solid transparent;
  border-top: none;
  border-radius: 0 0 8px 8px;
}

.fuel-body.open {
  max-height: 400px;
  border-color: rgba(167, 139, 250, 0.4);
  padding: 0.75rem;
}

.fuel-config {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fuel-type-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fuel-select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.fuel-select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.fuel-select option {
  background: var(--panel-bg);
  color: var(--text);
}

.fuel-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Fila label + campo */
.fuel-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fuel-input-label {
  /* flex: 0 0 60px; */
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
}

/* Contenedor del campo: Ã­cono | input | badge */
.fuel-input-field {
  flex: 1;
  display: flex;
  align-items: stretch;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.fuel-input-field:focus-within {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.fuel-input-icon {
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid var(--card-border);
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
}

.fuel-input-field input[type="number"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0.55rem 0.5rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.fuel-input-field input[type="number"]::-webkit-inner-spin-button,
.fuel-input-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fuel-input-field input[type="number"]::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.fuel-unit-badge {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(124, 58, 237, 0.1);
  border-left: 1px solid rgba(124, 58, 237, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.route-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recalc-stations-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  transition: all var(--transition);
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recalc-stations-btn:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.recalc-stations-btn:active {
  transform: translateY(0);
}

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

/* â”€â”€ Footer â”€â”€ */
footer p {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
  text-align: center;
}

/* â”€â”€ Leaflet overrides â”€â”€ */
.leaflet-control-attribution {
  display: none;
  /* Attribution shown in panel footer */
}

/* â”€â”€ AnimaciÃ³n â”€â”€ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   Desktop: ancho mínimo sin breakpoint (≥ 769px ya manejado
   por la sección de mobile abajo)
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM SHEET  (≤ 768 px)
   ═══════════════════════════════════════════════════════════════════════ */

/* El handle siempre existe en el DOM pero se oculta en desktop */
#sheet-handle {
  display: none;
}

@media (max-width: 768px) {

  /* ── Variables de altura para los 3 estados ── */
  :root {
    /* colapsado: solo header */
    --sheet-peek: 105px;
    /* punto intermedio: con rutas */
    --sheet-mid: 520px;
    /* punto inicial: origen y destino */
    --sheet-init: 380px;
    /* expandido */
    --sheet-full: 96vh;
    /* radio de las esquinas */
    --sheet-radius: 20px;
  }

  /* ── Panel principal → bottom sheet ── */
  #panel {
    /* Resetear layout desktop */
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: var(--sheet-full);
    border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 1rem 1.2rem;
    gap: 0.8rem;
    z-index: 2000;
    overflow-y: auto;
    /* scroll interno */
    scrollbar-width: none;
    /* Estado inicial: intermedio (mid) */
    transform: translateY(calc(var(--sheet-full) - var(--sheet-init)));
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
  }

  #panel::-webkit-scrollbar {
    display: none;
  }

  #panel.sheet--dragging {
    transition: none;
  }

  #panel.sheet--peek {
    transform: translateY(calc(var(--sheet-full) - var(--sheet-peek)));
  }

  #panel.sheet--mid {
    transform: translateY(calc(var(--sheet-full) - var(--sheet-mid)));
  }

  #panel.sheet--full {
    transform: translateY(0);
  }

  /* ── Handle de arrastre ── */

  #sheet-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 28px;
    cursor: grab;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--panel-bg);
    margin: 0 -1rem;
    padding: 0 1rem;
    touch-action: none;
  }

  #sheet-handle:active {
    cursor: grabbing;
  }

  #sheet-handle__bar {
    width: 42px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    transition: background 0.2s;
  }

  #sheet-handle:hover #sheet-handle__bar,
  #sheet-handle:active #sheet-handle__bar {
    background: var(--accent-light);
  }

  /* ── Header más compacto en mobile ── */
  #panel>header {
    padding-top: 0.4rem;
  }

  #panel>header h1 {
    font-size: 1.1rem;
  }

  /* ── Ocultar paneles laterales de desktop en mobile ── */
  #fuel-stops-panel,
  #directions-panel,
  #global-stations-panel {
    display: none !important;
  }

  /* ── Paneles inline de mobile ── */
  /* En mobile se muestran (el JS los controla via style.display) */
  .mobile-inline-panel[style*="block"],
  .mobile-inline-panel.mobile-inline-panel--visible {
    border-top: 1px solid var(--card-border);
    padding-top: 0.8rem;
    margin-top: 0.4rem;
  }

  /* Forzamos que el panel de mobile siempre se pueda mostrar */
  .mobile-inline-panel {
    /* reset del display:none inline que pone el HTML */
    border-top: 1px solid var(--card-border);
    padding-top: 0.8rem;
    margin-top: 0.4rem;
  }

  .mobile-inline-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.6rem;
  }

  .mobile-inline-panel__close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    width: auto;
    transition: color var(--transition), background var(--transition);
  }

  .mobile-inline-panel__close:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
  }

  /* Summarybar de indicaciones mobile */
  #mobile-directions-summary-bar {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }

  /* Lista de pasos de indicaciones inline */
  #mobile-directions-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Lista de paradas de combustible inline */
  #mobile-fuel-stops-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Botones de tarjetas de ruta más pequeños en mobile para que quepan */
  .nav-start-btn {
    min-width: 60px;
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  /* El HUD de navegación en mobile queda sobre el panel */
  #nav-overlay {
    bottom: calc(var(--sheet-peek) + 12px) !important;
    z-index: 1200;
  }

  #nav-overlay.nav-overlay--visible {
    bottom: calc(var(--sheet-peek) + 12px);
  }

  /* El control de NavigationControl (brújula/zoom) en mobile queda más arriba */
  .maplibregl-ctrl-bottom-right {
    bottom: calc(var(--sheet-peek) + 12px) !important;
  }
}

/* Muy pequeño (≤ 380px) */
@media (max-width: 380px) {
  :root {
    --sheet-peek: 158px;
  }
}

/* ——— Paneles de la derecha (Indicaciones y Combustible) ——— */
#fuel-stops-panel,
#directions-panel {
  position: fixed;
  left: calc(var(--panel-width) + 32px);
  width: 280px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease,
    background 0.35s ease, border-color 0.35s ease;
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

#fuel-stops-panel.open,
#directions-panel.open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Panel de Combustible (Superior) */
#fuel-stops-panel {
  top: 16px;
  height: 35vh;
  background: rgba(15, 12, 41, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
}

#fuel-stops-panel.open {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(245, 158, 11, 0.15);
}

/* Panel de Indicaciones (Inferior) */
#directions-panel {
  top: calc(35vh + 32px);
  bottom: 16px;
  background: color-mix(in srgb, var(--route-color, #7c3aed) 6%, var(--panel-bg));
  border: 1px solid color-mix(in srgb, var(--route-color, #a78bfa) 35%, var(--card-border));
  border-radius: var(--radius);
}

#directions-panel.open {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px color-mix(in srgb, var(--route-color, #a78bfa) 25%, transparent);
}

/* Headers comunes */
#fuel-stops-header,
#directions-header {
  padding: 0.8rem 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  flex-shrink: 0;
}

#fuel-stops-title,
#directions-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

#fuel-stops-summary,
#directions-summary {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

#fuel-stops-close,
#directions-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition);
}

#fuel-stops-close:hover,
#directions-close:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border-color: #f87171;
  transform: none;
  box-shadow: none;
}

/* Lista de estaciones */
#fuel-stops-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#fuel-stops-list::-webkit-scrollbar {
  width: 4px;
}

#fuel-stops-list::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.5);
  border-radius: 4px;
}

/* Estilo de parada sugerida */
.fuel-stop-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.fuel-stop-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.fuel-stop-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fuel-stop-item__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.fuel-stop-item__km {
  font-size: 0.72rem;
  color: #f59e0b;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 8px;
}

.fuel-stop-item__type {
  font-size: 0.68rem;
  color: var(--muted);
}

/* Alternativas colapsables */
.fuel-stop-alternatives {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}

.fuel-stop-alternatives__toggle {
  font-size: 0.65rem;
  color: #6366f1;
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
  margin-bottom: 2px;
}

.fuel-stop-alternatives__list {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding-left: 8px;
  border-left: 2px solid rgba(245, 158, 11, 0.2);
}

.fuel-stop-alternatives__list.open {
  display: flex;
}

.alt-station {
  font-size: 0.68rem;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
}

.alt-station:hover {
  color: #fff;
}

/* Lista scrolleable de pasos */
#directions-steps {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 0.6rem 0;
}

#directions-steps::-webkit-scrollbar {
  width: 4px;
}

#directions-steps::-webkit-scrollbar-track {
  background: transparent;
}

#directions-steps::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* Cada paso */
.dir-step {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition);
}

.dir-step:last-child {
  border-bottom: none;
}

.dir-step:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dir-step--clickable {
  cursor: pointer;
}

.dir-step--active {
  background: rgba(167, 139, 250, 0.1);
  border-left: 2px solid var(--accent-light);
  padding-left: calc(1.1rem - 2px);
  /* compensar el borde */
}

.dir-step__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.dir-step__icon--dest {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.25);
}

.dir-step__icon--start {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.35);
}

.dir-step--stop {
  background: rgba(34, 197, 94, 0.08);
}

.dir-step--stop.dir-step--active {
  background: rgba(34, 197, 94, 0.15);
  border-left-color: #22c55e;
}

.dir-step__icon--stop {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.dir-step__body {
  flex: 1;
  min-width: 0;
}

.dir-step__instruction {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

.dir-step__meta {
  font-size: 0.71rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Separador de leg (entre paradas) */
.dir-leg-sep {
  padding: 0.4rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(167, 139, 250, 0.07);
  border-top: 1px solid rgba(167, 139, 250, 0.12);
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
  letter-spacing: 0.03em;
}

/* Custom Leaflet Map Pin para Estaciones */
.custom-leaflet-pin {
  background: transparent;
  border: none;
}

.modern-fuel-pin {
  position: relative;
  width: 60px;
  height: 60px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modern-fuel-pin svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
  transition: filter 0.25s ease;
}

.modern-fuel-pin:hover {
  transform: scale(1.15) translateY(-4px);
  z-index: 1000;
}

.modern-fuel-pin:hover svg {
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

.modern-fuel-pin .pin-label {

  /* Centro del cÃ­rculo superior */
  color: white;
  filter: brightness(10);
  font-size: 20px;
  line-height: 0;
  z-index: 2;
  pointer-events: none;
}

/* =========================================
 * Control Flotante Estaciones Globales
 * ========================================= */
.global-stations-control {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background: var(--panel-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', sans-serif;
  user-select: none;
  min-width: 200px;
}

.gsc-header {
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  cursor: pointer;
}

.gsc-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.gsc-body label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.gsc-body input[type="checkbox"] {
  cursor: pointer;
}

.gsc-body input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€ Filtro de Banderas â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.brand-filter-container {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.custom-multiselect {
  position: relative;
  width: 100%;
  user-select: none;
  margin-top: 0.4rem;
}

.multiselect-select {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.multiselect-select:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.multiselect-text {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.multiselect-arrow {
  font-size: 0.65rem;
  color: var(--muted);
  transition: transform 0.3s ease;
}

.custom-multiselect.open .multiselect-arrow {
  transform: rotate(180deg);
}

.multiselect-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(15, 12, 41, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  max-height: 245px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0;
  animation: slideInDown 0.2s ease-out;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-multiselect.open .multiselect-options {
  display: block;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.multiselect-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.multiselect-option input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.multiselect-option span {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

.multiselect-options::-webkit-scrollbar {
  width: 5px;
}

.multiselect-options::-webkit-scrollbar-track {
  background: transparent;
}

.multiselect-options::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.3);
  border-radius: 4px;
}

.multiselect-options::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Switch Viajo de noche */
.night-travel-container {
  padding: 12px 14px;
  background: rgba(167, 139, 250, 0.04);
  border-radius: 12px;
  border: 1px dashed rgba(167, 139, 250, 0.2);
  margin-top: 5px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: #fff;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input:checked+.toggle-slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

input:checked+.toggle-slider:before {
  transform: translateX(20px);
}

/* ═══════════════════════════════════════════════════════════
   Botón de Iniciar Navegación en tarjeta de ruta
   ═══════════════════════════════════════════════════════════ */

.nav-start-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  height: 30px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 40px;
  min-height: 40px;
  justify-content: center;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.nav-start-btn:hover {}

.nav-start-btn:active {
  transform: translateY(0);
}

.nav-start-btn--active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
  animation: nav-btn-pulse 2s ease infinite;
}

.nav-start-btn--active:hover {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
}

@keyframes nav-btn-pulse {

  0%,
  100% {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
  }

  50% {
    box-shadow: 0 2px 18px rgba(239, 68, 68, 0.65);
  }
}

/* ═══════════════════════════════════════════════════════════
   Marcador de posición GPS (puck de navegación)
   ═══════════════════════════════════════════════════════════ */

.nav-user-marker {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Onda de pulso exterior */
.nav-user-marker__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.25);
  animation: nav-pulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes nav-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }

  70% {
    transform: scale(1.9);
    opacity: 0;
  }

  100% {
    transform: scale(0.6);
    opacity: 0;
  }
}

/* Círculo principal del puck */
.nav-user-marker__dot {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6366f1;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Flecha de dirección */
.nav-user-marker__arrow {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #6366f1;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
  transform-origin: 50% calc(100% + 11px);
}

/* ═══════════════════════════════════════════════════════════
   HUD Overlay de navegación (bottom bar)
   ═══════════════════════════════════════════════════════════ */

/* HUD Overlay Removido */





#nav-overlay__status {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

#nav-overlay__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  animation: sat-spin 3s linear infinite;
}

@keyframes sat-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}







/* ── HUD de Velocidad (Flotante) ── */
#nav-speed-overlay {
  position: fixed;
  top: 100px;
  /* Debajo del panel de indicaciones */
  left: 12px;
  z-index: 1500;
  padding: 10px 16px;
  background: rgba(15, 12, 41, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

#nav-speed-overlay.visible {
  display: flex !important;
}

.nav-speed__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-light);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.nav-speed__unit {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── HUD de Próxima Maniobra (Top Overlay) ── */
#next-maneuver-overlay {
  position: fixed;
  top: 15px;
  right: 250px;
  z-index: 1500;
  width: calc(100% - 24px);
  max-width: 350px;
  background: rgba(15, 12, 41, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px 18px;
  display: none;
  align-items: center;
  gap: 14px;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media screen and (max-width: 768px) {
  #next-maneuver-overlay {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1500;
    width: calc(100% - 24px);
    max-width: unset;
    background: rgba(15, 12, 41, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 14px 18px;
    display: none;
    align-items: center;
    gap: 14px;
    color: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

#next-maneuver-overlay.visible {
  display: flex !important;
  opacity: 1;
}

.next-maneuver__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.next-maneuver__icon .material-symbols-outlined {
  font-size: 24px;
  color: #fff;
}

.next-maneuver__body {
  flex: 1;
  min-width: 0;
}

/* ── Botón de Recetrar ── */
#nav-recenter-btn {
  position: fixed;
  top: 105px;
  /* Arriba del bottom sheet colapsado */
  right: 18px;
  width: auto;
  z-index: 1500;
  display: none;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#nav-recenter-btn.visible {
  display: flex;
  animation: fadeInDown 0.3s ease forwards;
}

#nav-recenter-btn:hover {
  transform: translateY(-2px);
  background: var(--accent-light);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.next-maneuver__instruction {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-maneuver__dist {
  font-size: 0.8rem;
  color: var(--accent-light);
  font-weight: 700;
}

/* ── MODAL CONFIGURACIÓN ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--panel-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: visible;
  transform: translateY(20px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-container {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: all var(--transition);
}

.modal-close-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.modal-body {
  padding: 0;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.config-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 20px;
}

.config-section:first-of-type {
  margin-top: 20px;
}

.modal-footer {
  padding: 1.2rem 1.6rem;
  border-top: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}

.modal-apply-btn {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.25);
}

.modal-apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}


.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  align-self: center;
  border-bottom: none;
  border-top-color: #524e6d;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  align-self: center;
  border-top: none;
  border-bottom-color: #524e6d;
}

.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  align-self: center;
  border-right: none;
  border-left-color: #524e6d;
}


.maplibregl-popup-content {
  background: #524e6d;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
  padding: 0;
  pointer-events: auto;
  position: relative;
  color: #fff;
}

.maplibregl-popup-close-button {
  background-color: transparent;
  border: 0;
  border-radius: 0 3px 0 0;
  cursor: pointer;
  position: absolute;
  right: 0;
  top: 0;
  width: 35px;
}

.custom-popup {
  overflow: hidden;
  border-radius: 10px;
}

.custom-popup .popup-title {
  font-size: 18px;
  font-weight: bold;
  height: 36px;
  background-color: rgba(255, 255, 255, .1);
  padding: 0px 10px;
  line-height: 36px;
}

.custom-popup .popup-fuel-type {
  font-size: 12px;
  font-weight: bold;
  margin: 5px 10px;
}

.custom-popup .popup-location {
  line-height: 1;
  font-size: 11px;
  font-weight: normal;
  margin: 5px 10px;
}

.custom-popup .popup-distances {
  display: flex;
  margin: 10px 0 0 0px;
  gap: 0px;
  background-color: rgba(255, 255, 255, .1);
  border-radius: 0 0 10px 10px;
}


.custom-popup .popup-distances>* {
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  border-left: 1px solid rgba(255, 255, 255, .2);
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.custom-popup .popup-distances>*:first-of-type {
  border-left: none;
}

.custom-popup .popup-distances .material-symbols-outlined {
  font-size: 14px;
  color: #c7c1ee
}

.custom-popup .popup-distances .popup-distance-item {
  width: 100%;
}