/* --- Conteneur principal --- */
.mova-sl-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  /* CRUCIAL : On retire la hauteur fixe et on permet aux enfants de s'aligner en haut pour que le "sticky" fonctionne */
  align-items: flex-start;
}

/* --- Colonne de gauche (Sidebar qui défile naturellement) --- */
.mova-sl-sidebar {
  width: 40%;
  display: flex;
  flex-direction: column;
  background: #fcfcfc;
}

/* Zone de filtres */
.mova-sl-filters {
  padding: 25px 20px;
  background: #f8f9fa;
  /* background: #cd9b70; */
  border-bottom: 1px solid #eaeaea;
  position: sticky;
  top: 100px;
  z-index: 10;
}

.mova-sl-filters h3 {
  margin: 0 0 15px 0;
  font-size: 1.25rem;
  font-family: "AcuminPro", sans-serif;
}

.mova-sl-input-group {
  margin-bottom: 12px;
}

.mova-sl-input-group input,
.mova-sl-input-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 0px;
  font-size: 0.875rem;
  font-family: "AcuminPro", sans-serif;
  line-height: 1.2;
  outline: none;
  transition: border-color 0.3s;
  color: #1a4759;
}

.mova-sl-input-group input:focus,
.mova-sl-input-group select:focus {
  border-color: #1a4759;
}

.mova-sl-input-group select {
  appearance: none;
  background: url("../images/chevron-down-solid-full.svg") no-repeat right 16px
    center;
  background-size: 16px;
}

/* La liste (Conteneur des sections par province) */
.mova-sl-list {
  padding: 15px;
  background: #fcfcfc;
}

/* Section par province */
.mova-sl-province-section {
  margin-bottom: 20px;
}

.mova-sl-province-title {
  font-family: "AcuminPro";
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a4759;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
}

.mova-sl-province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.mova-sl-item {
  font-family: "AcuminPro", sans-serif;
  background: #f1f5f7;
  color: #1a4759;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.mova-sl-item:hover {
  /* transform: translateY(-4px); */
  outline: 1px solid #1a4759;
}

.mova-sl-item.active {
  /* border: 2px solid #1a4759; */
  background: #1a4759;
  box-shadow: 0 4px 15px rgba(0, 86, 179, 0.15);
  color: #fff;
}

.mova-sl-item.active h5 {
  color: #fff;
}

.mova-sl-item.active p {
  color: #ddd;
}

.mova-sl-item.active i {
  color: #fff;
}

.mova-sl-item.active .mova-sl-number {
  background: #fff;
  color: #1a4759;
}

.mova-sl-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.mova-sl-item h5 {
  font-family: "AcuminPro", sans-serif;
}

.mova-sl-number {
  font-family: "AcuminPro", sans-serif;
  background: #1a4759;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.mova-sl-number span {
  transform: rotate(45deg);
  line-height: 1;
}

.mova-sl-item h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.mova-sl-item a, .mova-sl-item a:hover {
  color: inherit;
  text-decoration: none;
}

.mova-sl-item .store-tel {
  font-weight: 600;
}

.mova-sl-item .store-site a {
  font-size: 0.825rem;
  text-decoration: underline;
}

.mova-sl-item .store-direction a {
  font-size: 0.825rem;
  text-decoration: underline;
}

.mova-sl-item p {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  /* color: #555; */
}

.mova-sl-item i {
  color: #1a4759;
  width: 16px;
  text-align: center;
  margin-right: 5px;
}

.mova-sl-item .store-distance {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a4759;
  opacity: 0.7;
  align-self: flex-end;
}

.mova-sl-item.active .store-distance {
  color: #fff;
  opacity: 0.85;
}

/* Bouton "Voir la fiche" */
.store-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 10px;
  font-family: "AcuminPro", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a4759;
  text-decoration: none;
  transition: color 0.2s ease;
}

.store-detail-btn:hover {
  text-decoration: underline;
}

.mova-sl-item.active .store-detail-btn {
  color: #fff;
}

/* --- Colonne de droite (La Carte Fixée) --- */
.mova-sl-map-wrap {
  width: calc(60% - 20px);

  /* La Magie est ici : Fixe la carte à l'écran */
  position: sticky;
  top: 135px;
  height: calc(
    75vh - 40px
  ); /* La carte prend la hauteur de l'écran moins les marges */
  min-height: 500px; /* Sécurité pour les tout petits écrans */

  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e5e5;
}

#mova-sl-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- Design des marqueurs pin sur la carte --- */
.custom-div-icon {
  background: transparent;
  border: none;
}
.mova-marker-pin {
  position: relative;
  background: #1a4759;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}
.mova-marker-pin span {
  transform: rotate(45deg);
  font-family: "AcuminPro", sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
.mova-marker-pin::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #1a4759;
  opacity: 0;
}
.mova-marker-pin:hover {
  transform: rotate(-45deg) scale(1.15);
  background: #0b1e26;
  z-index: 1000;
}
.mova-marker-pin:hover::after {
  background: #0b1e26;
}

/* --- Clusters de marqueurs --- */
.mova-cluster {
  background: transparent;
}

.mova-cluster-icon {
  background: #9c6d61;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding-top: 4px;
  padding-left: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "AcuminPro", sans-serif;
  font-weight: 700;
  font-size: 14px;
  box-shadow:
    0 0 0 4px rgba(156, 109, 97, 0.4),
    0 0 0 8px rgba(156, 109, 97, 0.15),
    0 3px 10px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.3s ease;
}

.mova-cluster-icon:hover {
  box-shadow:
    0 0 0 6px rgba(156, 109, 97, 0.5),
    0 0 0 12px rgba(156, 109, 97, 0.25),
    0 0 0 18px rgba(156, 109, 97, 0.1),
    0 3px 10px rgba(0, 0, 0, 0.35);
}

/* --- Style de la bulle d'info (Popup Leaflet) --- */
/* .leaflet-popup {
  bottom: 19px !important;
} */

.leaflet-popup-content-wrapper {
  border-radius: 0px !important;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  font-family: "AcuminPro", sans-serif;
  padding: 1rem 0.5rem;
  color: #1a4759;
}

.leaflet-popup-close-button {
  width: 24px !important;
  height: 24px !important;
  font-size: 0 !important;
  color: transparent !important;
  top: 6px !important;
  right: 6px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: none !important;
  border: none !important;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.leaflet-popup-close-button:hover {
  opacity: 1;
}

.leaflet-popup-close-button::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M12 4L4 12M4 4l8 8' stroke='%231a4759' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px 16px;
}
.mova-map-popup h5 {
  margin: 0 0 8px 0;
  font-family: "AcuminPro", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1a4759;
}
.mova-map-popup p {
  margin: 0 0 12px 0;
  font-size: 0.875rem;
  line-height: 1.5;
}
.mova-map-popup a.btn-itineraire {
  display: block;
  text-align: center;
  background: #ffffff00;
  border: 1px solid #1a4759;
  color: #1a4759;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}
.mova-map-popup a.btn-itineraire:hover {
  background: #1a4759;
  color: #fff;
}

/* --- Skeleton loader --- */
.mova-sl-skeleton {
  pointer-events: none;
  cursor: default;
}
.mova-skel-circle {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  background: #dfe3e6;
  flex-shrink: 0;
  animation: movaSkeletonPulse 1.2s ease-in-out infinite;
}
.mova-skel-line {
  display: block;
  height: 12px;
  border-radius: 4px;
  background: #dfe3e6;
  margin-bottom: 8px;
  animation: movaSkeletonPulse 1.2s ease-in-out infinite;
}
@keyframes movaSkeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Responsive --- */
@media (max-width: 992px) {
  /* Sur mobile, on inverse l'ordre pour avoir la carte en haut */
  .mova-sl-container {
    flex-direction: column-reverse;
  }
  .mova-sl-sidebar {
    width: 100%;
  }

  .mova-sl-filters {
    top: 85px;
  }

  .mova-sl-map-wrap {
    width: 100%;
    height: 50vh; /* La carte prend la moitié de l'écran sur mobile */
    position: relative; /* On désactive le sticky sur mobile car c'est gênant */
    top: 0;
  }
  .mova-sl-province-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Badge logo / initiales (sidebar) --- */
.mova-sl-logo-badge {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid #e0e4e7;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.mova-sl-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 2px;
}

.mova-sl-initiales {
  width: 100%;
  height: 100%;
  background: #1a4759;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "AcuminPro", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #fff;
}


.mova-sl-item.active .mova-sl-logo-badge {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.mova-sl-item.active .mova-sl-initiales {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* --- Marqueur logo circulaire (carte) --- */
.mova-marker-logo-pin {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.mova-marker-logo-inner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid #1a4759;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.mova-marker-logo-inner img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* --- Géolocalisation : bouton Me localiser --- */
#mova-sl-geolocate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: #1a4759;
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  font-family: "AcuminPro", sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

#mova-sl-geolocate:hover {
  background: #163d4d;
}

#mova-sl-geolocate:disabled,
#mova-sl-geolocate.loading {
  opacity: 0.65;
  cursor: wait;
}

#mova-sl-geolocate svg {
  flex-shrink: 0;
}

#mova-sl-geolocate.loading svg {
  animation: mova-spin 1s linear infinite;
}

@keyframes mova-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
