:root {
    color-scheme: light;
    --ink: #172b24;
    --muted: #64746d;
    --green: #16734a;
    --green-dark: #10583a;
    --paper: #f3f6f2;
    --line: #e0e8e1;
    --shadow: 0 12px 32px rgba(22, 48, 35, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { padding: 3.5rem 1.25rem 4.5rem; color: white; text-align: center; background: radial-gradient(ellipse at 75% 10%, #399269, transparent 38%), linear-gradient(130deg, #123d2b, #16734a); }
header h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.04em; }
header p { margin: .45rem 0 0; color: #d7ede0; }
main { width: min(1040px, calc(100% - 2rem)); margin: -2rem auto 3rem; position: relative; }
.controles { padding: 1.5rem; border: 1px solid rgba(255,255,255,.7); border-radius: 18px; background: white; box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.control { min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.control-busqueda { grid-column: span 2; }
.control label { color: #42564b; font-size: .83rem; font-weight: 700; }
.control select, .control input[type="text"], .control input[type="search"] { width: 100%; min-height: 46px; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; color: var(--ink); font: inherit; }
.control :focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #9bd4b4; outline-offset: 2px; }
.control select:focus, .control input[type="text"]:focus, .control input[type="search"]:focus { border-color: var(--green); }
.busqueda-campo { display: flex; gap: .5rem; }
.busqueda-campo input[type="search"] { flex: 1; min-width: 0; }
.boton-buscar { flex: 0 0 46px; min-height: 46px; border: 0; border-radius: 10px; background: var(--green); color: white; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.boton-buscar:hover { background: var(--green-dark); }
.control input[type="range"] { width: 100%; margin: .45rem 0; accent-color: var(--green); }
#precioMaxValor { color: var(--green); font-weight: 700; }
.control-boton { justify-content: end; }
.boton-ubicacion { min-height: 46px; padding: .65rem 1rem; border: 0; border-radius: 10px; background: var(--green); color: white; font: inherit; font-weight: 700; cursor: pointer; transition: background .18s, transform .18s; }
.boton-ubicacion:hover { background: var(--green-dark); transform: translateY(-1px); }
.boton-ubicacion:disabled { opacity: .65; cursor: wait; }
.boton-ubicacion.activo { background: #284a38; }
#resultados { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
#resultados > #mensaje, #resultados > p:first-child { grid-column: 1 / -1; }
#mensaje { margin: 0; padding: 2rem 1rem; text-align: center; color: var(--muted); }
#resultados > p:first-child:not(#mensaje) { color: var(--muted); }
.gasolinera { min-width: 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 18px rgba(22,48,35,.04); transition: transform .18s, box-shadow .18s; }
.gasolinera:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gasolinera h3 { margin: 0 0 .25rem; color: var(--ink); font-size: 1.05rem; }
.gasolinera .direccion { margin: 0 0 .85rem; color: var(--muted); font-size: .9rem; }
.gasolinera .precio { margin: 0; color: var(--green); font-size: 1.65rem; font-weight: 800; letter-spacing: -.04em; }
.gasolinera .precio-secundario, .gasolinera .distancia { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.boton-mapa { display: inline-flex; margin-top: .9rem; padding: .5rem .75rem; border-radius: 8px; background: #edf5ef; color: var(--green-dark); text-decoration: none; font-size: .9rem; font-weight: 700; }
.boton-mapa:hover { background: #dceee1; }
.badge-barata { display: inline-block; margin-left: .45rem; padding: .15rem .45rem; border-radius: 99px; background: #fff1cf; color: #805400; font-size: .68rem; font-weight: 800; vertical-align: middle; }
footer { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .85rem; }
footer p { margin: .2rem; }
@media (max-width: 760px) { .controles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .control-busqueda { grid-column: 1 / -1; } }
@media (max-width: 560px) { header { padding: 2.8rem 1rem 4rem; } main { width: min(100% - 1rem, 480px); margin-top: -1.75rem; } .controles { padding: 1rem; gap: .8rem; } #resultados { grid-template-columns: 1fr; } .gasolinera { padding: 1rem; } }
