:root{
  --bg: #f5f7fb;
  --surface: rgba(255,255,255,0.9);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --text-soft: #64748b;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

*{box-sizing:border-box}
html,body,#map{height:100%;margin:0;padding:0}
body{
  font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:linear-gradient(135deg, #f8fbff 0%, #eef4ff 45%, #f7fbf9 100%);
  color:var(--text);
  overflow:hidden;
  -webkit-font-smoothing:antialiased;
}

.app-shell{position:relative;width:100%;height:100%}
.app-header{
  position:fixed;left:0;right:0;top:0;
  z-index:1000;
  padding:clamp(12px, 2.2vw, 18px) 14px 14px;
  display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px;
  background:linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
  backdrop-filter:blur(20px);
  border-bottom:1px solid rgba(255,255,255,0.8);
  box-shadow:0 10px 30px rgba(15,23,42,0.08);
}

.app-header__content{flex:1 1 280px;min-width:0}
.eyebrow{
  margin:0 0 4px;
  font-size:0.78rem;
  font-weight:700;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--accent);
}

.app-header h1{
  margin:0 0 4px;
  font-size:clamp(1rem, 2.1vw, 1.24rem);
  font-weight:800;
  letter-spacing:-0.03em;
  color:var(--text);
}

.header-subtitle{
  margin:0;
  font-size:0.9rem;
  line-height:1.4;
  color:var(--text-soft);
}

#map{position:fixed;inset:0}

.controls{
  display:flex;flex-wrap:wrap;gap:8px;
  align-items:center;
  justify-content:flex-end;
}

.controls select,
.controls button,
.controls label,
#location-input button,
#location-input input,
.popup-nav a{
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--surface-strong);
  font-size:0.92rem;
  color:var(--text);
  box-shadow:0 8px 20px rgba(15,23,42,0.06);
}

.controls select,
.controls button,
.controls label{min-height:42px}

.controls label{
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.controls label:hover,
.controls label:has(input:focus-visible){
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,0.08);
}

.controls label input[type="checkbox"]{
  width:18px;
  height:18px;
  accent-color:var(--accent);
}

.controls button,
#location-input button{
  font-weight:700;
  color:var(--text);
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.controls button:hover,
.controls button:focus-visible,
#location-input button:hover,
#location-input button:focus-visible,
.popup-nav a:hover,
.popup-nav a:focus-visible{
  transform:translateY(-1px);
  border-color:rgba(37,99,235,0.25);
  box-shadow:0 12px 24px rgba(37,99,235,0.12);
}

.floating-stack{position:fixed;z-index:1100;inset:0;pointer-events:none}

#legend{
  position:absolute;left:14px;top:clamp(132px, 18vh, 178px);
  background:rgba(255,255,255,0.96);
  padding:10px 12px;
  border-radius:16px;
  box-shadow:var(--shadow);
  font-size:12px;line-height:1.25;
  border:1px solid rgba(255,255,255,0.8);
  pointer-events:auto;
}

#legend .item{display:flex;gap:8px;align-items:center;margin-bottom:6px}
#legend .item:last-child{margin-bottom:0}
#legend .dot{width:12px;height:12px;border-radius:999px;display:inline-block;flex:0 0 auto}

#location-input{
  position:absolute;top:clamp(86px, 12vh, 116px);left:50%;transform:translateX(-50%);
  z-index:1100;
  display:flex;gap:6px;
  max-width:min(92vw, 420px);width:min(92vw, 420px);
  background:rgba(255,255,255,0.97);
  padding:7px;
  border-radius:18px;
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,0.8);
  pointer-events:auto;
}

#location-input input{
  flex:1;min-width:0;border:none;box-shadow:none;padding:10px 12px;background:transparent;font-size:0.95rem;
}

#location-input input:focus{outline:none}
#location-input button{font-weight:700;color:#fff;background:linear-gradient(135deg,var(--accent),#3b82f6)}
#refresh-position{background:transparent !important;border:0px !important;padding:0;margin-right:0;height:10px  !important}
.leaflet-top,.leaflet-bottom{z-index:1000}
.leaflet-marker-icon{filter:drop-shadow(0 2px 5px rgba(0,0,0,0.24))}
.leaflet-popup-content-wrapper{
  border-radius:20px;
  box-shadow:0 18px 45px rgba(15,23,42,0.16);
  border:1px solid rgba(255,255,255,0.85);
  overflow:hidden;
  background:linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  margin:0 !important;
}
.leaflet-popup-content{margin:0;line-height:1.45;width:min(92vw, 320px)}
.leaflet-popup-tip{background:rgba(255,255,255,0.98)}
.leaflet-popup-close-button{font-size:1rem;color:var(--text-soft)!important;top:10px!important;right:10px!important}
.popup-card__header{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin-bottom:8px}
.popup-card__title-group{min-width:0}
.popup-card__eyebrow{margin-bottom:3px;font-size:0.7rem;font-weight:800;letter-spacing:0.16em;text-transform:uppercase;color:var(--accent)}
.popup-card strong{display:block;margin-bottom:3px;font-size:1rem;color:var(--text);line-height:1.25}
.popup-brand{display:block;font-size:0.8rem;font-weight:600;color:var(--accent);}
.popup-price-chip{
  display:inline-flex;align-items:center;justify-content:center;
  padding:6px 9px;border-radius:999px;font-size:0.8rem;font-weight:700;line-height:1;
  white-space:nowrap;color:#fff;background:linear-gradient(135deg,var(--accent),#3b82f6);
  border:1px solid rgba(255,255,255,0.7);box-shadow:0 6px 14px rgba(37,99,235,0.16);
}
.popup-price-chip--muted{background:linear-gradient(135deg,#64748b,#94a3b8)}
.popup-card__price-block{margin-bottom:10px}
.popup-card__summary{display:grid;gap:8px;margin-bottom:10px}
.popup-card__summary-row{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;padding:8px 0;border-top:1px solid #eef2f7;font-size:0.88rem;color:var(--text-soft)}
.popup-card__summary-row:first-child{border-top:none;padding-top:0}
.popup-card__summary-label{font-weight:700;color:var(--text)}
.popup-card__summary-value{text-align:right;max-width:60%}
.popup-card__summary-row--stacked{display:block}
.popup-card__summary-row--stacked .popup-card__summary-label{display:block;margin-bottom:6px}
.popup-fuel-list{display:flex;flex-wrap:wrap;gap:6px}
.popup-fuel-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:999px;background:#eef4ff;color:#1d4ed8;font-size:0.74rem;font-weight:700;border:1px solid rgba(37,99,235,0.14)}
.popup-fuel-chip strong{margin:0;font-size:0.74rem;color:#1d4ed8}
.popup-fuel-chip--out-of-stock{background:#fee2e2;color:#991b1b;border-color:rgba(153,27,27,0.24)}
.popup-fuel-chip--out-of-stock strong{color:#991b1b}
.popup-empty-state{font-size:0.82rem;color:var(--text-soft)}
.popup-nav{display:flex;gap:8px;margin-top:4px}
.popup-nav__item{display:grid;place-items:center;min-width:44px;min-height:44px;padding:8px;text-decoration:none;border-radius:12px;background:#f8fafc;border:1px solid #e5e7eb;box-shadow:0 5px 12px rgba(15,23,42,0.05);transition:transform .15s ease, box-shadow .15s ease}
.popup-nav__item:hover,.popup-nav__item:focus-visible{transform:translateY(-1px);box-shadow:0 8px 16px rgba(37,99,235,0.12)}
.popup-nav__item svg,.popup-nav__logo{width:24px;height:24px;fill:currentColor;color:var(--accent)}
.popup-nav__logo{display:block;max-width:100%;max-height:100%;object-fit:contain}

@media (max-width: 700px){
  .popup-nav__item{min-width:42px;min-height:42px;padding:6px}
  .popup-nav__item svg,.popup-nav__logo{width:22px;height:22px}
}
.station-price-badge{
  display:inline-flex;align-items:center;justify-content:center;
  padding:4px 7px;border-radius:999px;font-size:9px;font-weight:800;line-height:1;
  white-space:nowrap;color:#fff;background:linear-gradient(135deg,var(--accent),#3b82f6);
  border:1px solid rgba(255,255,255,0.65);box-shadow:0 4px 10px rgba(37,99,235,0.18);
}

.station-ev-badge{
  display:inline-flex;align-items:center;justify-content:center;
  padding:4px 7px;border-radius:999px;font-size:10px;font-weight:800;line-height:1;
  white-space:nowrap;color:#fff;background:linear-gradient(135deg,#007bff,#0056b3);
  border:1px solid rgba(255,255,255,0.65);box-shadow:0 4px 10px rgba(0,123,255,0.18);
}

@media (max-width: 700px){
  .app-header{padding:10px 10px 12px;gap:8px}
  .header-subtitle{display:none}
  .controls{width:100%}
  .controls select,.controls button,.controls label{flex:1 1 calc(50% - 6px)}
  #legend{left:10px;top:178px;max-width:calc(100vw - 20px)}
  #location-input{top:105px;left:10px;right:10px;transform:none;width:auto;max-width:none}
  #location-input input{font-size:0.95rem}
  .leaflet-popup-content{width:min(92vw, 300px)}
  .popup-card{padding:10px 12px 10px}
  .popup-card__summary-row{flex-direction:column;gap:4px}
  .popup-card__summary-value{text-align:left;max-width:100%}
  .popup-nav__item{min-width:42px;min-height:42px}
  .station-price-badge{font-size:8px;padding:2px 4px}
}

/* Positionnement spécifique pour le bouton GPS */
#gps-refresh-button {
  margin-right: 0px;
  min-width: 25px !important;
  height: 25px !important;
  padding: 0px !important;
  background: transparent !important;
  border: none !important;
}

/* Correction du style pour le bouton de géolocalisation */
#refresh-position {
  margin-right: 0px;
  min-width: 25px !important;
  height: 25px !important;
  padding: 0px !important;
  background: transparent !important;
  border: none !important;
}
