/**
 * distillerie-locator.css — Styles du store locator front-end
 *
 * Extrait verbatim du fichier HTML v6.4 (La Distillerie de Brest).
 * Tout le CSS est isolé sous #distillerie-locator :
 *  - Aucun conflit avec le thème actif (Divi, Elementor, Avada, etc.)
 *  - Reset scoped (box-sizing, margin, padding) pour éviter les fuites
 *  - Tokens CSS custom vars définis sur la racine #distillerie-locator
 *
 * Les marqueurs Leaflet (.dl-pin-wrap, .dl-pin) NE sont PAS scopés
 * sous #distillerie-locator car Leaflet injecte ses éléments directement
 * dans le body. Ce comportement est intentionnel.
 *
 * Dépendances chargées séparément (voir DL_Shortcode::register_assets) :
 *  - Google Fonts : Open Sans + DM Mono
 *  - Leaflet CSS  : leaflet.min.css 1.9.4
 *
 * @package DistillerieLocator
 * @since   1.0.0
 * @version 6.4
 */

/* ══════════════════════════════════════════════════════
   RESET — isolé sous #distillerie-locator (safe Divi)
══════════════════════════════════════════════════════ */
#distillerie-locator *,
#distillerie-locator *::before,
#distillerie-locator *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ══════════════════════════════════════════════════════
   TOKENS DE DESIGN
══════════════════════════════════════════════════════ */
#distillerie-locator {
  --primary:        #122e48;
  --primary-hover:  #1a4269;
  --white:          #ffffff;
  --bg:             #ffffff;
  --surface:        #f7f8fa;
  --border:         #e4e8ed;
  --blue-tint2:     #d0dce8;   /* bordure du select */
  --muted:          #6b7a8d;
  --text:           #0d1b2a;

  --font-head:      'Open Sans', sans-serif;
  --font-mono:      'DM Mono', monospace;

  --r-btn:          30px;
  --r-card:         10px;
  --r-select:       8px;
  --shadow-card:    0 2px 16px rgba(18,46,72,.08);
  --shadow-sheet:   0 -4px 32px rgba(18,46,72,.14);
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

  font-family: var(--font-head);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════
   LOC-HEADER — bloc collant commun desktop + mobile
   Contient : filtre produit / switch Carte-Liste / ville
══════════════════════════════════════════════════════ */
#distillerie-locator .loc-header {
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}

/* ── Filtre produit ── */
#distillerie-locator .loc-filters-panel {
  padding: 14px 24px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

/* ── Switch Carte/Liste + compteur ── */
#distillerie-locator .view-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
#distillerie-locator .view-switch-left { display: flex; gap: 8px; }

/* ── Bande ville active ── */
#distillerie-locator .city-bar {
  font-family: var(--font-mono);
  font-size: .70rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 24px;
  min-height: 34px;
  display: flex;
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
#distillerie-locator .filter-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ── SELECT PRODUIT STYLISÉ ── */
#distillerie-locator .select-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  flex-shrink: 0;
}
#distillerie-locator .prod-select {
  width: 100%;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;           /* ≥ 16px → pas d'auto-zoom iOS */
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--blue-tint2);
  border-radius: var(--r-select);
  padding: 10px 44px 10px 16px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
  line-height: 1.4;
}
#distillerie-locator .prod-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18,46,72,.10);
}
#distillerie-locator .prod-select option  { font-weight: 400; font-size: 15px; }
#distillerie-locator .prod-select optgroup {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .05em;
}
/* Chevron SVG via background */
#distillerie-locator .select-wrap::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23122e48' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

/* Compteur dans le switch (côté droit) — partagé desktop/mobile */
#distillerie-locator .switch-count,
#distillerie-locator .result-count {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   STICKY VIEW SWITCH — visible sur toutes tailles
   Sur mobile : collé sous la barre filtres, sticky
   Sur desktop : masqué (la carte est toujours visible)
══════════════════════════════════════════════════════ */
#distillerie-locator .view-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  /* sticky géré uniquement en mobile via @media */
}
#distillerie-locator .view-switch-left {
  display: flex;
  gap: 8px;
}
#distillerie-locator .view-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .82rem;
  padding: 9px 20px;
  border-radius: var(--r-btn);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: background .2s var(--ease-out), color .2s var(--ease-out),
              border-color .2s var(--ease-out);
}
#distillerie-locator .view-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
#distillerie-locator .view-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   SPLIT-SCREEN DESKTOP
══════════════════════════════════════════════════════ */
#distillerie-locator .loc-shell {
  display: flex;
  height: 100svh;
  min-height: 520px;
}
#distillerie-locator .loc-left {
  width: 40%;
  min-width: 320px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
#distillerie-locator .loc-right {
  flex: 1;
  position: relative;
}
#distillerie-locator #loc-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ══════════════════════════════════════════════════════
   LISTE
══════════════════════════════════════════════════════ */
#distillerie-locator .list-wrap {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 32px;
}
#distillerie-locator .list-wrap::-webkit-scrollbar { width: 4px; }
#distillerie-locator .list-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

#distillerie-locator .city-label {
  font-family: var(--font-mono);
  font-size: .70rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 18px 24px 8px;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 5;
  border-bottom: 1px solid var(--border);
}

#distillerie-locator .loc-card {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .14s;
  position: relative;
}
#distillerie-locator .loc-card:hover   { background: var(--surface); }
#distillerie-locator .loc-card.selected { background: #eef3f8; }

#distillerie-locator .card-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 2px;
}
#distillerie-locator .card-address {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
#distillerie-locator .card-products {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
#distillerie-locator .prod-tag {
  font-family: var(--font-mono);
  font-size: .67rem;
  font-weight: 500;
  letter-spacing: .05em;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
#distillerie-locator .prod-tag.highlight {
  background: #e8f0f8;
  border-color: var(--blue-tint2);
  color: var(--primary);
}

/* ── Bouton primaire ── */
#distillerie-locator .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .82rem;
  padding: 11px 22px;
  border-radius: var(--r-btn);
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s, transform .15s var(--ease-spring);
  position: relative;
  overflow: hidden;
}
#distillerie-locator .btn-primary:hover  { background: var(--primary-hover); }
#distillerie-locator .btn-primary:active { transform: scale(.97); }
#distillerie-locator .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,.12);
  opacity: 0;
  transition: opacity .3s;
}
#distillerie-locator .btn-primary:active::after { opacity: 1; }
#distillerie-locator .arrow-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Empty state ── */
#distillerie-locator .loc-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
#distillerie-locator .loc-empty strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}

/* ══════════════════════════════════════════════════════
   MARQUEURS CSS CUSTOM (isolés — pas de conflit Leaflet)
   Note : ces classes ne sont PAS sous #distillerie-locator
   car Leaflet injecte les marqueurs directement dans le body.
══════════════════════════════════════════════════════ */
.dl-pin-wrap {
  position: relative;
  width: 28px;
  height: 34px;
}
.dl-pin {
  width: 24px;
  height: 24px;
  background: #122e48;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(18,46,72,.35);
  transition: transform .25s cubic-bezier(0.34,1.56,0.64,1), background .2s;
}
.dl-pin-wrap.active .dl-pin {
  background: #1a6fba;
  transform: rotate(-45deg) scale(1.22);
  box-shadow: 0 0 0 7px rgba(26,111,186,.15), 0 2px 10px rgba(18,46,72,.3);
}
.dl-pin-wrap.faded .dl-pin { opacity: .2; }
.dl-pin-wrap.active .dl-pin::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px solid rgba(26,111,186,.35);
  animation: pin-pulse 1.7s cubic-bezier(0.22,1,0.36,1) infinite;
}
@keyframes pin-pulse {
  0%   { transform: scale(.5); opacity: 1; }
  100% { transform: scale(2);  opacity: 0; }
}

/* ══════════════════════════════════════════════════════
   BOTTOM SHEET MOBILE
══════════════════════════════════════════════════════ */
#distillerie-locator .bottom-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-sheet);
  z-index: 200;
  transform: translateY(110%);
  transition: transform .32s cubic-bezier(0.22,1,0.36,1);
  touch-action: none;
  padding-bottom: 36px;
}
#distillerie-locator .bottom-sheet.open { transform: translateY(0); }
#distillerie-locator .sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 12px auto 16px;
  cursor: grab;
}
#distillerie-locator .sheet-content { padding: 0 24px; }
#distillerie-locator .sheet-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
#distillerie-locator .sheet-address {
  font-size: .88rem;
  color: var(--muted);
  margin-top: 3px;
  font-style: normal;
}
#distillerie-locator .sheet-products {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 16px;
}
#distillerie-locator .sheet-close {
  position: absolute;
  top: 12px; right: 16px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE MOBILE
   loc-shell = 100svh, loc-header figé, list-wrap scrolle
══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  #distillerie-locator { min-height: unset; }

  #distillerie-locator .loc-shell {
    flex-direction: column;
    height: 100svh;
    min-height: unset;
    position: sticky;
    top: 0;
    overflow: hidden;
  }
  #distillerie-locator .loc-left {
    width: 100%; max-width: 100%;
    border-right: none;
    height: 100%;
  }
  #distillerie-locator .loc-right      { display: none; }
  #distillerie-locator .select-wrap    { max-width: 100%; }

  /* La carte mobile prend tout l'espace sous le loc-header */
  #distillerie-locator .mobile-map-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
  }

  #distillerie-locator .list-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 48px;
  }

  /* Vue carte */
  #distillerie-locator .loc-shell.show-map  .mobile-map-wrap  { display: block; }
  #distillerie-locator .loc-shell.show-map  .loc-header       { display: flex; flex-direction: column; }
  #distillerie-locator .loc-shell.show-map  .city-bar         { display: none; }
  #distillerie-locator .loc-shell.show-map  .list-wrap        { display: none; }
  /* Vue liste */
  #distillerie-locator .loc-shell.show-liste .mobile-map-wrap { display: none; }
  #distillerie-locator .loc-shell.show-liste .loc-header      { display: flex; flex-direction: column; }
  #distillerie-locator .loc-shell.show-liste .list-wrap       { display: block; }

  /* city-label dans la liste masqués : city-bar joue ce rôle */
  #distillerie-locator .city-label { display: none; }
}

@media (min-width: 768px) {
  /* city-bar masquée desktop : les city-label sticky dans list-wrap jouent ce rôle */
  #distillerie-locator .city-bar         { display: none; }
  /* switch-count masqué desktop (compteur inutile côté liste fixe) */
  #distillerie-locator .switch-count     { display: none; }
  /* view-switch masqué desktop : pas de toggle carte/liste nécessaire */
  #distillerie-locator .view-switch      { display: none; }
  #distillerie-locator .mobile-map-wrap  { display: none !important; }
  #distillerie-locator .list-wrap        { display: flex !important; flex-direction: column; }
  #distillerie-locator .loc-shell.show-liste .loc-right,
  #distillerie-locator .loc-shell.show-map   .loc-right { display: block; }
}

/* Leaflet z-index isolation */
#distillerie-locator .leaflet-pane   { z-index: 1 !important; }
#distillerie-locator .leaflet-top,
#distillerie-locator .leaflet-bottom { z-index: 2 !important; }
