:root {
  --lfce-brown: #40312c;
  --lfce-gold: #c99149;
  --lfce-map-bg: #e8e1d9;
  --lfce-card-bg: #ffffff;
  --lfce-text: #392a26;
  --lfce-muted: #746b66;
  --lfce-border: rgba(57, 42, 38, 0.10);
  --lfce-radius: 5px;
}

.lfce-map,
.lfce-map * {
  box-sizing: border-box;
}

.lfce-map {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--lfce-map-bg);
  color: var(--lfce-text);
}

.lfce-map__title {
  position: absolute;
  z-index: 4;
  top: clamp(28px, 6vw, 78px);
  left: clamp(24px, 7.8vw, 140px);
  margin: 0;
  max-width: 42%;
  font-size: clamp(28px, 2.7vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--lfce-text);
}

/* Zone d'affichage et conteneur de zoom */
.lfce-map__canvas {
  position: relative;
  width: 100%;
  aspect-ratio: var(--lfce-map-ratio, 16/9);
  overflow: hidden;
  line-height: 0;
  background: var(--lfce-map-bg);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.lfce-map__canvas.is-zoomed {
  touch-action: none;
  cursor: grab;
}

.lfce-map__canvas.is-panning {
  cursor: grabbing;
}

/* Scène transformée par le JS */
.lfce-map__stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.lfce-map__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Marqueurs */
.lfce-map__markers {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.lfce-marker {
  --marker-color: var(--lfce-brown);
  position: absolute;
  left: var(--lfce-x);
  top: var(--lfce-y);
  width: clamp(18px, 1.35vw, 25px);
  height: clamp(18px, 1.35vw, 25px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  /* Annule le zoom parent pour garder une taille constante */
  transform: translate(-50%, -50%) scale(calc(1 / var(--lfce-zoom, 1)));
  transform-origin: center center;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  line-height: 1;
  z-index: 1;
}

.lfce-marker--priority {
  --marker-color: var(--lfce-gold);
}

.lfce-marker--existing {
  --marker-color: var(--lfce-brown);
}

.lfce-marker__dot {
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .92),
    0 0 0 4px color-mix(in srgb, var(--marker-color) 22%, transparent);
  transition: transform .18s ease, box-shadow .18s ease;
}

.lfce-marker:hover .lfce-marker__dot,
.lfce-marker:focus-visible .lfce-marker__dot,
.lfce-marker.is-active .lfce-marker__dot {
  transform: scale(1.22);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .95),
    0 0 0 6px color-mix(in srgb, var(--marker-color) 28%, transparent);
}

.lfce-marker:focus-visible {
  outline: 2px solid var(--marker-color);
  outline-offset: 5px;
}

.lfce-marker__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 5px);
  min-width: max-content;
  max-width: 180px;
  padding: 8px 11px;
  border-radius: 3px;
  background: var(--lfce-text);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  white-space: nowrap;
}

.lfce-marker__tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--lfce-text);
}

.lfce-marker:hover .lfce-marker__tooltip,
.lfce-marker:focus-visible .lfce-marker__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Boutons de contrôle du Zoom */
.lfce-zoom-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 6;
}

.lfce-zoom-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--lfce-border);
  border-radius: var(--lfce-radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(47, 39, 34, 0.08);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  color: var(--lfce-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.lfce-zoom-btn:hover,
.lfce-zoom-btn:focus-visible {
  background: #ffffff;
  transform: scale(1.04);
}

.lfce-zoom-btn:focus-visible {
  outline: 2px solid var(--lfce-gold);
  outline-offset: 2px;
}

/* Panneau latéral / Slider */
.lfce-map__panel {
  position: absolute;
  z-index: 5;
  top: 6%;
  right: clamp(24px, 7.5vw, 130px);
  bottom: 6%;
  width: clamp(290px, 23vw, 370px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lfce-slider {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  padding: 0 5px 0 0;
}

.lfce-slider::-webkit-scrollbar {
  display: none;
}

.lfce-card {
  scroll-snap-align: start;
  min-height: 145px;
  margin: 0 0 18px;
  padding: clamp(22px, 2vw, 32px);
  border: 1px solid var(--lfce-border);
  border-radius: var(--lfce-radius);
  background: var(--lfce-card-bg);
  box-shadow: 0 8px 26px rgba(47, 39, 34, 0.04);
  opacity: .82;
  transform: scale(.985);
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}

.lfce-card:last-child {
  margin-bottom: 0;
}

.lfce-card.is-active,
.lfce-card:hover,
.lfce-card:focus-visible {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 12px 34px rgba(47, 39, 34, 0.08);
}

.lfce-card:focus-visible {
  outline: 2px solid var(--lfce-gold);
  outline-offset: 2px;
}

.lfce-card__title {
  margin: 0 0 18px;
  font-size: clamp(23px, 1.55vw, 31px);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--lfce-text);
}

.lfce-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 5px;
  background: #f3ede6;
  color: var(--lfce-brown);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.lfce-card--priority .lfce-card__badge {
  color: var(--lfce-gold);
}

.lfce-card__badge-icon {
  flex: 0 0 auto;
  line-height: 1;
}

.lfce-card__address,
.lfce-card__description {
  margin: 14px 0 0;
  color: var(--lfce-muted);
  font-size: 14px;
  line-height: 1.45;
}

.lfce-card__link {
  display: inline-block;
  margin-top: 15px;
  color: var(--lfce-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lfce-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.lfce-nav__button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--lfce-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--lfce-text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.lfce-nav__button:hover,
.lfce-nav__button:focus-visible {
  background: #fff;
}

.lfce-nav__button:focus-visible {
  outline: 2px solid var(--lfce-gold);
  outline-offset: 2px;
}

.lfce-nav__counter {
  min-width: 45px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.lfce-admin-warning {
  padding: 14px 16px;
  border-left: 4px solid #dba617;
  background: #fff8df;
  color: #382f26;
}

/* Responsivité */
@media (min-width: 981px) {
  .lfce-map__canvas {
    max-height: 80vh;
  }
}

@media (max-width: 1100px) {
  .lfce-map__panel {
    right: 3.5vw;
    width: clamp(270px, 28vw, 320px);
  }

  .lfce-map__title {
    left: 4vw;
    max-width: 40%;
  }
}

@media (max-width: 980px) {
  .lfce-map {
    overflow: visible;
    background: transparent;
  }

  .lfce-map__title {
    position: static;
    max-width: none;
    margin: 0 0 22px;
    padding: 0;
    font-size: clamp(28px, 5vw, 42px);
  }

  .lfce-map__canvas {
    overflow: hidden; /* Maintient le zoom dans les limites de la boîte */
    border-radius: var(--lfce-radius);
    box-shadow: 0 6px 20px rgba(47, 39, 34, 0.06);
  }

  .lfce-map__panel {
    position: static;
    width: 100%;
    margin-top: 18px;
    display: block;
  }

  .lfce-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 0 1px 8px;
    scrollbar-width: none;
  }

  .lfce-card {
    flex: 0 0 min(78vw, 360px);
    min-height: 0;
    margin: 0;
    scroll-snap-align: center;
  }

  .lfce-nav {
    justify-content: center;
    margin-top: 10px;
  }
}

@media (max-width: 640px) {
  .lfce-map__title {
    margin-bottom: 16px;
    font-size: clamp(25px, 8vw, 34px);
  }

  .lfce-marker {
    width: 22px;
    height: 22px;
  }

  .lfce-marker__tooltip {
    font-size: 11px;
    padding: 7px 9px;
  }

  .lfce-card {
    flex-basis: min(84vw, 330px);
    padding: 22px;
  }

  .lfce-card__title {
    font-size: 24px;
  }

  .lfce-card__badge {
    font-size: 11px;
    padding: 9px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lfce-marker__dot,
  .lfce-marker__tooltip,
  .lfce-card,
  .lfce-map__stage {
    transition: none;
  }
}