
/* Reset de base */
#map {
    position: relative;
    height: 31.25rem;            /* 500px */
    border: 0.0625rem solid blue; /* 1px */
    border-radius: 0.3125rem;     /* 5px */
    margin: 0.3125rem 0.25rem;    /* 5px 4px */
    padding: 0;
}

/* Panneau des catégories */
#categoryPanel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;               /* 6px */
    align-items: flex-start;
    border: 0.0625rem solid blue; /* 1px */
    border-radius: 0.3125rem;     /* 5px */
    margin: 0.3125rem 0.25rem;    /* 5px 4px */
    font-weight: bold;
    font-size: 0.875rem;          /* 14px */
    color: rgb(126, 160, 205);
    padding: 0.25rem;             /* 4px */
}

.category-icon {
    width: 1.25rem;              /* 20px */
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 1.25rem;              /* 20px */
    height: 1.25rem;
}

.feature-item .label,
.parcours-item .label {
    color: rgb(90, 120, 165);
    margin-right: 0.25rem;       /* 4px */
}

/* Item de catégorie */
.category-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.125rem 0.25rem;   /* 2px 4px */
    border-radius: 0.1875rem;    /* 3px */
}

/* Catégorie active */
.category-item.active {
    color: #ff1744;
    font-style: italic;
    font-weight: bolder;
    font-size: 0.9375rem;        /* 15px */
}

/* Survol */
.category-item:hover {
    background: rgba(0,0,0,0.05);
}

.feature-item,
.parcours-item {
    position: relative;
}

/* Tooltip custom */
.feature-item:hover::after,
.parcours-item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.25rem;         /* 4px */
    background: #fff;
    color: #222;
    padding: 0.375rem 0.625rem;  /* 6px 10px */
    border-radius: 0.25rem;      /* 4px */
    font-size: 0.8125rem;        /* 13px */
    white-space: nowrap;
    box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.25); /* 2px 6px */
    z-index: 9999;
}

.flag-icon {
    height: 0.9375rem;           /* 15px */
    vertical-align: middle;
    margin-right: 0.0625rem;     /* 1px */
}

/* Compensation du padding interne des drapeaux 4:3 */
.flag-icon[src*="fr.svg"],
.flag-icon[src*="es.svg"],
.flag-icon[src*="ad.svg"] {
    transform: scale(1.15);
}

.marker-parcours {
    width: 1.125rem;             /* 18px */
    height: 1.125rem;
    border-radius: 50%;
    background: #ff0000;
    border: 0.125rem solid #ffffff; /* 2px */
}

/* Liste des lieux */
#place-list {
    border: 0.0625rem solid blue; /* 1px */
    border-radius: 0.3125rem;     /* 5px */
    margin: 0.3125rem 0.25rem;    /* 5px 4px */
    min-height: 0.625rem;         /* 10px */
    max-height: 5rem;             /* 80px */
    overflow-y: auto;
    padding: 0.25rem;             /* 4px */
}

/* Liste des features */
#featureList {
    font-size: 0.875rem;          /* 14px */
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;                 /* 4px */
    list-style: none;
    padding: 0;
    margin: 0;
}

#featureList li {
    cursor: pointer;
    padding: 0.125rem 0.375rem;   /* 2px 6px */
    color: #333;
    display: inline-block;
    white-space: nowrap;
    border-radius: 0.25rem;       /* 4px */
    transition: background-color 0.2s ease;
}

#featureList li:hover {
    background-color: #f0f0f0;
}

/* Boutons centraux sur carte */
#searchGroup {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;              /* wrap naturel */
    gap: 0.625rem;                /* 10px */
    margin: 0.5rem auto;
    width: 50rem;                 /* 🔥 largeur PC → input + reset tiennent */
    max-width: 100%;              /* 🔥 mobile → wrap */
}

#F {
    padding: 0.20rem;
    width: 13rem;               /* 🔥 largeur mini PC ≈ 128px */
    max-width: 100%;
    font-size: 0.875rem;
    font-weight: 600;
    color: blue;
    border-radius: 0.3125rem;
    border: 0.125rem solid blue;
    background-color: white;
}

/* Placeholder */
#F::placeholder {
    color: blue;
    font-size: 0.875rem;           /* 14px */
    font-style: italic;
    font-weight: 600;
}

#resetMap, .trafic {
    padding: 0.205rem;
    width: 13rem;               /* 🔥 EXACTEMENT la même largeur que #F */
    max-width: 100%;
    font-size: 0.875rem;
    font-weight: 600;
    font-style: italic;
    border-radius: 0.3125rem;
    border: 0.125rem solid blue;
    background-color: white;
    color: blue;
    cursor: pointer;
    white-space: nowrap;          /* 🔥 icône + texte sur une ligne */
}


/* ---- CONTENEUR GOOGLE MAPS ---- */
.custom-infowindow {
  background: #f8f8ff;
  padding: 0 !important;
  max-width: 250px;
  border-radius: 8px !important;
  border: 2px solid blue !important;
}

/* ---- BOÎTE GOOGLE MAPS ---- */
.custom-infowindow .gm-style-iw {
  overflow: visible !important;
  background: #f8f8ff;
  padding: 5px !important;
  width: auto !important;
  max-width: 250px !important;
  border: 2px solid blue !important;
  border-radius: 8px !important;
}

.gm-style-iw-chr {
  display: none !important;
}

.custom-infowindow .gm-style-iw-d {
  overflow: visible !important;
  padding-right: 0 !important;
  margin-right: 0 !important;
}
/* Force le conteneur natif de Google à ne plus gérer le scroll */
.gm-style .gm-style-iw-c div.gm-style-iw-d {
  overflow: unset !important; /* ou 'hidden' selon votre préférence */
}

/* Optionnel : Supprime le padding par défaut si l'espace persiste */
.gm-style .gm-style-iw-c {
  padding-right: 0 !important;
    border: 2px solid #0000ff !important; /* Mettez le bleu de votre choix */
  box-shadow: none !important; 
}

/* Change la couleur de la flèche (le pointeur du bas) */
.gm-style .gm-style-iw-t::after, 
.gm-style .gm-style-iw-tc::after {
  background: #007bff !important;
}

/* ---- CONTENU GLOBAL ---- */
.infowindow-content {
  padding: 0;
  max-width: 250px;
}
.gm-style .gm-style-iw-t::after {
  background: #007bff !important;
}

/* ---- HEADER FIXE ---- */
.infowindow-header-actions {
  display: flex;
  gap: 5px;
  justify-content: space-around;
  align-items: center;
  background: #f8f8ff;
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
}

.btn-fermer {
  font-size: 12px;
  color: red;
  background-color: white;
  border: 2px solid #007bff !important;
  padding: 2px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-deplacer {
  font-size: 12px;
  color: #007bff;
  background: none;
  border: 2px solid #007bff !important;
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
}

/* ---- ZONE SCROLLABLE ---- */
.infowindow-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 180px;
  margin-right: 0;
  padding-right: 0;
}

/* ---- TITRES ---- */
.infowindow-content > h2 {
  margin: 5px;
  font-size: 16px;
  color: red;
}

.infowindow-content h3 {
  margin: 5px;
  font-size: 12px;
  color: blue;
}

/* ---- COORDS ---- */
.infowindow-coords {
  font-size: 12px;
  font-weight: bold;
  color: red;
  margin: 4px 0;
  text-align: center;
}

.infowindow-pic {
  width: 228px !important;
  max-width: 228px !important;
  overflow: hidden;
}

/* ---- IMAGE ---- */
.infowindow-img,
.infowindow-image img {
  max-width: 228px !important;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 5px;
}

/* ---- PARAGRAPHES ---- */
.infowindow-content p {
  background-color: #f0f4ff;
  color: #333;
  padding: 4px;
  border-radius: 5px;
  font-size: 13px;
  margin: 5px 0;
}

/* ---- DRAPEAU ---- */
.flag-icon {
  width: 15px !important;
  border-radius: 0 !important;
}

#info-flag svg {
  width: 20px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

/* ---- INPUT ---- */
input[type="text"].inputdir {
  margin-top: 8px;
  color: blue !important;
  font-size: 13px !important;
  width: 200px !important;
  height: 20px !important;
}


/* ---- BOUTON ITINÉRAIRE ---- */
.itineraire-btn {
  font-size: 13px !important;
  color: blue;
  margin-top: 4px;
  border: none;
  background-color: white;
}

.infowindow-parcours-title {
  display: flex;
  justify-content: center;
  align-items: center;   /* aligne parfaitement icône + texte */
  gap: 8px;
  border-top: 1px solid #ccc;
  padding-top: 8px;
}

.parcours-title-icon {
  display: flex;
  align-items: center;   /* centre le SVG dans son wrapper */
}

.parcours-title-icon svg {
  height: 24px;          /* taille visible, pas minuscule */
  width: auto;
  display: block;        /* évite la descente sur la ligne de base */
  margin-top: -2px;      /* remonte légèrement pour un alignement parfait */
}

.infowindow-parcours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.btn-parcours {
  display:flex;
  align-items:center;
  font-size: 12px;
  border: 2px solid #007bff;
  border-radius: 4px;
  color: #007bff;
  cursor: pointer;  word-break: break-word; /* évite les débordements */
}


.access-selector {margin: 10px 0;}
.access-selector select {width: 100%;padding: 4px;}
/* Style pour les marqueurs personnalisés */
.rando-depart, .rando-passage {margin-top: 10px;}
.rando-depart ul, .rando-passage ul {padding-left: 20px;margin: 0;}
.rando-depart li, .rando-passage li {font-size: 0.9em;line-height: 1.4;}

.segments-visualisation {margin-top: 8px;text-align: center;font-size: 13px;font-weight: bold;}

/* A Voir*/
.segment-badge {
  display: inline-block;
  padding: 4px 8px;
  margin: 2px;
  border-radius: 6px;
  color: white;
}
.segment-walking {
  background-color: #4CAF50;
}
.segment-driving {
  background-color: #2196F3;
}
.segment-other {
  background-color: #9E9E9E; /* gris */
}
.segment-popup {
  max-width: 320px;
}
.seg-info {
  margin: 6px 0;
  color: #555;
  font-style: italic;
}
.segment-image {
  margin: 8px 0;
}

.seg-image {max-width: 100%;height: auto;border-radius: 4px;box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.seg-actions {
  text-align: right;
  margin-top: 8px;
}
.btn-fermer-seg {
  padding: 4px 8px;
  font-size: 12px;
}
#panel,
.infowindow-content {
  z-index: 1000 !important;
  position: relative;
}
.gm-style .gm-style-iw {
  z-index: 999 !important;
}

.popup-parcours {z-index: 2147483647 !important;max-width: 260px;max-height: 430px;pointer-events: auto !important;background: white;padding: 0;border: blue 2px solid;border-radius: 10px;box-shadow: 0 4px 20px rgba(0,0,0,0.25);width: calc(100% - 40px);color: #222;}

.pp-header {
  touch-action: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  user-select: none;
  cursor: grab;
}
.pp-header button {
  cursor: pointer;
}

.btn-deplacer-parcours, .pp-close {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 5px;
    border-radius: 6px;
    font-size: 12px;
}
.popup-parcours .pp-title-content .flag svg,
.popup-parcours .pp-title-content svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.popup-parcours .pp-title-content .flag,
.popup-parcours .pp-title-content img {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
}

.pp-segment-list li {
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
}

/* -------------------------------------------------------------
   Contenu interne
------------------------------------------------------------- */
.popup-parcours-inner {
    padding: 8px;
    max-height: 380px;
    overflow-y: auto;
}

/* -------------------------------------------------------------
   TITRE PARCOURS
------------------------------------------------------------- */
.pp-title {
    margin: 0;
    color:red;
    font-size: 16px;
    font-weight: bold;
      display: flex;
  align-items: center;
  gap: 6px;
}

.pp-meta p {
    margin: 4px 0;
    font-size: 13px;
}

.pp-recap-materiel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-align: center;
    margin: 4px 0;
    font-size: 14px;
    font-style: italic;
    font-weight: 800;
    color: blue;
    cursor: pointer;
}
/* -------------------------------------------------------------
   LISTE DES SEGMENTS
------------------------------------------------------------- */
.pp-segments-complet {margin-top: 2px;}
.pp-segments {margin-top: 2px;color: red;padding: 6px 4px;background-color: #f0f4ff;overflow-y: auto;}

.pp-segment-details {
    margin-top: 6px;
}
.pp-segment-item {
  display: flex;font-size: 13px;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

/* Style de base du bouton */
.pp-seg-toggle-btn {
  font-size: 11px;
  padding: 2px 6px;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  background: #1976d2; /* valeur par défaut */
  transition: background 0.2s ease;
}

/* Bouton bleu = AFFICHER */
.pp-seg-toggle-btn[data-visible="0"] {
  background: #1976d2;
}
.pp-seg-toggle-btn[data-visible="0"]:hover {
  background: #0d47a1;
}

/* Bouton rouge = MASQUER */
.pp-seg-toggle-btn[data-visible="1"] {
  background: #d9534f;
}
.pp-seg-toggle-btn[data-visible="1"]:hover {
  background: #c9302c;
}

/* Transition du nom */
.pp-seg-name {
  transition: color 0.2s ease;
}

.pp-segments strong {display: block;margin-bottom: 6px;color:blue;font-size: 14px;}
.pp-segment-list {list-style: none;padding: 0;margin: 0; font-size: 13px;}

.pp-segment-item:hover {
    background: #e9e9e9;
}

/* -------------------------------------------------------------
   DÉTAILS DU SEGMENT
------------------------------------------------------------- */
/* Titre du segment dans les détails */
.ps-detail h4 {margin: 0;font-size: 14px;}

/* Métadonnées (distance, durée, D+, D-) */
.ps-detail p {
    margin: 3px 0;
    font-size: 13px;
}
/* Conteneur des détails */
.ps-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Chaque ligne (2 éléments côte à côte) */
.ps-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Style des paragraphes */
.ps-detail-row p {
    margin: 0;
    font-size: 13px;
}
/* -------------------------------------------------------------
   Mode déplacement (optionnel)
------------------------------------------------------------- */
.popup-parcours.dragging {
    opacity: 0.85;
    cursor: grabbing;
}

.pp-seg-mat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-align: center;
    margin: 4px 0;
    font-size: 14px;
    font-style: italic;
    font-weight: 800;
    color: blue;
    cursor: pointer;
}

.souspopup {
    position: absolute;
    left: 50%;
    top: 140px;
    background: #fff;
    border-radius: 10px;
    max-width: 260px;
    max-height: 430px;
    overflow: hidden;
    z-index: 999999;
    display: flex;
    flex-direction: column;pointer-events: auto !important;padding: 0;
    border:blue 2px solid;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    width: calc(100% - 40px);
    color: #222;
}
.souspopup-header {
  touch-action: none;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 6px;
  user-select: none;
  cursor: grab;
}
.souspopup-header button {
  cursor: pointer;
}
.btn-deplacer-souspopup, .souspopup-close {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 5px;
    border-radius: 6px;
    font-size: 12px;
}

.souspopup-title {
    margin: 5px auto;
    color: #c00;
    font-size: 18px;
    font-weight: 600;
}

.souspopup-content {
    padding: 16px;
    overflow-y: auto;
}
.pack-block {
    margin-bottom: 18px;
}

.pack-block h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}

.pack-block p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    white-space: pre-line; /* pour respecter les retours ligne */
}

.hidden {
    display: none;
}
.custom-zoom-button { background-color: white; border: 2px solid #000; width: 30px; height: 30px; cursor: pointer; font-size: 18px; margin: 2px; text-align: center; line-height: 26px; } 
.custom-zoom-button:hover { background-color: #f1f1f1; }

.bubble {background: #fff;border: 1px solid #333;border-radius: 6px;padding: 2px 6px;font-size: 12px;white-space: nowrap;box-shadow: 0 2px 6px rgba(0,0,0,0.3);}
.bubble-start { color: green; font-weight: bold; }
.bubble-end   { color: red; font-weight: bold; }

.bubble-alert {
  background: #fff3cd;
  border: 1px solid #856404;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* PANNEAU GLOBAL */
.itineraire-panel {
  position: absolute;
  width: 260px;
  background: white;
  border: 2px solid blue;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border-radius: 5px;

  pointer-events: auto !important;

  /* 🔥 IMPORTANT : panneau caché au départ */
  display: none;

  max-height: 430px;
  overflow: hidden;

  /* Layout interne : header fixe + contenu scrollable */
  flex-direction: column;
}

/* Quand on veut l’afficher */
.itineraire-panel.visible {
  display: flex !important; /* au lieu de block */
}

.itineraire-panel.open {
  z-index: 1000;
}


/* HEADER DRAGGABLE */
.drag-header {
  cursor: move;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.drag-header button {
  padding: 4px;
  background: #007bff;
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}

/* PARTIE FIXE (boutons, modes, QR) */
.itineraire-share {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  margin-top: 0;
}

.itineraire-share button {
  font-size: 12px;
  padding: 2px 6px;
  color: blue;
  background: white;
  border: none;
}

.itineraire-share div {
  margin: 0;
}

.qr-code-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.qr-code-canvas {
  width: 100px;
  height: 100px;
  border: 1px solid #ccc;
}

/* TRANSPORT SELECTOR */
.transport-selector {
  margin: 10px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.transport-selector button {
  font-size: 12px;
  height: 20px !important;
}

.transport-selector button.active {
  background-color: #007bff;
  color: white;
  border-radius: 4px;
}

/* HEADER FIXE DU PANNEAU */
.itineraire-panel-header {
  margin: 5px 0;
  text-align: center;
  background: #f8f8ff;
  font-size: 15px;
  font-weight: bold;
  user-select: none;
}

.itineraire-panel-header span {
  font-size: 12px;
  color: #0074d9;
}

/* 🟦 ZONE SCROLLABLE UNIQUEMENT */
.itineraire-panel-scroll {
  overflow-y: auto;
  flex: 1;
  padding-right: 6px; /* évite que le scroll masque le texte */
}

/* ÉTAPES */
.itineraire-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 100%;
  overflow-x: hidden;
}

.itineraire-steps li {
  padding: 6px;
  font-size: 13px;
  margin-bottom: 5px;
  color: #333;
  background: #f0f4ff;
  border-left: 3px solid #007bff;
  border-radius: 4px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.alert-peage {color: red;font-weight: bold;}
.alert-travaux {color: orange;font-weight: bold;}
.alert-fermeture {color: gray;font-weight: bold;}
.step-line {display: flex;align-items: flex-start;gap: 8px;flex-wrap: nowrap;}

.step-label {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.step-number {
  font-weight: bold;
  color: #333;
}
.icon-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.direction-icon {
  font-size: 16px;
  font-weight: bold;
  color: #007BFF;
  display: inline-block;
  width: 20px;
  text-align: center;
}
.mot-danger {
  color: #c00;
  font-weight: bold;
}
.danger-icon {
  margin-left: 6px;
  font-size: 1.2em;
  color: #c00;
}

.instruction-text {
  font-weight: 500;
  color: #222;
  flex: 1;
  word-break: break-word;
}

.step-meta {
  font-size: 12px;
  color: #666;
}

.gm-style {
    z-index: 1 !important;
}

.gm-style > div {
  box-shadow: none !important;
  margin: 0 !important;
}

.gm-style-mtc {
  transform: scale(0.8) !important;
  margin-top: 1px !important;
}

.gm-style-mtc button,
.gm-style-mtc select {
  font-size: 18px !important;
  font-family: Times, serif !important;
  padding: 5px 7px !important;
  border-radius: 5px !important;
  color: blue !important;
  border: 1px solid #ccc !important;
  background: white !important;
  width: 100px !important;
  
}

.ouvrir-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    color: blue;
}

#map-tooltip {position:absolute;width:250px;
        display:none;
        background:rgba(21,101,192,0.9);
        color:#fff;
        padding:6px;
        border-radius:6px;
        font-size:12px;
        font-family:sans-serif;
        line-height:14px;
        pointer-events:none;
        z-index:9999;}

#profil-altimetrie {width: 100%; margin: 12px auto; height: auto;
            display: none; position: relative; box-sizing: border-box; overflow-x: auto;
          margin: 5px 0}

