/* public/css/carte.css */
/* Styles de l'interface split-screen pour /carte/ */

.carte-app {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  height: calc(100vh - 12rem);
  min-height: 38rem;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--surface);
  margin-block: 1rem 2rem;
}

@media (min-width: 56rem) {
  .carte-app {
    grid-template-columns: 390px 1fr;
  }
}

.carte-volet {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--bordure);
  z-index: 5;
}

.carte-volet__header h1 {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.carte-recherche {
  display: grid;
  gap: 0.5rem;
}

.carte-recherche__barre {
  display: flex;
  gap: 0.5rem;
}

.carte-recherche__input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  font-size: 0.9rem;
}

.carte-geoloc-btn {
  padding: 0.5rem 0.75rem;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.carte-recherche__rayon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.carte-select-rayon {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--bordure);
  border-radius: 6px;
  background: var(--fond);
  color: var(--texte);
  font: inherit;
}

.carte-lien-effacer {
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  color: var(--texte-doux);
}

.carte-filtres-section {
  display: grid;
  gap: 0.35rem;
}

.carte-filtres-section__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.carte-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.carte-chips .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-pill);
  transition: 0.15s;
  white-space: nowrap;
}

.carte-chips .chip svg,
.carte-chips .chip .chip__icone {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  margin-top: -1px;
}

.carte-chips .chip:hover {
  border-color: var(--accent);
}

.carte-chips .chip--actif {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.carte-chips .chip--actif:hover {
  background: var(--accent);
  color: #fff;
}

.carte-compteur {
  font-size: 0.85rem;
  margin: 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--bordure);
}

.resultats-volet {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.resultat-item {
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--fond);
  transition: border-color 0.15s, background-color 0.15s;
}

.resultat-item:hover,
.resultat-item--actif {
  border-color: var(--accent);
  background: var(--vert-pale);
}

.resultat-item__lien {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
}

.resultat-item__ville {
  font-size: 0.78rem;
  color: var(--texte-doux);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.resultat-item__nom {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.25;
}

.resultat-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.resultat-item__date {
  color: var(--accent);
  font-weight: 600;
}

.resultat-item__distance {
  color: var(--texte-doux);
  font-weight: 500;
}

.carte-regions {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bordure);
}

.carte-regions__titre {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.carte-regions__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.carte-regions__lien {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--texte-doux);
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.carte-regions__lien:hover {
  color: var(--accent);
  background: var(--vert-pale);
}

.carte-panneau {
  position: relative;
  height: 100%;
  min-height: 300px;
}

.carte-panneau #carte {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

/* Bouton flottant de géolocalisation sur la carte */
.carte-fab-geoloc {
  position: absolute;
  bottom: 20px;
  left: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--texte);
  border: 1px solid var(--bordure);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.carte-fab-geoloc svg,
.carte-fab-geoloc .carte-fab-geoloc__icone {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: block;
}

.carte-fab-geoloc:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  border-color: var(--accent);
  color: var(--accent);
}

.carte-fab-geoloc:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carte-fab-geoloc:active {
  transform: scale(0.95);
}

/* État actif : position acquise / filtre de proximité actif */
.carte-fab-geoloc--actif {
  background: var(--vert, #0f5132);
  color: #fff;
  border-color: var(--vert, #0f5132);
  box-shadow: 0 3px 12px rgba(15, 81, 50, 0.35);
}

.carte-fab-geoloc--actif:hover {
  background: var(--vert-clair, #157347);
  border-color: var(--vert-clair, #157347);
  color: #fff;
}

/* État chargement : acquisition GPS en cours avec spin ou pulse discret */
.carte-fab-geoloc--chargement {
  cursor: wait;
  pointer-events: none;
  opacity: 0.9;
}

.carte-fab-geoloc--chargement svg,
.carte-fab-geoloc--chargement .carte-fab-geoloc__icone {
  animation: carte-fab-spin 1.1s linear infinite;
}

@keyframes carte-fab-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .carte-fab-geoloc--chargement svg,
  .carte-fab-geoloc--chargement .carte-fab-geoloc__icone {
    animation: carte-fab-pulse 1.3s ease-in-out infinite;
  }
  @keyframes carte-fab-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }
}

.carte-toggle-mobile {
  display: none;
}

.carte-toggle-mobile svg,
.carte-toggle-mobile .carte-toggle-mobile__icone {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 55.99rem) {
  .carte-app {
    height: calc(100vh - 8rem);
    position: relative;
  }
  .carte-volet {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 10;
  }
  .carte-app--vue-liste .carte-volet {
    display: flex;
  }
  .carte-toggle-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    min-height: 44px;
    padding: 0.55rem 1.25rem;
    background: var(--accent, #0f5132);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: var(--rayon-pill);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .carte-toggle-mobile:hover,
  .carte-toggle-mobile:focus-visible {
    background: var(--vert-clair, #157347);
    transform: translateX(-50%) scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
  .carte-toggle-mobile:active {
    transform: translateX(-50%) scale(0.97);
  }
  .carte-fab-geoloc {
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
  }
  .carte-app--vue-liste .carte-fab-geoloc {
    display: none;
  }
}
