/**
 * Léonille — Points de vente
 * Réutilise les variables et le langage visuel du thème (navy / crème / or, Fraunces + Jost,
 * « docks » et bulles en verre dépoli). Breakpoint mobile du thème : 768px.
 */

.leo-pdv {
  --leo-navy: var(--leonille-navy, #16253f);
  --leo-navy-light: var(--leonille-navy-light, #233a5e);
  --leo-cream: var(--leonille-cream, #fbefe3);
  --leo-gold: var(--leonille-gold, #b08d57);
  --leo-radius: 28px;
  --leo-glass: rgba(255, 255, 255, 0.38);
  --leo-glass-border: 1px solid rgba(255, 255, 255, 0.55);
  --leo-shadow: 0 20px 40px -20px rgba(22, 37, 63, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --leo-line: rgba(22, 37, 63, 0.09);

  margin: 1.5rem 0 3rem;
  color: var(--leo-navy);
  font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.4;
}

.leo-pdv *,
.leo-pdv *::before,
.leo-pdv *::after {
  box-sizing: border-box;
}

/* Remise à zéro : le composant vit souvent dans un contenu CMS (.rich-text) qui stylise ul/a/button. */
.leo-pdv ul,
.leo-pdv li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leo-pdv button {
  font: inherit;
  color: inherit;
  margin: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.leo-pdv button:focus-visible,
.leo-pdv a:focus-visible {
  outline: 2px solid var(--leo-gold);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ Onglets départements */

.leo-pdv__tabs {
  display: inline-flex;
  max-width: 100%;
  gap: 4px;
  padding: 6px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--leo-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: var(--leo-glass-border);
  border-radius: 100px;
  box-shadow: var(--leo-shadow);
}

.leo-pdv__tabs::-webkit-scrollbar {
  display: none;
}

.leo-pdv__tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 15px;
  letter-spacing: 0.01em;
  background: transparent;
  border: 0;
  border-radius: 100px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.leo-pdv__tab:hover {
  background: rgba(22, 37, 63, 0.08);
}

.leo-pdv__tab-code {
  font-size: 12px;
  opacity: 0.55;
}

.leo-pdv__tab.is-active,
.leo-pdv__tab.is-active:hover {
  background: var(--leo-navy);
  color: var(--leo-cream);
}

/* ------------------------------------------------------------------ Mise en page */

.leo-pdv__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .leo-pdv__layout {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    gap: 1.5rem;
    align-items: stretch;
  }
}

/* ------------------------------------------------------------------ Carte */

.leo-pdv__map {
  position: relative;
  height: min(88vw, 440px);
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--leo-radius);
  border: var(--leo-glass-border);
  box-shadow: var(--leo-shadow);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(rgba(22, 37, 63, 0.11) 1px, transparent 1.3px) 0 0 / 18px 18px,
    #f4e4d2;
  background-color: color-mix(in srgb, var(--leo-cream) 82%, var(--leo-gold) 18%);
}

@media (min-width: 768px) {
  .leo-pdv__map {
    height: clamp(460px, 68vh, 680px);
  }
}

.leo-pdv__map::after {
  /* Vignette « papier » discrète. */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 70px rgba(176, 141, 87, 0.16);
  z-index: 500;
}

.leo-pdv__map:not(.is-ready):not(.is-error)::before {
  content: attr(data-loading);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  opacity: 0.55;
  z-index: 1;
}

.leo-pdv .leo-pdv__canvas.leaflet-container {
  width: 100%;
  height: 100%;
  background: transparent;
  font: inherit;
  cursor: default;
  outline: 0;
}

/* Départements : SVG, stylés ici (les attributs Leaflet ont une priorité inférieure). */
.leo-pdv__dept {
  fill: rgba(22, 37, 63, 0.06);
  stroke: rgba(22, 37, 63, 0.3);
  stroke-width: 1px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.4s ease, stroke 0.4s ease;
}

.leo-pdv__dept:hover {
  fill: rgba(22, 37, 63, 0.1);
}

.leo-pdv__dept.is-active {
  fill: rgba(255, 251, 244, 0.72);
  stroke: var(--leo-navy);
  stroke-width: 1.6px;
  cursor: default;
  filter: drop-shadow(0 10px 14px rgba(22, 37, 63, 0.18));
}

/* Villes repères */
.leo-pdv .leo-pdv__city {
  background: transparent;
  border: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.leo-pdv .leo-pdv__city.is-hidden {
  opacity: 0;
}

/* Ville avec revendeur : nom décalé pour rester lisible à côté de la pastille. */
.leo-pdv__city.is-priority .leo-pdv__city-dot {
  display: none;
}

.leo-pdv__city.is-priority .leo-pdv__city-name {
  left: 16px;
  opacity: 0.95;
}

.leo-pdv__city-dot {
  position: absolute;
  left: -2.5px;
  top: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--leo-navy);
  opacity: 0.55;
}

.leo-pdv__city-name {
  position: absolute;
  left: 8px;
  top: -10px;
  white-space: nowrap;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 12.5px;
  color: var(--leo-navy);
  opacity: 0.75;
  text-shadow: 0 0 3px var(--leo-cream), 0 0 6px var(--leo-cream), 0 0 10px var(--leo-cream);
}

/* Marqueurs : un point par revendeur. */
.leo-pdv .leo-pdv__marker {
  background: transparent;
  border: 0;
  outline: 0;
}

.leo-pdv__pin {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--leo-navy);
  border: 2px solid var(--leo-cream);
  box-shadow: 0 6px 12px -4px rgba(22, 37, 63, 0.55), 0 0 0 1px rgba(22, 37, 63, 0.25);
  transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--s, 1));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.leo-pdv__pin::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--leo-gold);
  transition: background 0.25s ease;
}

.leo-pdv__marker:hover .leo-pdv__pin,
.leo-pdv__marker:focus-visible .leo-pdv__pin {
  --s: 1.15;
}

.leo-pdv__marker.is-active .leo-pdv__pin {
  --s: 1.3;
  background: var(--leo-gold);
  animation: leo-pdv-pulse 2.2s ease-out infinite;
}

.leo-pdv__marker.is-active .leo-pdv__pin::after {
  background: var(--leo-cream);
}

.leo-pdv__marker:focus-visible {
  outline: 2px solid var(--leo-gold);
  outline-offset: 4px;
  border-radius: 50%;
}

@keyframes leo-pdv-pulse {
  0% {
    box-shadow: 0 6px 12px -4px rgba(22, 37, 63, 0.55), 0 0 0 0 rgba(176, 141, 87, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 6px 12px -4px rgba(22, 37, 63, 0.55), 0 0 0 14px rgba(176, 141, 87, 0);
  }
}

/* Position réelle (point d'ancrage + fil) quand une pastille est déplacée en éventail. */
.leo-pdv__anchor {
  position: absolute;
  left: 11px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--leo-navy);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.leo-pdv__leader {
  position: absolute;
  left: 14px;
  top: 14px;
  width: var(--len, 0px);
  height: 1px;
  background: rgba(22, 37, 63, 0.45);
  transform-origin: 0 50%;
  transform: rotate(var(--ang, 0deg));
  opacity: 0;
  transition: opacity 0.3s ease, width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.leo-pdv__marker.is-fanned .leo-pdv__anchor,
.leo-pdv__marker.is-fanned .leo-pdv__leader {
  opacity: 1;
}

.leo-pdv__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  padding: 0.32rem 0.85rem;
  border-radius: 100px;
  background: var(--leo-navy);
  color: var(--leo-cream);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.leo-pdv__marker:hover .leo-pdv__label,
.leo-pdv__marker:focus-visible .leo-pdv__label,
.leo-pdv__marker.is-active .leo-pdv__label {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------------ Liste */

.leo-pdv__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--leo-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: var(--leo-glass-border);
  border-radius: var(--leo-radius);
  box-shadow: var(--leo-shadow);
}

@media (min-width: 768px) {
  .leo-pdv__panel {
    /* Même hauteur que la carte : la liste défile à l'intérieur du panneau. */
    height: 100%;
  }
}

.leo-pdv__head {
  flex: 0 0 auto;
  padding: 1.5rem 1.75rem 1.1rem;
  border-bottom: 1px solid var(--leo-line);
}

.leo-pdv__title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leo-navy);
}

.leo-pdv__dot {
  color: var(--leo-gold);
}

.leo-pdv__count {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  opacity: 0.7;
}

.leo-pdv__list {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 37, 63, 0.25) transparent;
}

.leo-pdv__list[hidden] {
  display: none;
}

.leo-pdv__item {
  position: relative;
  border-bottom: 1px solid var(--leo-line);
  transition: background 0.25s ease;
}

.leo-pdv__item:last-child {
  border-bottom: 0;
}

.leo-pdv__item::before {
  /* Repère or du revendeur sélectionné. */
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--leo-gold);
  transform: scaleY(0);
  transition: transform 0.25s ease;
}

.leo-pdv__item:hover {
  background: rgba(22, 37, 63, 0.035);
}

.leo-pdv__item.is-active {
  background: rgba(176, 141, 87, 0.14);
}

.leo-pdv__item.is-active::before {
  transform: scaleY(1);
}

.leo-pdv__item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.15rem 1.75rem;
  text-align: left;
  background: transparent;
  border: 0;
}

.leo-pdv__item-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.leo-pdv__kind {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leo-gold);
}

.leo-pdv__name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.25;
}

.leo-pdv__addr,
.leo-pdv__town {
  font-size: 0.95rem;
  opacity: 0.78;
}

.leo-pdv__arrow {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--leo-navy);
  opacity: 0.35;
  transition: transform 0.25s ease, opacity 0.25s ease, color 0.25s ease;
}

.leo-pdv__item-btn:hover .leo-pdv__arrow {
  opacity: 0.8;
  transform: translateX(3px);
}

.leo-pdv__item.is-active .leo-pdv__arrow {
  opacity: 1;
  color: var(--leo-gold);
  transform: translateX(3px);
}

/* Coordonnées : dépliées uniquement pour le revendeur sélectionné (liste épurée). */
.leo-pdv__more {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.3s ease, visibility 0s linear 0.3s;
}

.leo-pdv__item.is-active .leo-pdv__more {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.3s ease;
}

.leo-pdv__more-inner {
  min-height: 0;
  overflow: hidden;
}

.leo-pdv__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  padding: 0 1.75rem 1.15rem;
  font-size: 0.95rem;
}

.leo-pdv__contacts a {
  color: var(--leo-navy);
  text-decoration: underline;
  text-decoration-color: rgba(176, 141, 87, 0.7);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.leo-pdv__contacts a:hover {
  color: var(--leo-navy-light);
  text-decoration-color: var(--leo-gold);
}

.leo-pdv__empty {
  padding: 1.5rem 1.75rem;
  font-size: 0.95rem;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .leo-pdv *,
  .leo-pdv *::before,
  .leo-pdv *::after {
    animation: none !important;
    transition: none !important;
  }
}
