/* ── Tokens ───────────────────────────────────────────────── */
.sl-page {
  --sl-green:       #16a34a;
  --sl-green-light: #22c55e;
  --sl-green-dk:    #15803d;
  --sl-ink:         #0f172a;
  --sl-ink-2:       #374151;
  --sl-muted:       #6b7280;
  --sl-border:      #e2e8f0;
  --sl-surface:     #ffffff;
  --sl-surface-2:   #f8fafc;
  --sl-radius:      16px;
  --sl-t:           0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  padding: 0;
}

/* ── Hero ─────────────────────────────────────────────────── */
.sl-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 40px 28px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border-bottom: 1px solid var(--sl-border);
  flex-wrap: wrap;
}

.sl-hero-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sl-green);
  margin-bottom: 6px;
}

.sl-hero-title {
  margin: 0 0 4px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--sl-ink);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.sl-hero-sub {
  margin: 0;
  font-size: 15px;
  color: var(--sl-muted);
}

.sl-hero-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.sl-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius);
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  min-width: 72px;
}

.sl-stat-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sl-stat-num--open   { color: var(--sl-green); }
.sl-stat-num--closed { color: #dc2626; }

.sl-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sl-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Search bar ───────────────────────────────────────────── */
.sl-search-bar {
  padding: 16px 40px;
  background: #fff;
  border-bottom: 1px solid var(--sl-border);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.sl-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 520px;
}

.sl-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sl-muted);
  pointer-events: none;
  display: flex;
}

.sl-search-icon svg { width: 17px; height: 17px; }

.sl-search-input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 44px;
  border: 1.5px solid var(--sl-border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--sl-ink);
  background: var(--sl-surface-2);
  outline: none;
  transition: border-color var(--sl-t), background var(--sl-t), box-shadow var(--sl-t);
  box-sizing: border-box;
  -webkit-appearance: none;
}

.sl-search-input::placeholder { color: #aab; }

.sl-search-input:focus {
  border-color: var(--sl-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.sl-search-input::-webkit-search-cancel-button { display: none; }

.sl-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sl-muted);
  transition: background var(--sl-t), color var(--sl-t);
  padding: 0;
}

.sl-search-clear svg { width: 12px; height: 12px; }

.sl-search-clear:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.sl-search-clear[hidden] { display: none; }

.sl-search-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.sl-search-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--sl-muted);
  white-space: nowrap;
}

.sl-search-filters {
  display: flex;
  gap: 4px;
  background: var(--sl-surface-2);
  border: 1px solid var(--sl-border);
  border-radius: 999px;
  padding: 3px;
}

.sl-filter-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--sl-muted);
  transition: background var(--sl-t), color var(--sl-t);
  white-space: nowrap;
}

.sl-filter-btn:hover { color: var(--sl-ink); }

.sl-filter-btn.is-active {
  background: #fff;
  color: var(--sl-ink);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

/* Card hidden state */
.sl-card.is-hidden {
  display: none;
}

/* Empty state */
.sl-empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--sl-muted);
  font-size: 14px;
  display: none;
}

.sl-empty-state.is-visible { display: block; }

.sl-empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ── Layout ───────────────────────────────────────────────── */
.sl-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
}

/* ── Map ──────────────────────────────────────────────────── */
.sl-map-col {
  position: relative;
  min-height: 500px;
}

#sl-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Override Leaflet attribution */
.leaflet-control-attribution {
  font-size: 10px !important;
  background: rgba(255,255,255,0.7) !important;
  backdrop-filter: blur(4px);
}

/* Custom marker pulse */
.sl-marker-open .sl-marker-dot {
  animation: slMarkerPulse 2s ease-in-out infinite;
}

@keyframes slMarkerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

/* ── Store list ───────────────────────────────────────────── */
.sl-list-col {
  overflow-y: auto;
  background: var(--sl-surface-2);
  border-left: 1px solid var(--sl-border);
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}

.sl-list-col::-webkit-scrollbar       { width: 4px; }
.sl-list-col::-webkit-scrollbar-track { background: transparent; }
.sl-list-col::-webkit-scrollbar-thumb { background: rgba(22,163,74,0.2); border-radius: 4px; }

/* ── Card ─────────────────────────────────────────────────── */
.sl-card {
  background: var(--sl-surface);
  padding: 20px 22px;
  border-bottom: 1px solid var(--sl-border);
  cursor: pointer;
  transition: background var(--sl-t), box-shadow var(--sl-t);
  position: relative;
}

.sl-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--sl-t);
}

.sl-card:hover { background: #f0fdf4; }
.sl-card:hover::before { background: var(--sl-green); }

.sl-card.is-active {
  background: #f0fdf4;
  box-shadow: inset 4px 0 0 var(--sl-green);
}

.sl-card.is-active::before { background: var(--sl-green); }

/* Card header */
.sl-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sl-card-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: var(--sl-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sl-card-icon svg { width: 18px; height: 18px; }

.sl-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.sl-card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--sl-ink);
  line-height: 1.3;
}

.sl-card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sl-card-badge--open   { background: #dcfce7; color: #15803d; }
.sl-card-badge--closed { background: #fee2e2; color: #dc2626; }

/* Card body */
.sl-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.sl-card-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  color: var(--sl-muted);
  line-height: 1.45;
}

.sl-card-row svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.sl-card-row strong { color: var(--sl-ink-2); font-weight: 600; }

/* Card actions */
.sl-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--sl-t), color var(--sl-t), border-color var(--sl-t), transform var(--sl-t);
  border: 1.5px solid;
}

.sl-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

.sl-btn--phone {
  border-color: rgba(22,163,74,0.3);
  color: var(--sl-green-dk);
}
.sl-btn--phone:hover {
  background: var(--sl-green);
  border-color: var(--sl-green);
  color: #fff;
  transform: translateY(-1px);
}

.sl-btn--nav {
  border-color: rgba(99,102,241,0.3);
  color: #4f46e5;
}
.sl-btn--nav:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
  transform: translateY(-1px);
}

/* ── Leaflet popup custom ─────────────────────────────────── */
.sl-popup {
  font-family: inherit;
  min-width: 180px;
}

.sl-popup-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sl-ink);
  margin: 0 0 4px;
}

.sl-popup-addr {
  font-size: 11px;
  color: var(--sl-muted);
  margin: 0 0 6px;
  line-height: 1.4;
}

.sl-popup-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.sl-popup-badge--open   { background: #dcfce7; color: #15803d; }
.sl-popup-badge--closed { background: #fee2e2; color: #dc2626; }

/* ── Responsive — Tablette (≤ 900px) ────────────────────── */
@media (max-width: 900px) {

  /* Hero */
  .sl-hero { padding: 28px 24px 20px; }

  /* Search bar */
  .sl-search-bar { padding: 12px 24px; gap: 12px; }
  .sl-search-wrap { min-width: 0; max-width: 100%; }

  /* Layout : carte en haut, liste en bas */
  .sl-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 340px auto;
    height: auto;
    min-height: unset;
    overflow: visible;
  }

  .sl-map-col { min-height: unset; height: 340px; }

  .sl-list-col {
    border-left: none;
    border-top: 1px solid var(--sl-border);
    max-height: 65vh;
    overflow-y: auto;
  }
}

/* ── Responsive — Mobile (≤ 600px) ──────────────────────── */
@media (max-width: 600px) {

  /* Hero */
  .sl-hero {
    padding: 20px 16px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .sl-hero-stats { gap: 12px; }

  .sl-stat { padding: 10px 14px; min-width: 60px; }
  .sl-stat-num { font-size: 22px; }

  /* Search bar : empile en colonne */
  .sl-search-bar {
    padding: 10px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .sl-search-wrap { min-width: 0; max-width: 100%; }

  .sl-search-meta {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  /* Filtres scrollables si débordement */
  .sl-search-filters {
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
  }
  .sl-search-filters::-webkit-scrollbar { display: none; }
  .sl-filter-btn { padding: 5px 10px; font-size: 11px; }

  /* Carte */
  .sl-layout { grid-template-rows: 280px auto; }
  .sl-map-col { height: 280px; }

  /* Cards */
  .sl-card { padding: 14px 16px; }
  .sl-card-name { font-size: 14px; }
  .sl-btn { padding: 6px 12px; font-size: 11px; }
}

/* ── Responsive — Petit mobile (≤ 380px) ────────────────── */
@media (max-width: 380px) {

  .sl-layout { grid-template-rows: 240px auto; }
  .sl-map-col { height: 240px; }

  .sl-hero-title { font-size: 24px; }
  .sl-stat { padding: 8px 10px; }

  .sl-card-actions { flex-direction: column; }
  .sl-btn { justify-content: center; }
}
