/* =========================================================
   Z2C-Map - Recherche BAN + dictionnaire + fiche sélectionnée
   Version UI renforcée : cadre visible + boutons rounded brandés
   ========================================================= */

:root {
  --z2c-pink: #f25583;
  --z2c-pink-rgb: 242, 85, 131;
  --z2c-green: #85a201;
  --z2c-green-rgb: 133, 162, 1;
}

.dico-placeholder {
  display: inline-block;
  font-size: 0.9rem;
  opacity: 0.72;
  padding: 0.35rem 0;
}

/* ---------- Listing BAN : même rendu que listing.php ---------- */

.suggestions-list {
  display: grid;
  gap: 0.65rem;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.suggestion-result {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  background: rgba(14, 29, 43, 0.42);
  color: #fff;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.suggestion-result:hover,
.suggestion-result:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(var(--z2c-green-rgb), 0.78);
  background: rgba(14, 29, 43, 0.62);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  outline: none;
}

.suggestion-result-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
}

.suggestion-result-icon {
  flex: 0 0 auto;
  margin-top: 0.12rem;
  color: var(--z2c-green);
  font-size: 0.92rem;
}

.suggestion-result-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.suggestion-result-title {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.28;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.suggestion-result-details {
  display: block;
  margin-top: 0.28rem;
  padding-left: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  opacity: 1;
}

.suggestion-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
  max-width: 42%;
}

.suggestion-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  font-size: 0.64rem;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.suggestion-badge-source {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
}

.suggestion-badge-source.is-z2c {
  background: var(--z2c-green);
  color: #fff;
}

.suggestion-badge-source.is-ban {
  background: var(--bs-primary);
  color: #fff;
}

.suggestion-badge-type {
  border: 1px solid rgba(var(--z2c-pink-rgb), 0.78);
  color: var(--z2c-pink);
  background: rgba(var(--z2c-pink-rgb), 0.04);
}

.suggestion-info-inline {
  color: var(--z2c-pink);
  font-weight: 600;
}

.suggestion-placeholder {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(14, 29, 43, 0.34);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

@media (max-width: 575.98px) {
  .suggestions-list {
    gap: 0.5rem;
  }

  .suggestion-result {
    padding: 0.76rem 0.78rem;
    border-radius: 0.9rem;
  }

  .suggestion-result-main {
    gap: 0.45rem;
  }

  .suggestion-result-title {
    font-size: 0.86rem;
  }

  .suggestion-result-details {
    font-size: 0.72rem;
  }

  .suggestion-badges {
    gap: 0.22rem;
    max-width: 40%;
  }

  .suggestion-badge {
    padding: 0.16rem 0.4rem;
    font-size: 0.59rem;
  }

  .search-form .search-zone-display {
    flex: 0 0 64px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    padding: 0;
    justify-content: center;
  }
}


/* ---------- Adresse sélectionnée ---------- */

.selected-address {
  margin-top: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 1.4rem;
  background: rgba(14, 29, 43, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.selected-address-check {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  color: #ffffff;
}

.selected-address-label {
  margin-bottom: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  color: #fff;
  text-align: center;
}

.min-w-0 {
  min-width: 0;
}

/*
 * Bootstrap gère :
 * - 2 boutons par ligne sur mobile : col-6
 * - 4 boutons par ligne dès md : col-md-3
 */
.address-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 40px;
  padding: 0.46rem 0.7rem;
  font-size: 0.79rem;
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.02);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.address-action-btn i {
  font-size: 0.92rem;
}

.address-action-btn:hover,
.address-action-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

/* Couleurs de marque par bouton principal */
#btn-share-address,
#btn-route {
  color: var(--z2c-pink);
  border-color: rgba(var(--z2c-pink-rgb), 0.95);
  box-shadow: inset 0 0 0 1px rgba(var(--z2c-pink-rgb), 0.18);
}

#btn-share-address:hover,
#btn-share-address:focus-visible,
#btn-route:hover,
#btn-route:focus-visible {
  color: #fff;
  background: rgba(var(--z2c-pink-rgb), 0.18);
  border-color: var(--z2c-pink);
}

#btn-plan,
#btn-guidance {
  color: var(--z2c-green);
  border-color: rgba(var(--z2c-green-rgb), 0.95);
  box-shadow: inset 0 0 0 1px rgba(var(--z2c-green-rgb), 0.16);
}

#btn-plan:hover,
#btn-plan:focus-visible,
#btn-guidance:hover,
#btn-guidance:focus-visible {
  color: #fff;
  background: rgba(var(--z2c-green-rgb), 0.18);
  border-color: var(--z2c-green);
}

/* Choix du GPS */

.guidance-options-row {
  margin-top: 0.15rem;
}

.guidance-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.42rem 0.55rem;
  font-size: 0.77rem;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 999px !important;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.guidance-btn i {
  font-size: 0.9rem;
}

.guidance-btn:hover,
.guidance-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
  text-decoration: none;
  outline: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* Améliore visuellement le petit titre de statut */
#suggestions-count {
  opacity: 0.92;
}

/* ---------- Mobile ---------- */

@media (max-width: 575.98px) {
  .suggestion-result {
    padding: 0.72rem 0.7rem;
  }

  .suggestion-result-details {
    padding-left: 1.45rem;
  }

  .selected-address {
    padding: 0.8rem 0.75rem;
    border-radius: 1.15rem;
  }

  .selected-address-label {
    text-align: left;
    font-size: 0.98rem;
  }

  .address-action-btn,
  .guidance-btn {
    min-height: 40px;
    font-size: 0.79rem;
    padding: 0.48rem 0.45rem;
  }
}


/* =========================================================
   PLAN Z2C-MAP / MAPBOX
   Plan = point d'arrivée uniquement, sans trajet.
   ========================================================= */

.z2c-plan-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 1.4rem;
  background: rgba(14, 29, 43, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.z2c-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.z2c-plan-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.z2c-plan-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(var(--z2c-green-rgb), 0.9);
  border-radius: 999px;
  color: var(--z2c-green);
  background: rgba(var(--z2c-green-rgb), 0.08);
}

.z2c-plan-kicker {
  color: var(--z2c-green);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.z2c-plan-address {
  margin-top: 0.08rem;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.z2c-plan-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(var(--z2c-pink-rgb), 0.9);
  border-radius: 999px;
  color: var(--z2c-pink);
  background: rgba(var(--z2c-pink-rgb), 0.05);
}

.z2c-plan-close:hover,
.z2c-plan-close:focus-visible {
  color: #fff;
  border-color: var(--z2c-pink);
  background: rgba(var(--z2c-pink-rgb), 0.18);
  outline: none;
}

.z2c-map-wrap {
  position: relative;
  min-height: 390px;
  background: rgba(0, 0, 0, 0.12);
}

#z2c-map {
  width: 100%;
  height: 390px;
}

.z2c-plan-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--z2c-pink);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
  transform: rotate(-45deg);
}

.z2c-plan-marker::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}

.z2c-map-status {
  margin: 0.75rem 0.9rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(var(--z2c-pink-rgb), 0.45);
  border-radius: 0.85rem;
  color: #fff;
  background: rgba(var(--z2c-pink-rgb), 0.10);
  font-size: 0.84rem;
}

.z2c-plan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.62rem 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
}

.z2c-plan-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.z2c-plan-footer i {
  color: var(--z2c-pink);
}

.z2c-plan-footer small {
  color: rgba(255, 255, 255, 0.66);
}

/* Mapbox : arrondis gérés par le cadre Z2C */
.z2c-plan-card .mapboxgl-canvas {
  outline: none;
}

.z2c-plan-card .mapboxgl-ctrl-group {
  overflow: hidden;
  border-radius: 0.7rem;
}

.z2c-plan-card .mapboxgl-popup-content {
  border-radius: 0.9rem;
  color: #17202a;
  font-size: 0.84rem;
  line-height: 1.3;
}

@media (max-width: 575.98px) {
  .z2c-plan-card {
    border-radius: 1.15rem;
  }

  .z2c-plan-head {
    padding: 0.72rem 0.75rem;
  }

  .z2c-map-wrap {
    min-height: 310px;
  }

  #z2c-map {
    height: 310px;
  }

  .z2c-plan-address {
    font-size: 0.86rem;
  }

  .z2c-plan-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.55rem 0.75rem;
  }
}


/* =========================================================
   BOUTON PLAN / SATELLITE
   ========================================================= */

.z2c-plan-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.z2c-map-style-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.35rem 0.72rem;
  border: 1px solid rgba(var(--z2c-green-rgb), 0.95);
  border-radius: 999px;
  color: var(--z2c-green);
  background: rgba(var(--z2c-green-rgb), 0.07);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.z2c-map-style-btn:hover,
.z2c-map-style-btn:focus-visible,
.z2c-map-style-btn[aria-pressed="true"] {
  color: #fff;
  border-color: var(--z2c-green);
  background: rgba(var(--z2c-green-rgb), 0.20);
  outline: none;
}

.z2c-map-style-btn i {
  font-size: 0.9rem;
}


/* =========================================================
   ITINERAIRE - ajout sur la carte Plan existante
   ========================================================= */

.z2c-route-start-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #85a201;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28);
}

.z2c-route-start-marker::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
}


/* =========================================================
   BOUTON REINITIALISER - INDEX
   ========================================================= */

.suggestions-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.btn-reset-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  padding: 0.24rem 0.58rem;
  border: 1px solid rgba(var(--z2c-pink-rgb), 0.82);
  border-radius: 999px;
  background: transparent;
  color: var(--z2c-pink);
  font-size: 0.68rem;
  line-height: 1.2;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

.btn-reset-search:hover,
.btn-reset-search:focus-visible {
  background: var(--z2c-pink);
  border-color: var(--z2c-pink);
  color: #fff;
  outline: none;
}

@media (max-width: 575.98px) {

  .suggestions-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 0.4rem;
  }

  .suggestions-head > span {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.78rem;
  }

  .suggestions-head-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem;
    margin-left: auto;
  }

  #suggestions-count {
    white-space: nowrap;
    font-size: 0.62rem;
  }

  .btn-reset-search {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    font-size: 0.64rem;
  }
}

/* =========================================================
   DICO - suggestions
   ========================================================= */

.dico-chip {
  border-color: var(--z2c-pink);
  color: #fff;
  background: rgba(0, 0, 0, 0.12);

  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.dico-chip:hover,
.dico-chip:focus-visible {
  border-color: var(--z2c-green);
  background: var(--z2c-green);
  color: #fff;
  outline: none;
}

/* =========================================================
   GUIDAGE - ETAT DE RECUPERATION POSITION
   ========================================================= */

.z2c-guidance-position-wait {
  color: var(--z2c-pink);
  font-weight: 600;
}

.btn-history-search.btn-add-place {
  border: 1px solid #b56ad9;
  color: #b56ad9;
}

.btn-history-search.btn-add-place:hover,
.btn-history-search.btn-add-place:focus-visible {
  background: #b56ad9;
  border-color: #b56ad9;
  color: #fff;
}


/* =========================================================
   ZONE DE RECHERCHE — SINGLE / MULTI
   Recherche rapide + Listing
   ========================================================= */

.search-form {
  padding-left: 5px;
  overflow: hidden;
}

.search-form .search-leading-icon {
  display: none;
}

.search-zone-wrap {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 14px;
  margin: -1px 10px -1px -1px;
  border-radius: 999px 0 0 999px;
  background: var(--z2c-pink, #f25583);
  color: #fff;
}

.search-zone-wrap > i {
  flex: 0 0 auto;
  font-size: 1rem;
}

/* Masque : Haute corse */
.search-zone-display .search-zone-name {
  display: none;
}

/* Single : texte fixe */
.search-zone-display {
  min-width: 70px;
  justify-content: flex-start;
  white-space: nowrap;
}

.search-zone-display .search-zone-code {
  font-size: .82rem;
  font-weight: 800;
}

.search-zone-display .search-zone-name {
  font-size: .78rem;
  font-weight: 700;
}

/* Multi : select */
.search-zone-select {
  width: 42px;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.search-zone-select option {
  color: #263847;
  background: #fff;
}

.search-form input[type="search"] {
  padding-left: 2px;
}

@media (max-width: 767.98px) {
  .search-zone-wrap {
    gap: 4px;
    padding-left: 10px;
    padding-right: 7px;
    margin-right: 7px;
  }

  .search-zone-display {
    min-width: 112px;
  }

  .search-zone-display .search-zone-code,
  .search-zone-display .search-zone-name,
  .search-zone-select {
    font-size: .74rem;
  }

  .search-zone-select {
    width: 112px;
  }

  .search-form input[type="search"] {
    font-size: .90rem;
    padding-right: 6px;
  }

  .search-submit {
    padding-left: 15px;
    padding-right: 15px;
  }

  .search-submit span {
    display: none;
  }
}

@media (max-width: 420px) {
  .search-zone-wrap > i {
    display: none;
  }

  .search-zone-wrap {
    padding-left: 9px;
  }

  .search-zone-display {
    min-width: 96px;
    gap: 3px;
  }

  .search-zone-display .search-zone-name {
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-zone-select {
    width: 96px;
    font-size: .71rem;
  }
}

/* hauteur d'affichage retour ancre sur selection adresse */
#selected-address {
  scroll-margin-top: 150px;
}
