/* ============================================================
   gasolineras.css - estilos de "gasolineras baratas"
   Compartido por gasolineras.html y el perfil. Oscuro por defecto,
   con overrides para [data-theme="light"]. Tabla -> tarjetas en móvil.
   ============================================================ */

.gas-ctrls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px;
}
.gas-manual { display: flex; gap: 8px; flex: 1 1 240px; min-width: 200px; }
.gas-input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04);
  color: #f4f2ef; font-size: 14px; font-family: inherit;
}
.gas-input::placeholder { color: #8d8799; }
.gas-input:focus { outline: none; border-color: #005DF3; background: rgba(255,255,255,.07); }

.gas-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px;
  border-radius: 10px; border: 0; cursor: pointer; white-space: nowrap;
  background: #005DF3; color: #fff; font-weight: 700; font-size: 14px;
  font-family: inherit; transition: background .2s, transform .12s;
}
.gas-btn:hover { background: #0a4fd0; }
.gas-btn:active { transform: translateY(1px); }
.gas-btn-gps { background: #FEE40D; color: #15131c; }
.gas-btn-gps:hover { background: #ecd400; }

.gas-fuel { display: inline-flex; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; overflow: hidden; }
.gas-fuel-btn {
  padding: 10px 14px; border: 0; cursor: pointer; background: transparent;
  color: #a9a4b8; font-weight: 600; font-size: 13.5px; font-family: inherit; transition: background .15s, color .15s;
}
.gas-fuel-btn.is-on { background: #005DF3; color: #fff; }

.gas-estado { margin: 16px 0 10px; font-size: 13.5px; color: #a9a4b8; line-height: 1.55; }

.gas-box {
  border-radius: 18px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03); padding: 32px 22px; text-align: center; color: #a9a4b8;
}
.gas-box .em { font-size: 32px; display: block; margin-bottom: 10px; }

/* Tabla */
.gas-tabla-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid rgba(255,255,255,.08); }
.gas-tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.gas-tabla thead th {
  text-align: left; padding: 12px 14px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: #8d8799;
  background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(255,255,255,.08);
}
.gas-tabla tbody td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.gas-tabla tbody tr:last-child td { border-bottom: 0; }
.gas-tabla tbody tr:hover { background: rgba(255,255,255,.02); }

.gas-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.06);
  color: #cfc9dd; font-weight: 700; font-size: 12.5px;
}
.gas-dir { display: block; color: #8d8799; font-size: 12.5px; margin-top: 2px; }
.gas-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gas-sel { color: #FEE40D; font-weight: 700; }
.gas-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 9999px;
  background: rgba(34,197,94,.16); color: #4ade80; font-size: 11px; font-weight: 700; vertical-align: middle;
}
.gas-maps a { color: #3F93EF; font-weight: 600; text-decoration: none; white-space: nowrap; }
.gas-maps a:hover { text-decoration: underline; }

/* Móvil: cada fila -> tarjeta */
@media (max-width: 640px) {
  .gas-tabla-wrap { border: 0; overflow: visible; }
  .gas-tabla thead { display: none; }
  .gas-tabla, .gas-tabla tbody, .gas-tabla tr, .gas-tabla td { display: block; width: 100%; }
  .gas-tabla tr {
    border: 1px solid rgba(255,255,255,.08); border-radius: 14px; margin-bottom: 12px;
    padding: 6px 4px; background: rgba(255,255,255,.02);
  }
  .gas-tabla td {
    border: 0 !important; padding: 8px 14px; display: flex; gap: 12px;
    justify-content: space-between; align-items: baseline; min-width: 0;
  }
  .gas-tabla td > * { min-width: 0; }
  .gas-tabla td[data-lbl]::before {
    content: attr(data-lbl); color: #8d8799; font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; flex: 0 0 auto;
  }
  .gas-tabla td[data-lbl=""]::before { content: none; }

  /* Celda de la gasolinera: nombre + dirección apilados a ancho completo,
     con el texto largo envolviendo (no se sale de la caja). */
  .gas-tabla td[data-lbl="Gasolinera"] { flex-direction: column; align-items: flex-start; gap: 3px; }
  .gas-tabla td[data-lbl="Gasolinera"] b { overflow-wrap: anywhere; line-height: 1.3; }
  .gas-dir { text-align: left; overflow-wrap: anywhere; }
  .gas-tag { white-space: nowrap; }

  /* Controles a ancho completo en móvil (no se desbordan) */
  .gas-ctrls { flex-direction: column; align-items: stretch; gap: 8px; }
  .gas-manual { flex: none; width: 100%; min-width: 0; }
  .gas-btn-gps { width: 100%; justify-content: center; }
  .gas-fuel { display: flex; width: 100%; }
  .gas-fuel-btn { flex: 1; text-align: center; }

  .gas-estado { font-size: 13px; }

  /* Evita el zoom automático del navegador al enfocar el campo en móvil
     (iOS/Android hacen zoom si la fuente del input es < 16px y no vuelven). */
  .gas-input { font-size: 16px; }
}

/* ---- Modo claro ---- */
[data-theme="light"] .gas-input { background: #fff; border-color: rgba(0,0,0,.14); color: #15131c; }
[data-theme="light"] .gas-input::placeholder { color: #9a96a6; }
[data-theme="light"] .gas-fuel { border-color: rgba(0,0,0,.14); }
[data-theme="light"] .gas-fuel-btn { color: #54505f; }
[data-theme="light"] .gas-estado { color: #54505f; }
[data-theme="light"] .gas-box { background: #fff; border-color: rgba(0,0,0,.10); color: #54505f; }
[data-theme="light"] .gas-tabla-wrap { border-color: rgba(0,0,0,.10); }
[data-theme="light"] .gas-tabla thead th { background: #faf8f4; color: #7c7790; border-bottom-color: rgba(0,0,0,.10); }
[data-theme="light"] .gas-tabla tbody td { border-bottom-color: rgba(0,0,0,.07); }
[data-theme="light"] .gas-tabla tbody tr:hover { background: rgba(0,0,0,.02); }
[data-theme="light"] .gas-rank { background: rgba(0,0,0,.06); color: #54505f; }
[data-theme="light"] .gas-dir { color: #7c7790; }
[data-theme="light"] .gas-num.gas-sel { color: #b8860b; }
[data-theme="light"] .gas-tabla tr { background: #fff; border-color: rgba(0,0,0,.08); }

/* ---- Mapa estilo Airbnb ---- */
.gas-map {
  height: 440px; width: 100%; margin-top: 16px; border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.10); background: #0e0a1a; z-index: 1;
}
@media (max-width: 640px) { .gas-map { height: 340px; } }
.leaflet-container { font-family: inherit; background: #0e0a1a; }

/* "Buscar en esta zona" flotante sobre el mapa */
.gas-map-wrap { position: relative; }
.gas-buscar-zona {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; padding: 9px 16px; border-radius: 9999px; border: 0; cursor: pointer;
  background: #15131c; color: #fff; font-weight: 700; font-size: 13px; font-family: inherit;
  box-shadow: 0 3px 14px rgba(0,0,0,.55); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.gas-buscar-zona:hover { background: #000; }
.gas-buscar-zona[hidden] { display: none; }
[data-theme="light"] .gas-buscar-zona {
  background: #fff; color: #15131c; border: 1px solid rgba(0,0,0,.10); box-shadow: 0 3px 14px rgba(0,0,0,.22);
}
[data-theme="light"] .gas-buscar-zona:hover { background: #f4f2ef; }

/* Etiqueta de precio (divIcon). El wrapper lo posiciona Leaflet; la pastilla
   se escala en hover sin perder el anclaje. */
.gas-pin { background: transparent; border: 0; }
.gas-precio {
  display: inline-block; padding: 3px 9px; border-radius: 9999px;
  background: #fff; color: #15131c; font-weight: 800; font-size: 12px; line-height: 1.25;
  white-space: nowrap; border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 8px rgba(0,0,0,.45); cursor: pointer;
  transition: transform .12s ease; transform-origin: center;
}
.gas-precio:hover { transform: scale(1.15); }
.gas-precio.es-barata {
  background: #16a34a; color: #fff; border-color: #16a34a;
  box-shadow: 0 2px 12px rgba(22,163,74,.6);
}

/* Fila resaltada cuando se selecciona en el mapa */
.gas-row-on { background: rgba(254,228,13,.10) !important; box-shadow: inset 3px 0 0 #FEE40D; }

/* Popup */
.gas-pop { font-size: 13px; min-width: 184px; }
.gas-pop-dir { color: #8d8799; font-size: 12px; margin: 2px 0 7px; line-height: 1.4; }
.gas-pop-precios { display: flex; gap: 14px; margin-bottom: 4px; }
.gas-pop-precios b { color: #fff; }
.gas-pop-dist { color: #8d8799; font-size: 12px; margin-bottom: 9px; }
.gas-pop-btn {
  display: inline-block; background: #005DF3; color: #fff; padding: 7px 13px;
  border-radius: 8px; font-weight: 700; text-decoration: none; font-size: 12.5px;
}
.gas-pop-btn:hover { background: #0a4fd0; }
.leaflet-popup-content-wrapper { background: #1a1428; color: #f4f2ef; border-radius: 12px; }
.leaflet-popup-tip { background: #1a1428; }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-popup-content b { color: #fff; }

[data-theme="light"] .gas-map { background: #e8e6e1; border-color: rgba(0,0,0,.10); }
[data-theme="light"] .leaflet-container { background: #e8e6e1; }
[data-theme="light"] .gas-row-on { background: rgba(0,93,243,.08) !important; box-shadow: inset 3px 0 0 #005DF3; }
[data-theme="light"] .leaflet-popup-content-wrapper { background: #fff; color: #15131c; }
[data-theme="light"] .leaflet-popup-tip { background: #fff; }
[data-theme="light"] .leaflet-popup-content b, [data-theme="light"] .gas-pop-precios b { color: #15131c; }
[data-theme="light"] .gas-pop-dir, [data-theme="light"] .gas-pop-dist { color: #7c7790; }
