/* ==========================================================================
   Carte des parcs : téléphone (lot G du chantier responsive, 18/11/2026)
   Rien ne change au-dessus de 767 px : les éléments ajoutés par mobile-carte.js sont cachés par défaut.
   Retour arrière : retirer l'enregistrement de ce fichier dans inc/carte-trip.php.
   ========================================================================== */
.ctpm-fbtn,.ctpm-fhead,.ctpm-ffoot,.ctpm-fond,.ctpm-tbar,.ctpm-poi,.ctpm-pcl{display:none}

@media (max-width:767px){
  /* ---------- page : la carte passe avant tout (le titre reste dans le code pour le référencement) ---------- */
  html body:has(#ca-carte-app) .ca-ph{height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;overflow:hidden!important}
  html body:has(#ca-carte-app) .ca-ph h1{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  body.ctp-bloque{overflow:hidden}
  body.ca-plein-ecran #wpadminbar{display:none!important}
  body.ca-plein-ecran .ca-bar,body.ca-plein-ecran .ca-ast,body.ctpm-fo .ca-bar,body.ctpm-fo .ca-ast{display:none!important}

  .ctp{--ctp-th:170px}
  /* ---------- barre d'outils : recherche (localisation dans le champ) + Filtres à droite, puis Mon trip pleine largeur ---------- */
  .ctp .ctp__barre{position:static;z-index:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;padding:8px;border-radius:18px;margin:6px 0 6px}
  .ctp .ctp__outils{display:contents}
  .ctp .ctp__rech{position:relative;flex:none;max-width:none;min-width:0;width:100%}
  .ctp .ctp__rech-champ{height:46px;padding-right:48px}
  .ctp .ctp__rech-liste{left:0;right:auto;width:var(--ctp-lw,100%);max-height:min(46dvh,340px);z-index:350}
  .ctp .ctp__rech #ctp-loc{position:absolute;top:50%;right:6px;z-index:2;width:36px;height:36px;margin-top:-18px;padding:0;gap:0;border:0;border-radius:50%;background:transparent;color:#124A9E!important;box-shadow:none;transform:none}
  .ctp .ctp__rech #ctp-loc:hover,.ctp .ctp__rech #ctp-loc:active{background:#EEF3FB;box-shadow:none;transform:none}
  .ctp .ctp__rech #ctp-loc span{display:none}
  .ctp .ctp__outils .ctpm-fbtn{display:inline-flex;height:46px;padding:0 14px;gap:7px;font-size:15.5px;border-radius:14px;white-space:nowrap}
  .ctp .ctp__outils .ctpm-fbtn.is-actif{background:#DCE8FA;color:#124A9E!important;box-shadow:inset 0 0 0 2px #124A9E}
  .ctp .ctp__outils #ctp-trip-btn{grid-column:1/-1;width:100%;height:48px;font-size:16.5px;border-radius:14px;white-space:nowrap}
  .ctp .ctp__outils .ctp__btn b{min-width:19px;height:19px;padding:0 5px;font-size:13px;line-height:19px}
  .ctp .ctpm-fbtn b{background:#124A9E;color:#fff}
  .ctp .ctp__etat{flex-wrap:nowrap;overflow-x:auto;white-space:nowrap;margin:0 2px 6px;min-height:26px;font-size:15px;scrollbar-width:none}
  .ctp .ctp__etat::-webkit-scrollbar{display:none}

  /* ---------- carte : à la hauteur de l'écran, bord à bord ---------- */
  .ctp .ctp__corps{display:block}
  .ctp .ctp__carte{width:100vw;margin-left:calc(50% - 50vw);border-radius:0;box-shadow:none;min-height:0;
    height:max(340px,calc(100dvh - var(--ca-hh,58px) - var(--ca-bar-h,60px) - env(safe-area-inset-bottom,0px) - var(--ctp-th,150px)))}
  .ctp .ctp__legende,.ctp .ctp__flottants,.ctp .leaflet-control-zoom{display:none}

  /* ---------- fiche : feuille basse à trois crans ---------- */
  .ctp .ctp__panneau{position:fixed;left:0;right:0;bottom:calc(var(--ctpm-bas,60px) + env(safe-area-inset-bottom,0px));z-index:310;width:auto;height:0;max-height:calc(100dvh - var(--ca-hh,58px) - var(--ctpm-bas,60px) - env(safe-area-inset-bottom,0px));border-radius:22px 22px 0 0;
    box-shadow:0 -8px 30px rgba(11,30,70,.22);overflow:hidden;background:#fff;transition:height .3s cubic-bezier(.25,.8,.3,1)}
  .ctp .ctp__panneau.is-drag{transition:none}
  .ctp[data-feuille="ferme"] .ctp__panneau{visibility:hidden;box-shadow:none;transition:height .3s cubic-bezier(.25,.8,.3,1),visibility 0s .3s}
  .ctp .ctpm-poi{display:flex;align-items:center;justify-content:center;flex:none;width:100%;height:26px;margin:0;padding:0;border:0;background:#fff;cursor:grab;touch-action:none}
  .ctp .ctpm-poi i{display:block;width:44px;height:5px;border-radius:99px;background:#CFD7E6}
  .ctp .ctpm-pcl{display:flex;align-items:center;justify-content:center;position:absolute;top:2px;right:6px;z-index:5;width:42px;height:42px;border:0;border-radius:50%;background:transparent;color:#4B4A47;font:400 28px/1 'Barlow',sans-serif;cursor:pointer}
  .ctp.is-trip .ctpm-pcl{display:none}
  .ctp .ctp__onglets{display:none}
  .ctp.is-trip .ctp__onglets{display:flex;padding:0 10px 8px;background:#fff}
  .ctp.is-trip .ctp__onglets button{height:38px;font-size:15.5px}
  .ctp .ctp__vue{padding:2px 14px 18px;overflow:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .ctp[data-feuille="mi"] .ctp__vue,.ctp[data-feuille="plein"] .ctp__vue{overflow-y:auto}
  .ctp #ctp-v-trip{padding:0}
  /* fiche compacte pour tenir dans l'aperçu */
  .ctp .ctp-fp{gap:10px}
  /* l'aperçu montre d'abord le nom, les boutons d'action et l'ouverture du jour */
  .ctp .ctp-fp__hero{order:-3}
  .ctp .ctp-fp__actions{order:-2}
  .ctp .ctp-fp__chips{order:-1}
  .ctp .ctp-fp__hero,.ctp .ctp-fp__hero--vide{min-height:88px;border-radius:14px}
  .ctp .ctp-fp__ht{padding:10px 12px}
  .ctp .ctp-fp__nom{font-size:23px}
  .ctp .ctp-fp__lieu{font-size:13.5px;margin-bottom:2px}
  .ctp .ctp-fp__actions .ctp__btn{flex:1 1 130px;min-height:44px;padding:0 8px;font-size:15.5px}
  .ctp .ctp-fp__chips{gap:6px}
  .ctp .ctp__intro{margin:14px 8px}

  /* ---------- filtres : une seule feuille ---------- */
  .ctp .ctp__filtres{display:none}
  .ctp .ctp__filtres.is-ouvert{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:12px;position:fixed;left:0;right:0;bottom:0;z-index:99995;max-height:88dvh;overflow-y:auto;
    padding:0 16px 0;background:#fff;border-radius:22px 22px 0 0;box-shadow:0 -10px 40px rgba(11,30,70,.3)}
  .ctp .ctpm-fond{position:fixed;inset:0;z-index:99994;background:rgba(11,30,70,.5)}
  .ctp .ctpm-fond:not([hidden]){display:block}
  .ctp .ctp__filtres.is-ouvert .ctpm-fhead{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:3;margin:0 -16px;padding:22px 16px 10px;background:#fff}
  .ctp .ctpm-grip{position:absolute;top:9px;left:50%;width:44px;height:5px;margin-left:-22px;border-radius:99px;background:#CFD7E6}
  .ctp .ctpm-fhead h3{margin:0;font:400 24px/1 'Anton',sans-serif;text-transform:uppercase;color:#124A9E;letter-spacing:.01em}
  .ctp .ctpm-x{width:44px;height:44px;margin:-8px -8px -8px 0;border:0;border-radius:50%;background:#F2F1EE;color:#4B4A47;font:400 28px/1 'Barlow',sans-serif;cursor:pointer}
  .ctp .ctp__filtres.is-ouvert .ctp__reset{position:absolute;top:22px;right:68px;z-index:4;height:32px}
  .ctp .ctp__filtres.is-ouvert .ca-sel,.ctp .ctp__filtres.is-ouvert .ca-sel__btn,.ctp .ctp__filtres.is-ouvert .ctp__f-dist{width:100%;max-width:none}
  .ctp .ctp__filtres.is-ouvert .ca-sel__btn{height:48px;justify-content:flex-start}
  .ctp .ctp__filtres.is-ouvert .ca-sel__lib{flex:1;text-align:left}
  .ctp .ctp__filtres.is-ouvert .ctp__lien-mes{width:100%;height:48px;justify-content:center}
  .ctp .ctp__filtres.is-ouvert .ctpm-ffoot{display:block;position:sticky;bottom:0;z-index:3;margin:0 -16px;padding:10px 16px calc(14px + env(safe-area-inset-bottom,0px));background:linear-gradient(0deg,#fff 80%,rgba(255,255,255,0))}
  .ctp .ctpm-fvoir{width:100%;height:50px;font-size:17px;border-radius:14px}

  /* ---------- mode « Mon trip » : plein écran dédié ---------- */
  .ctp.is-trip{position:fixed;inset:0;z-index:99990;overflow:hidden;padding:0;background:#DDE6F2}
  .ctp.is-trip .ctp__barre,.ctp.is-trip .ctp__etat{display:none}
  .ctp.is-trip .ctp__corps{position:absolute;inset:0}
  .ctp.is-trip .ctp__carte{position:absolute;left:0;right:0;top:54px;bottom:0;width:auto;margin:0;height:auto}
  .ctp.is-trip .ctpm-tbar{display:flex;align-items:center;justify-content:space-between;gap:8px;position:absolute;left:0;right:0;top:0;z-index:20;height:54px;padding:0 8px;
    background:linear-gradient(140deg,#124A9E,#0B3C91 75%);color:#fff;box-shadow:0 2px 10px rgba(11,30,70,.35)}
  .ctp .ctpm-tq{display:inline-flex;align-items:center;gap:2px;height:44px;padding:0 10px 0 4px;border:0;background:transparent;color:#fff;font:700 16px 'Barlow',sans-serif;cursor:pointer}
  .ctp .ctpm-tt{flex:1;min-width:0;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 19px/1 'Anton',sans-serif;text-transform:uppercase;letter-spacing:.02em}
  .ctp .ctpm-te{height:38px;padding:0 14px;border:0;border-radius:999px;background:#ec9521;color:#fff;font:700 15.5px 'Barlow',sans-serif;cursor:pointer}
  .ctp .ctpm-te[disabled]{opacity:.5}
  .ctp.is-trip .ctp__panneau{bottom:0;z-index:30;max-height:calc(100dvh - 54px);padding-bottom:env(safe-area-inset-bottom,0px)}
  /* étapes du trip, version feuille */
  .ctp .ctp__th{padding:10px 14px 12px;border-radius:0}
  .ctp .ctp__th .ctp__t-nom{font-size:22px}
  .ctp .ctp__th-stats{margin:10px 0 0;gap:6px}
  .ctp .ctp__th-stats div{padding:7px 2px;border-radius:12px}
  .ctp .ctp__th-stats b{font-size:18px}
  .ctp .ctp__th-stats span{font-size:12.5px}
  .ctp .ctp__t-corps{padding:14px 14px 16px}
  .ctp .ctp__t-pied{position:sticky;bottom:0;padding:10px 14px 12px}
  .ctp[data-feuille="peek"] .ctp__t-pied{display:none}
  .ctp .ctp__t-pied{gap:6px}
  .ctp .ctp__t-pied .ctp__btn{height:42px;min-height:0}
  /* dans la vue Mon trip, la barre du haut dit déjà où l'on est : on gagne la ligne des onglets */
  .ctp.is-trip .ctp__onglets:has(#ctp-o-trip[aria-selected="true"]){display:none}
  .ctp.is-trip .ctp__toast,body.ca-plein-ecran .ctp__toast{bottom:calc(24px + env(safe-area-inset-bottom,0px))}

  /* ---------- sombre ---------- */
  body.ca-dark .ctp .ctp__panneau,body.ca-dark .ctp .ctpm-poi,body.ca-dark .ctp .ctp__filtres.is-ouvert,body.ca-dark .ctp .ctpm-fhead,body.ca-dark .ctp.is-trip .ctp__onglets{background:#211E1A}
  body.ca-dark .ctp .ctpm-fhead h3{color:#8FB4FF}
  body.ca-dark .ctp .ctpm-x,body.ca-dark .ctp .ctpm-pcl{background:#2A2621;color:#DDD}
  body.ca-dark .ctp .ctpm-fbtn b{background:#8FB4FF;color:#0B1E46}

  @media (max-width:380px){.ctp .ctp__outils .ctpm-fbtn span{display:none}.ctp .ctp__outils .ctpm-fbtn{padding:0 14px}}
  @media (prefers-reduced-motion:reduce){.ctp .ctp__panneau{transition:none}}
}
