/* =========================
   Polices & base globale + couleurs
========================= */
@font-face {
  font-family: 'Bebas Neue';
  src: url('/static/fonts/BebasNeue.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('/static/fonts/Oswald.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Designer';
  src: url('/static/fonts/Designer.ttf') format('truetype');
  font-display: swap;
}

/* ====== Variables & reset léger ====== */
:root{
  --bg: #0d0f10;
  --surface: hsl(210, 14%, 9%);
  --text: #0e0e48;
  --muted: #0e0e48;
  --line: #24282d;
  --gold: #c9a227;
  --gold-2:#e3c56a;
  --radius: 16px;
  --shadow: 0 10px 24px rgba(0,0,0,.25);

  /* Studio tokens — modern app-like design */
  --studio-bg: #f6f7fb;
  --studio-surface: #ffffff;
  --studio-border: rgba(15, 23, 42, 0.06);
  --studio-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --studio-shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.1);
  --studio-radius: 16px;
  --studio-radius-sm: 10px;
  --studio-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Corps de la page */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Oswald', sans-serif;
  color: #0e0e48;
  background: #f3f4f6;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Titre principal (desktop) — use the same display font as product hero */
h1 {
  font-family: 'Bebas Neue', 'Oswald', 'Designer', system-ui, sans-serif;
  text-align: center;
  color: #0e0e48;
  font-size: clamp(38px, 4vw, 62px);
  letter-spacing: .06em;
  margin: 12px 0 6px;
}

/* =========================
   HERO "Your Golden Map"
========================= */
.ygm-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 auto 20px;
  padding: 16px 20px 24px;
  max-width: 980px;
  text-align: center;
}

.ygm-hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

/* Ensure the gold span in the hero H1 does not scale larger than surrounding text */
.ygm-hero h1 .gold {
  font-size: inherit;
  font-weight: inherit;
  text-shadow: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ygm-subtitle {
  margin: 0;
  font-size: 15px;
  color: #4b5563;
  max-width: 600px;
  line-height: 1.5;
}

.ygm-steps {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  min-width: 1200px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ygm-steps li {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.15);
  color: var(--text);
  white-space: nowrap;
  transition: var(--studio-transition);
  flex: 0 0 auto;
}

/* ------- DIVIDER ------- */
.ridge-divider{
  position: relative;
  width: 100vw;                 /* full-bleed across viewport */
  margin-left: calc(50% - 50vw);/* center the full-bleed element */
  box-sizing: border-box;
  height: 84px;                /* hauteur du séparateur */
  overflow: hidden;
  background: transparent;
  margin-top: 20px;
}
.ridge-divider svg{
  position:absolute; left:0; top:0; width:100%; height:100%;
  display:block;
}
.ridge-divider .ridge{ fill: #ffffff; opacity:.1; }
.ridge-divider .far{ opacity:.005; }
.ridge-divider .mid{ opacity:.05; }
.ridge-divider .top{ fill: url(#ygrGrad); mix-blend-mode: normal; }

.ridge-image {
  width: 100vw;          /* span full viewport width */
  max-width: none;
  height: 100%;
  display: block;
  margin: 0;
  object-fit: cover;     /* fill horizontally and vertically */
  object-position: center top; /* anchor to top to avoid top cropping */
  opacity: 0.35;
}

@media (max-width: 640px) {
  .ridge-divider {
    height: 36px; /* smaller separator */
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .ridge-divider svg { height: 100%; }
  .ridge-image { opacity: 0.25; }
}

@media (max-width: 640px) {
  .ridge-divider,
  .ridge-image {
    display: none !important;
    visibility: hidden !important;
  }

  /* Also hide inline spacer divs used in templates */
  div[style*="height:50px"] {
    display: none !important;
  }
}

/* =========================
   Layout principal
========================= */

.center-column.visible {
  display: flex;
}

/* Conteneur principal */
.page-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 40px;
  padding: 0 16px;
  box-sizing: border-box;
  overflow-x: hidden;
  gap: 20px;
}

/* Desktop behavior: left map stays sticky initially; right column scrolls with page.
   When the user scrolls past the map's container, the map will unstick naturally and
   both columns will continue scrolling together. */
@media screen and (min-width: 1025px) {
  /* Keep page scrolling behavior normal */
  .page-container {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Make the map column itself sticky so it stays fixed while right column scrolls */
  body .page-container .map-column {
    position: sticky !important;
    top: 20px;
    align-self: flex-start;
    /* keep natural height; let the map element control its own height */
    z-index: 2;
  }

  /* Map fills the sticky column — preserve full-viewport height as before */
  body .page-container .map-column > #map {
    position: relative !important;
    height: auto !important;
    max-height: 560px !important;
    width: 100% !important;
    max-width: 700px !important;
  }

  /* When scrolled past container bottom, unstick the column and pin it */
  body .page-container .map-column.ygm-unstuck {
    position: absolute !important;
    top: auto !important;
    bottom: 0 !important;
  }

  /* Ensure the map column lets the sticky element work */
  /* make map-column overflow visible — use higher specificity to override other files */
  body .page-container .map-column {
    overflow: visible !important;
  }

  /* Right column stays in normal flow so it scrolls with the page */
  .form-column {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* When a GPX is loaded, we may want the result column to also be sticky
     so the result map + purchase button remain visible while options scroll. */
  body .page-container .center-column.ygm-sticky {
    position: sticky !important;
    top: 20px !important;
    align-self: flex-start !important;
    z-index: 2 !important;
    max-height: calc(100vh - 40px) !important;
    overflow: visible !important;
  }

  body .page-container .center-column.ygm-unstuck {
    position: absolute !important;
    top: auto !important;
    bottom: 0 !important;
  }
}

/* Colonnes */
/* APRÈS */
.map-column,
.form-column {
  width: auto;
  max-width: 680px;
  flex: 1 1 0;
  min-width: 0;
}

/* Colonne formulaire : hauteur auto, pas de scroll interne */
.form-column {
  padding: 10px;
  background-color: transparent;
  margin: 0 auto;
  overflow: visible;
  min-height: auto;
  max-height: none;
}

/* Colonne carte initiale */
.map-column {
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  align-items: flex-start;   /* carte calée en haut à gauche */
  justify-content: flex-start;
  height: auto;
}

.map-column.hidden {
  display: none;
}

/* Purchase button is hidden by default; JS will show it when appropriate */
.purchase-button-container {
  display: none;
}

/* Ensure purchase button inside map column sits directly under the map when shown */
.map-column .purchase-button-container {
  margin-top: 12px;
}

/* Purchase button positioning for the result view (below poster + info block) */
.center-column .purchase-button-container,
#result-column .purchase-button-container {
  display: block;
  text-align: center;
  margin-top: 32px; /* space below poster / info block */
  width: 100%;
}

.purchase-button-container .btn {
  display: inline-block;
  margin: 0 auto;
  max-width: 920px;
}

/* Styles for the small step buttons on the right column */
#btn-to-infos, #btn-to-options, #btn-to-elements {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--studio-radius-sm);
  font-size: 15px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-transform: none;
  letter-spacing: .02em;
  display: block;
  margin: 20px 0 0;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: var(--text);
  border: none;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25);
  transition: var(--studio-transition);
}

#btn-to-infos:hover, #btn-to-options:hover, #btn-to-elements:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.35);
}

/* Ensure these buttons keep the site's .btn layout but with lighter weight */
button#btn-to-infos.btn.primary, button#btn-to-options.btn.primary, button#btn-to-elements.btn.primary {
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25);
}

/* Colonne résultats */
.center-column {
  flex: none;
  width: 60vh;
  display: none;
  flex-direction: column;
  margin:  0 auto;
  min-height: 700px;
  max-height: 50%;
  align-items: center;
  background: #fff;
}

/* =========================
   Cartes Mapbox
========================= */

/* Carte initiale */
#map {
  width: 100%;
  border: 0;
  margin-bottom: 0;
  border-radius: 35px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 700px;
  max-height: 560px;
}

/* Carte de résultat */
 #result-map { 
          width: 100%; 
          height: 560px;          /* increased fixed height to better match previous layout */
          border: 0; 
          border-radius: 0; 
          display: none; 
          position: relative; 
          max-width: 700px;      /* match initial map width */
          margin-left: auto; 
          margin-right: auto;
        }

#result-map.visible { display:block; }
#result-map::after { content:''; position:absolute; bottom:0; left:0; width:100%; height:70px; background:linear-gradient(to bottom, rgba(255,255,255,0) 0%, #fff 100%); pointer-events:none; }
/* When user disables bottom fade via UI */
#result-map.no-bottom-fade::after,
#map.no-bottom-fade::after {
  display: none !important;
}

/* Overlays placed on result-map (text or image) */
.ygm-overlay { pointer-events:auto; user-select:none; }
.ygm-overlay img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border: none;                /* remove thin border for uploaded images */
  box-shadow: none;           /* remove shadow */
  border-radius: 10px;       /* requested rounded corners */
}
.overlay-item { padding:6px 8px; background:#fff; border-radius:8px; box-shadow:0 4px 10px rgba(0,0,0,0.06); margin-bottom:6px; }

/* Compact / modern styles for "Tes éléments" overlay controls */
.overlay-controls { display:block; gap:8px; }
.overlay-controls .overlay-row { display:flex; align-items:center; gap:8px; margin:6px 0; }
.overlay-controls .overlay-row--compact { gap:6px; }
.overlay-input { flex:1 1 auto; padding:8px 10px; border-radius:8px; border:1px solid #e6e9ef; font-size:14px; background:#fff; box-shadow:none; }
.btn-compact { padding:6px 10px; font-size:13px; border-radius:8px; }
.compact-file { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:8px; background:#f7f8fb; border:1px solid #eceff4; cursor:pointer; }
.compact-file input[type="file"] { display:none; }
.compact-note { font-size:12px; color:#6b7280; margin:0; }
.overlay-list { margin-top:8px; display:flex; flex-direction:column; gap:6px; }

.overlay-item { padding:4px 8px; display:flex; flex-direction:column; align-items:stretch; gap:3px; font-size:13px; border-radius:8px; box-shadow:0 6px 18px rgba(15,23,42,0.04); border:1px solid rgba(15,23,42,0.03); background:#ffffff; }
.overlay-item .btn { padding:6px 8px; font-size:12px; }

/* Submenu for text overlays (discrete, shows on hover) */
.overlay-submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
  border: 1px solid rgba(15,23,42,0.04);
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  white-space: nowrap;
  z-index: 1000;
}

.ygm-overlay:hover .overlay-submenu,
.ygm-overlay.show-submenu .overlay-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.overlay-submenu select.overlay-submenu-font { padding:6px 8px; border-radius:8px; border:1px solid #e6e9ef; background:#fff; font-size:14px; min-width:140px; height:36px; line-height:1.1; }
.overlay-submenu input.overlay-submenu-size { width:56px; padding:4px 6px; border-radius:6px; border:1px solid #e6e9ef; font-size:13px; height:36px; box-sizing: border-box; }
.overlay-submenu .overlay-submenu-icon { padding:4px 6px; border-radius:6px; border:1px solid #eee; background:#f7f8fb; cursor:pointer; color: #0d0f10; font-size:13px; }
.overlay-submenu .overlay-submenu-toggle { padding:4px 6px; border-radius:6px; border:1px solid #eee; background:#f7f8fb; font-weight:700; cursor:pointer; color: #0d0f10; font-size:13px; }

/* When submenu is rendered in the overlay list (not floating over the map) */
.overlay-submenu--list {
  position: static !important;
  transform: none !important;
  display: flex !important;
  flex-wrap: nowrap; /* keep all controls on a single second line */
  width: 100%;
  opacity: 1 !important;
  visibility: visible !important;
  box-shadow: none;
  border: 0;
  background: transparent;
  padding-top: 4px;
  gap: 6px;
  overflow-x: auto; /* allow horizontal scroll on small screens */
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

.overlay-submenu--list .overlay-submenu-font,
.overlay-submenu--list .overlay-submenu-size,
.overlay-submenu--list .overlay-submenu-icon,
.overlay-submenu--list .overlay-submenu-toggle {
  background: #fff; border:1px solid #eceff4; padding:6px 8px; border-radius:8px; box-shadow:none;
}

/* Ensure the submenu buttons use the chosen dark color and are compact in-list */
.overlay-submenu--list .overlay-submenu-icon,
.overlay-submenu--list .overlay-submenu-toggle {
  padding:4px 6px; font-size:13px; color:#0d0f10; border-radius:6px;
}

/* Active state for style toggles */
.overlay-submenu-toggle.active,
.overlay-submenu--list .overlay-submenu-toggle.active {
  background: #0d0f10 !important;
  color: #ffffff !important;
  border-color: rgba(0,0,0,0.18) !important;
}

/* Specific visual for underline / strike buttons so the letter glyph matches intent */
.overlay-submenu-toggle.toggle-underline,
.overlay-submenu--list .overlay-submenu-toggle.toggle-underline {
  text-decoration: underline;
}

.overlay-submenu-toggle.toggle-strike,
.overlay-submenu--list .overlay-submenu-toggle.toggle-strike {
  text-decoration: line-through;
}

/* Make the B glyph appear bold and the I glyph italic by default */
.overlay-submenu-toggle.toggle-bold,
.overlay-submenu--list .overlay-submenu-toggle.toggle-bold {
  font-weight: 700;
}

.overlay-submenu-toggle.toggle-italic,
.overlay-submenu--list .overlay-submenu-toggle.toggle-italic {
  font-style: italic;
}

/* Ensure editable overlay text shows underline/strike reliably */
.ygm-overlay .overlay-content {
  display: inline-block; /* match JS, ensure decoration applies consistently */
  text-decoration: inherit !important;
  text-decoration-color: currentColor !important;
  text-decoration-thickness: 0.07em !important;
  -webkit-text-decoration-skip-ink: none !important;
  text-decoration-skip-ink: none !important;
}

/* Thumbnail preview in the overlay list (left side) */
.overlay-list-thumb{
  width:48px;
  height:48px;
  border-radius:6px;
  object-fit:cover;
  margin:0 auto;
  display:block;
}

/* Logo bank grid (small thumbnails for quick selection) */
.logo-bank{ display:block; }

/* Viewport that masks pages and limits display to max 3 rows */
.logo-bank-viewport{
  overflow-x:auto; /* allow horizontal scroll */
  overflow-y:hidden;
  width:100%;
  box-sizing:border-box;
  padding:6px 0 6px 6px;
  white-space:nowrap;
  max-height:200px; /* increased to ensure 3 rows of thumbnails are fully visible */
}

/* Strip that holds pages; will be translated left/right */
.logo-bank-strip{
  display: grid;
  grid-auto-flow: column; /* create columns horizontally */
  grid-template-rows: repeat(3, auto); /* show 3 stacked rows */
  grid-auto-columns: 92px; /* column width for each logo cell */
  gap: 10px 12px; /* row gap, column gap */
  align-items: start; /* align items to top so third row isn't visually clipped */
}

/* Each page uses a simple grid with up to 3 rows */
.logo-bank-page{ display:block; }

/* Ensure individual thumbs align within grid cells */
.logo-bank-strip img.logo-thumb{ width:72px; height:48px; margin:0 auto; }

.logo-thumb{ width:72px; height:48px; object-fit:contain; background:transparent; padding:0; border-radius:8px; border:1px solid rgba(15,23,42,0.04); cursor:pointer; box-shadow:none; display:block; }
.logo-thumb:hover{ transform:translateY(-3px); }

/* Controls (prev/next) */
.logo-bank-controls{ display:flex; gap:8px; justify-content:center; margin-top:8px; }
.logo-bank-controls button{ background:#fff; border:1px solid rgba(15,23,42,0.06); padding:6px 10px; border-radius:8px; cursor:pointer; font-size:16px; color:#0e0e48; }
.logo-bank-controls button:disabled{ opacity:.4; cursor:default; }

/* Hidden state for logo bank (toggle) */
.logo-bank.hidden { display: none; }

/* When shown, place the logo bank under the buttons/upload row */
.logo-bank{ width:100%; margin-top:8px; justify-content:flex-start; }
.logo-bank > img{ flex: 0 0 auto; }

/* Row wrapper to keep bank + upload on same line */
.logo-bank-row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.logo-bank-row > div { display:flex; align-items:center; gap:8px; }

@media (max-width:640px){
  .logo-bank-row{ flex-direction:column; align-items:stretch; }
  .logo-bank-row > div { justify-content:flex-start; }
}


/* Align size input height and vertical centering with buttons */
.overlay-submenu--list .overlay-submenu-size {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  box-sizing: border-box;
  transform: translateY(1px); /* small nudge to align with icon buttons */
}

/* Ensure toggles have exact same height and centering */
.overlay-submenu--list .overlay-submenu-icon,
.overlay-submenu--list .overlay-submenu-toggle {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

/* And make select consistent inside the list */
.overlay-submenu--list .overlay-submenu-font {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

/* Force consistent vertical alignment baseline across inputs and buttons */
.overlay-submenu--list .overlay-submenu-size,
.overlay-submenu--list .overlay-submenu-icon,
.overlay-submenu--list .overlay-submenu-toggle,
.overlay-submenu--list .overlay-submenu-font {
  vertical-align: middle;
  line-height: normal;
  box-sizing: border-box;
}

/* Strong override to ensure cross-browser consistent vertical alignment */
.overlay-submenu--list input.overlay-submenu-size,
.overlay-submenu input.overlay-submenu-size {
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
  appearance: none !important;
  height: 34px !important;
  line-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  transform: translateY(2px) !important; /* nudge if browser baseline differs */
  vertical-align: middle !important;
}

.overlay-submenu--list .overlay-submenu-icon,
.overlay-submenu--list .overlay-submenu-toggle {
  transform: translateY(0) !important;
}

@media (max-width:640px){
  .overlay-submenu { font-size:12px; padding:6px; }
  .overlay-submenu input.overlay-submenu-size { width:48px; }
}

/* Ensure the small helper text doesn't push the layout on narrow screens */
@media (max-width: 640px) {
  .overlay-controls .overlay-row { flex-direction:column; align-items:stretch; }
  .overlay-controls .overlay-row--file { align-items:flex-start; }
  .overlay-input { font-size:15px; }
}

/* Resize / rotate handles for overlays */
.ygm-overlay { position: absolute; touch-action: none; }
.overlay-handle { position: absolute; width:28px; height:28px; background: rgba(255,255,255,0.95); border:1px solid rgba(0,0,0,0.08); border-radius:8px; box-shadow:0 4px 10px rgba(0,0,0,0.08); display:none; opacity:0; transition:opacity .12s ease, transform .12s ease; display:flex; align-items:center; justify-content:center; padding:4px; box-sizing:border-box; font-size:0; }
.overlay-resize { left:50%; right:auto; bottom:-10px; transform: translateX(-50%); cursor:ns-resize; }
.overlay-rotate { left:50%; right:auto; top:-10px; transform: translateX(-50%); cursor:grab; }
.overlay-handle svg{ width:18px; height:18px; display:block; }
.overlay-handle img{ width:18px; height:18px; display:block; margin:0; }

/* Show handles only on hover (or when element has class 'show-handles') */
.ygm-overlay:hover .overlay-handle,
.ygm-overlay.show-handles .overlay-handle {
  display: block;
  opacity: 1;
}


/* Résolution desktop large */
  @media (min-width: 1200px) {
  #result-map {
    max-width: 700px;
    height: 560px;
  }
}

/* Masquer certains contrôles Mapbox */
.mapboxgl-ctrl-logo {
  display: none !important;
}

/* Boutons de zoom pour la carte initiale */
#map .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
  display: none;
}

/* Boutons de zoom pour la carte de résultats */
#result-map .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
  display: none;
}

/* =========================
   Bloc résultats + graph
========================= */

.bottom-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

/* Quand graphe caché → centrer résultats */
.bottom-container.no-elevation {
  justify-content: center;
}

/* Colonne graphe */
.chart-column {
  width: 92%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  background: #ffffff;
}

.chart-column.hidden {
  display: none;
}

/* Canvas du graphe */
#elevation_gain {
  width: 100%;
  height: 100%;
}

/* Colonne résultats (chrono, nom, km) */
.results-column {
  background: #ffffff;
  width: 100%;
  height: 5vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.results-column p { margin:3px; font-size:12px; line-height:1.4; display:inline-block; margin-right:20px; }


/* D+ vertical */
.dplus-info {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  text-align: center;
  margin-left: 2px;
}

/* Conteneur D+ (boutons On/Off) */
#dplus_display_container {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Disposition horizontale des infos dynamiques */
#dynamic-info {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  background: #ffffff;
}

/* Titre dynamique carte */
.dynamic-title {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin: 10px 0 6px;
  font-family: 'Bebas Neue', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  max-width: 80%;
  white-space: normal;
  word-break: break-word;
}

.dynamic-title span {
  padding: 0 20px;
  position: relative;
  color: inherit;
}

.dynamic-title span::before,
.dynamic-title span::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 15px;
  height: 2px;
  background-color: currentColor;
}

.dynamic-title span::before {
  right: 100%;
  margin-right: 5px;
}

.dynamic-title span::after {
  left: 100%;
  margin-left: 5px;
}

/* Date affichée au-dessus résultats */
.date-display {
  font-size: 12px;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  color: inherit;
  margin: 0;
}

.results-column.large-text p {
  font-size: 18px;
  font-weight: bold;
  margin-top: 10px;
}

/* =========================
   Tabs / formulaire
========================= */

.tabs-container {
  background: var(--studio-surface);
  border-radius: var(--studio-radius);
  display: block;
  border: 1px solid var(--studio-border);
  padding: 16px;
  box-shadow: var(--studio-shadow);
  background-clip: padding-box;
}

/* Header onglets — n'affecte que la version web (screen), pas l'impression */
@media screen {
  .tab-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    height: auto;
    padding: 6px;
    background: rgba(14, 14, 72, 0.04);
    border-radius: 14px;
    margin-bottom: 16px;
  }

  /* Boutons onglets — style pill tabs moderne */
  .tab-header button.tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 13px;
    padding: 10px 12px;
    height: auto;
    line-height: 1.2;
    border-radius: var(--studio-radius-sm);
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 500;
    transition: var(--studio-transition);
  }

  /* Hover onglets */
  .tab-header button.tab-link:hover {
    background: rgba(201, 162, 39, 0.08);
  }

  /* Style for the selected tab */
  .tab-header button.tab-link.active {
    background: var(--studio-surface);
    color: var(--gold);
    font-weight: 700;
    box-shadow: var(--studio-shadow);
  }

  /* Mobile tweaks: reduce gap and padding so tabs fit better on small screens */
  @media screen and (max-width: 640px) {
    .tab-header {
      gap: 4px;
      padding: 4px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .tab-header button.tab-link {
      font-size: 11px;
      padding: 8px 10px;
      flex: 0 0 auto;
    }
  }
}
/* Desktop: augmenter légèrement la typo et l'espacement des onglets */
@media screen and (min-width: 1024px) {
  .tab-header {
    gap: 6px;
  }

  .tab-header button.tab-link {
    font-size: 16px; /* plus lisible sur PC */
    padding: 6px 10px;
    height: 36px;
  }
}

/* Groupes de champs */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

label {
  display: block;
  margin: 5px 0;
  font-weight: bold;
}

/* Place the D+ label and input on the same line in the options panel */
.form-group.adjust-dplus-group{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.form-group.adjust-dplus-group > label{
  display: inline-block;
  margin: 0;
  font-weight: bold;
  min-width: 170px; /* approximate width to align with other labels */
}
.form-group.adjust-dplus-group .adjust-dplus-row{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Inputs / selects / boutons (base) */
select,
input[type='file'],
input[type='text'],
input[type='number'],
button {
  width: 100%;
  padding: 12px 14px;
  margin-top: 0;
  box-sizing: border-box;
  font-size: 15px;
  font-family: inherit;
  border-radius: var(--studio-radius-sm);
  border: 1px solid var(--studio-border);
  background: var(--studio-surface);
  color: var(--text);
  transition: var(--studio-transition);
}

select:focus,
input[type='text']:focus,
input[type='number']:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* ========== Boutons génériques & primary ========== */

.btn{ --pad: 12px 18px; display:inline-flex; align-items:center; justify-content:center; gap:10px; padding:var(--pad); border-radius:var(--studio-radius-sm); border:1px solid transparent; text-decoration:none; font-weight:600; letter-spacing:.02em; cursor:pointer; transition: var(--studio-transition); }
.btn.lg{ --pad: 14px 24px; font-size:1rem; }
.btn.sm{ --pad: 8px 14px; font-size:.72rem; }
.btn.primary{
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
  font-weight: 700;
}
.btn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.4);
}
.btn.ghost{ background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: var(--text); }
.btn.ghost:hover{ background: rgba(255,255,255,.07); }
.btn.outline{
  background: linear-gradient(90deg, #fffbe7 0%, #ffe9b3 100%);
  color: #39393b;
  box-shadow: 0 2px 8px rgba(201,162,39,.08);
  transition: background .18s, color .18s;
}
.btn.outline:hover {
  background: linear-gradient(90deg, #a7a7c9 0%, #0e0e48 100%);
  color: #ffffff;
}

/* Small compact variant for inline controls (overrides default --pad) */
.btn.btn-compact {
  --pad: 6px 8px;
  padding: 6px 8px; /* ensure override if var is used earlier */
  font-size: 13px;
  border-radius: 8px;
}

/* Ensure compact buttons size to their content (override global button width:100%) */
.btn.btn-compact {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  display: inline-flex;
}

/* =========================
   Couleurs – générique
========================= */

.color-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  max-width: 100%;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 6px 8px 10px;
  -webkit-overflow-scrolling: touch;
}

.color-options::-webkit-scrollbar {
  height: 5px;
}
.color-options::-webkit-scrollbar-track {
  background: transparent;
}
.color-options::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.color-circle {
  margin-bottom: 0;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--studio-transition);
}

.color-circle:hover {
  transform: scale(1.12);
  border-color: rgba(14, 14, 72, 0.2);
}

.color-circle.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--studio-surface), 0 0 0 4px var(--text);
}

/* Cercle couleur personnalisée (arc-en-ciel) */
.color-circle.custom-color {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
}

.color-circle.custom-color::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: conic-gradient(
    red,
    orange,
    yellow,
    green,
    blue,
    purple,
    red
  );
  z-index: 0;
}

.color-circle.custom-color .custom-color-preview {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background-color: transparent;
  z-index: 1;
}

.color-circle.custom-color input[type='color'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* Groupes couleurs texte */
.text-color-group {
  flex-direction: column;
  align-items: flex-start;
  padding-right: 0;
}

/* =========================
   Couleurs de ton tracé — slider horizontal
========================= */

.trace-colors-wrapper {
  position: relative;
  margin-top: 8px;
  width: 100%;
  overflow: hidden;
}

/* Bande scrollable horizontale */
.trace-color-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.trace-color-strip .color-circle {
  flex: 0 0 auto;
}

/* =========================
   Couleur du dénivelé & Couleur du texte
========================= */

/* Conteneur des options de dénivelé (remplissage + couleurs)
   → caché quand "Affichage dénivelé : Non"
*/
#elevation_color_container {
  display: none;
  margin: 0;
  padding: 0;
}

#elevation_color_container.visible {
  display: block;
  margin-top: 12px;
  margin-bottom: 10px;
}

/* Bloc "Couleur du dénivelé" : bande de pastilles pleine largeur */
#elevationColors {
  width: 100%;
}

/* Bloc "Couleur de ton texte" : pastilles toujours visibles,
   sans prendre de hauteur inutile
*/
.switch-group.text-color-group {
  display: block;
  padding-right: 0;
  width: 100%;
}

.switch-group.text-color-group > label {
  display: block;
  margin-bottom: 6px;
}

/* La zone scrollable des couleurs de texte */
.switch-group.text-color-group .trace-colors-wrapper {
  width: 100%;
}

.switch-group.text-color-group .color-options {
  width: 100%;
  max-width: 100%;
}


/* =========================
   Switch / options (Oui/Non)
========================= */

.switch-group {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--studio-border);
  gap: 12px;
}

.switch-options {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
}

.switch-option {
  flex: 0 0 auto;
}

.switch-option input[type='radio'] {
  display: none;
}

.switch-option label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  text-align: center;
  background: var(--studio-surface);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--studio-transition);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}

.switch-option label:hover {
  border-color: rgba(201, 162, 39, 0.3);
}

.switch-option input[type='radio']:checked + label {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
}

.switch-group > label {
  margin-bottom: 0;
  flex: 0 0 auto;
}

/* Groupe D+ (même style) */
.deniv-group {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 100px;
}

.deniv-options {
  display: flex;
  gap: 10px;
  width: 140px;
  justify-content: center;
  margin-left: auto;
}

.deniv-option {
  flex: 0 0 auto;
  width: 50px;
}

.deniv-option input[type='radio'] {
  display: none;
}

.deniv-option label {
  display: block;
  padding: 6px 12px;
  text-align: center;
  background: #ffffff;
  border: 2px solid #0e0e48;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 14px;
  white-space: nowrap;
}

.deniv-option input[type='radio']:checked + label {
  background: #0e0e48;
  color: #ffffff;
}

.deniv-group > label {
  margin-bottom: 0;
  flex: 0 0 auto;
}

/* Options de remplissage du graphe */
.fill-group {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--studio-border);
}

.fill-options {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
}

.fill-option {
  flex: 0 0 auto;
}

.fill-option input[type='radio'] {
  display: none;
}

.fill-option label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  text-align: center;
  background: var(--studio-surface);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--studio-transition);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}

.fill-option label:hover {
  border-color: rgba(201, 162, 39, 0.3);
}

.fill-option input[type='radio']:checked + label {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
}

/* Specific layout for simple yes/no switches used in several form-groups */
.switch-options {
  display: flex;
  gap: 12px;
  align-items: center;
}
.switch-options .fill-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  /* keep visual appearance from .fill-option label; do not remove padding/border */
  background: transparent;
  border: 0;
}
.switch-options .fill-option input[type='radio'] {
  /* keep inputs hidden like other .fill-option instances so labels retain styled-button look */
  display: none;
  margin: 0;
}
.switch-options .fill-option label {
  display: inline-block;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
}



/* =========================
   Fichier GPX custom input
========================= */

.custom-file-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border: 2px dashed var(--studio-border);
  border-radius: var(--studio-radius);
  text-align: center;
  cursor: pointer;
  margin: 12px 0;
  transition: var(--studio-transition);
  background: rgba(201, 162, 39, 0.02);
}

.custom-file-upload:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 39, 0.06);
}

.custom-file-upload input[type='file'] {
  display: none;
}

/* Texte du file input */
.file-upload-text {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
  display: block;
  text-align: center;
  transition: var(--studio-transition);
  padding: 14px 18px;
  background: var(--studio-surface);
  border-radius: var(--studio-radius-sm);
  border: 1px solid var(--studio-border);
  box-shadow: none;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.file-upload-text:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Inline variant: same look but sized to content */
.file-upload-text-inline {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #0e0e48;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 0 rgba(16, 20, 40, 0.02) inset;
  box-sizing: border-box;
  width: auto;
  white-space: nowrap;
}

/* Inline variant hover/active style to match .file-upload-text */
.file-upload-text-inline:hover,
.file-upload-text-inline:focus {
  color: #fc4c02;
  background: rgba(252, 76, 2, 0.06);
  border-color: rgba(252, 76, 2, 0.12);
}

/* Variante lien = même style */
a.file-upload-text,
a.btn.file-upload-text,
.form-group a.file-upload-text {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #0e0e48;
  margin: 0;
  display: block;
  width: 100%;
  padding: 12px 14px !important;
  background: #f8f9fa !important;
  box-shadow: none !important;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s ease, background 0.15s ease;
  outline: none;
  border-radius: 10px;
  box-sizing: border-box;
}

.form-group a.file-upload-text {
  margin: 8px 0 0 0;
  text-align: center;
}

/* Hover : accent orange */
.form-column .form-group a.file-upload-text:hover,
.form-column .form-group a.file-upload-text:focus,
.form-column .form-group .file-upload-text:hover,
.form-column .form-group .file-upload-text:focus {
  color: #fc4c02 !important;
  background: rgba(252, 76, 2, 0.06) !important;
  border-color: rgba(252, 76, 2, 0.12) !important;
  text-decoration: none;
}

/* Nom du fichier sélectionné */
.file-name {
  font-size: 18px;
  color: #0e0e48;
  word-break: break-all;
  text-align: center;
  display: block;
}

/* =========================
   Chrono & Date (selects)
========================= */

.chrono-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.chrono-container select {
  flex: 1;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  font-family: 'Oswald', sans-serif;
  cursor: pointer;
  color: #0e0e48;
  background-color: #ffffff;
  text-align: center;
}

.chrono-separator {
  font-size: 15px;
  color: #0e0e48;
}

.chrono-container select:hover {
  border-color: #0e0e48;
}

.chrono-container select:focus {
  outline: none;
  border-color: #0e0e48;
  box-shadow: 0 0 0 2px rgba(72, 36, 14, 0.1);
}

/* Date */
.date-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.date-container select {
  flex: 1;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  font-family: 'Oswald', sans-serif;
  cursor: pointer;
  color: #0e0e48;
  background-color: #ffffff;
  text-align: center;
}

/* Année/mois/jour adaptatifs */
#year,
#month,
#day {
  width: auto !important;
  text-align: center;
}

.date-separator {
  font-size: 15px;
  color: #0e0e48;
}

/* =========================
   Strava – bouton & modale
========================= */

.strava-logo-btn {
  height: 1.3em;
  vertical-align: middle;
  margin-right: 0.5em;
  margin-bottom: 2px;
  display: inline-block;
}

/* Lien Strava = même look que les autres boutons gris via .file-upload-text */
#btn-strava.file-upload-text {
  width: 100%;
  margin-top: 8px;
  display: block;
}

/* Boutons secondaires Strava (déconnexion / switch compte) */
#btn-strava-logout,
#btn-strava-switch {
  width: auto !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 8px;
}

#strava-msg.muted {
  display: block;
  margin-top: 6px;
  color: #6b7280;
  font-size: 12px;
}

/* Modal Strava compacte */
#strava-modal {
  display: none;
  padding: 10px !important;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  max-width: 540px;
  width: 95%;
  margin: 12px auto;
  background: #ffffff;
  position: relative;
}

#strava-modal h4 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.2;
}

#strava-search {
  width: 100%;
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* Topbar modal */
.strava-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.strava-topbar small {
  color: #6b7280;
}

/* Liste d’activités */
#strava-activities {
  max-height: 260px !important;
  overflow: auto;
  margin-top: 8px !important;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
}

/* Item d’activité */
.strava-activity {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  color: #0e0e48;
  cursor: pointer;
  font-size: 14px;
}

.strava-activity:hover {
  background: #f8fafc;
}

.strava-activity:last-child {
  border-bottom: none;
}

.strava-activity .title {
  font-weight: 600;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0e0e48;
}

.strava-activity .meta {
  font-size: 12px;
  color: #6b7280;
  text-align: right;
  flex: 1;
}

/* Footer modal */
.strava-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

#strava-disconnect {
  width: auto !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #ef4444;
  border-radius: 8px;
}

#strava-disconnect:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

#strava-cancel {
  width: auto !important;
  font-size: 14px !important;
  padding: 6px 12px !important;
}

/* =========================
   Bouton Commander
========================= */

.purchase-button-container {
  width: 100%;
  text-align: center;
  margin-top: 30px;
}

/* =========================
   Overlay chargement PDF
========================= */

.ygm-loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

.ygm-loading-overlay::before {
  content: '';
  position: absolute;
  inset: -10px;
  background: url('/static/images/chargement-affiche/running-optimized.webp')
    center/cover no-repeat;
  filter: blur(6px);
  transform: scale(1.04);
  z-index: -2;
}

.ygm-loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: -1;
}

/* Card de chargement */
.ygm-loading-card {
  position: relative;
  background: rgba(6, 10, 40, 0.97);
  border-radius: 20px;
  padding: 26px 30px 22px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  text-align: center;
  color: #f6f6ff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  animation: ygm-card-in 0.35s ease-out forwards;
}

@keyframes ygm-card-in {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ygm-loading-card h2 {
  margin: 10px 0 6px;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
}

.ygm-loading-card p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.88;
}

/* Spinner */
.ygm-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 3px solid rgba(250, 250, 255, 0.16);
  border-top-color: #f7c75a;
  border-right-color: #f7c75a;
  animation: ygm-spin 0.7s linear infinite;
}

@keyframes ygm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Barre de progression */
.ygm-progress {
  position: relative;
  margin-top: 14px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ygm-progress::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f7c75a, #ffdf8c, #f7c75a);
  transform: translateX(-60%);
  animation: ygm-progress-run 1.2s ease-in-out infinite;
}

@keyframes ygm-progress-run {
  0% {
    transform: translateX(-80%);
  }
  50% {
    transform: translateX(10%);
  }
  100% {
    transform: translateX(80%);
  }
}

/* =========================
   Steps / badges sous les onglets
========================= */

.ygm-steps-badge {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.step-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #e5e7eb;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-pill.active {
  background: #111827;
  color: #f9fafb;
}

/* =========================
   Petit résumé options
========================= */

.ygm-summary {
  margin: 18px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
}

.ygm-summary h4 {
  margin: 0 0 4px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
}

#ygm-summary-text {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

/* =========================
   Responsive tablette
========================= */

@media (max-width: 1024px) {
  .page-container {
    flex-direction: row;
    width: 94%;
  }
}

/* =========================
   Responsive mobile
========================= */

@media (max-width: 820px) {
  /* Titre plus petit */
  h1 {
    font-size: 32px;
    margin: 14px 0 6px;
    text-align: center;
  }

  .ygm-hero {
    padding-top: 4px;
    padding-bottom: 8px;
  }

  /* Layout colonne */
  .page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 0 10px 20px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: visible;
    gap: 14px;
  }

  .map-column,
  .center-column,
  .form-column {
    flex: none;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 0 12px 0;
    overflow: visible;
  }

  #map {
    width: 100%;
    max-width: 100%;
    height: 42vh;
    margin: 0 auto;
    border-radius: 18px;
  }

  #result-map {
    width: 100%;
    max-width: 100%;
    height: 50vh;
    margin: 0 auto;
    border-radius: 18px;
    border-width: 14px;
  }

  .tabs-container {
    border-radius: var(--studio-radius);
    padding: 12px;
    box-shadow: var(--studio-shadow);
  }

  .tab-header {
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
    margin-bottom: 12px;
  }

  .tab-content {
    border-radius: 0;
    box-shadow: none;
  }

  .tab-header button.tab-link {
    font-size: 11px;
    padding: 8px 6px;
    flex: 1;
    min-width: 0;
  }

  .form-group input[type='text'],
  .form-group select {
    width: 100%;
    max-width: 100%;
  }

  .bottom-container,
  .chart-column,
  .results-column {
    width: 100%;
    max-width: 100%;
  }

  #elevation_gain {
    width: 100%;
    height: 100%;
  }

  .purchase-button-container {
    width: 100%;
    text-align: center;
    margin-top: 18px;
  }

  #btn-purchase {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  /* Ensure purchase container is visible and provides spacing under the map */
  .purchase-button-container {
    padding: 18px 12px 28px; /* ensure it provides space and isn't collapsed */
    min-height: 48px;
    box-sizing: border-box;
    display: block;
    visibility: visible;
  }

  /* Make sure the button itself is visible when moved in the DOM */
  #btn-purchase {
    display: inline-block;
    visibility: visible;
  }

  /* When a GPX is loaded, make the purchase button fixed under the map for easy access */
  .purchase-visible-fixed {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 3000 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  }

  .switch-group,
  .deniv-group,
  .fill-group {
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  .switch-options,
  .deniv-options,
  .fill-options {
    width: auto;
    gap: 6px;
  }

  .switch-option label,
  .deniv-option label,
  .fill-option label {
    padding: 8px 12px;
    font-size: 12px;
  }

  .center-column {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
    padding: 12px 10px 20px;
  }
}

/* =========================
   MAP STYLES — CARROUSEL MODERNE
   (onglet "Ta carte")
========================= */

/* Wrapper avec flèches */
.map-style-options-wrapper {
  position: relative;
  width: 100%;
  overflow: visible;
  padding: 8px 0;
  margin: 12px 0;
}

/* Bande scrollable horizontale */
.map-style-options {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100px;
  grid-template-rows: repeat(3, auto);
  gap: 12px;
  padding: 12px 8px 16px;
  margin: 0;
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  align-content: start;
  /* no max-height here — allow natural vertical expansion */
}

.map-style-options::-webkit-scrollbar {
  display: none;
}

/* Chaque style = petite carte verticale */
.map-style-options > div {
  width: 100px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 12px;
  min-height: 120px;
  border-radius: var(--studio-radius);
  background: var(--studio-surface);
  border: 1px solid var(--studio-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  transition: var(--studio-transition);
}

.map-style-options > div:hover {
  box-shadow: var(--studio-shadow);
  transform: translateY(-2px);
}

/* Aperçu rond */
.map-style-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid transparent;
  cursor: pointer;
  transition: var(--studio-transition);
}

/* Fallback image inside the circle to ensure thumbnail is visible */
.map-style-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Hover / focus */
.map-style-circle:hover,
.map-style-circle:focus-visible {
  transform: scale(1.08);
  border-color: rgba(201, 162, 39, 0.4);
}

/* Style sélectionné */
.map-style-circle.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}

/* Nom du style + "best seller" */
.map-style-options .style-name {
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.2;
}

.map-style-options .best-seller-tag {
  font-size: 9px;
  margin: 4px 0 0;
  line-height: 1;
  color: #fff;
  font-weight: 700;
  background: var(--gold);
  padding: 3px 8px;
  border-radius: 4px;
}

/* Flèches gauche/droite (➜) pour TOUS les carrousels horizontaux
   - Styles de carte
   - Couleurs de tracé
   - Couleurs de dénivelé
   - Couleurs de texte
*/
.map-style-options-wrapper .scroll-hint-right,
.map-style-options-wrapper .scroll-hint-left,
.trace-colors-wrapper .scroll-hint-right,
.trace-colors-wrapper .scroll-hint-left {
  position: absolute;
  top: 50%;
  font-size: 26px;
  color: #0e0e48;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Flèche droite */
.map-style-options-wrapper .scroll-hint-right,
.trace-colors-wrapper .scroll-hint-right {
  right: 4px;
  transform: translateY(-50%);
  animation: map-pulse-right 1s infinite alternate;
}

/* Flèche gauche (symétrique) */
.map-style-options-wrapper .scroll-hint-left,
.trace-colors-wrapper .scroll-hint-left {
  left: 4px;
  transform: translateY(-50%) scaleX(-1);
  animation: map-pulse-left 1s infinite alternate;
}

/* État visible (piloté en JS avec .visible) */
.map-style-options-wrapper .scroll-hint-right.visible,
.map-style-options-wrapper .scroll-hint-left.visible,
.trace-colors-wrapper .scroll-hint-right.visible,
.trace-colors-wrapper .scroll-hint-left.visible {
  opacity: 0.35;
}

@keyframes map-pulse-right {
  from { transform: translateY(-50%) translateX(0); }
  to   { transform: translateY(-50%) translateX(4px); }
}

@keyframes map-pulse-left {
  from { transform: translateY(-50%) translateX(0) scaleX(-1); }
  to   { transform: translateY(-50%) translateX(-4px) scaleX(-1); }
}

/* Sur mobile : un peu plus compact */
@media (max-width: 820px) {
  .map-style-options { grid-auto-columns: 100px; max-height: none; overflow-y: visible; }
  .map-style-options > div {
    width: 100px;
    padding: 4px 2px 6px;
  }
  .map-style-circle {
    width: 64px;
    height: 64px;
  }
}

#tab-options {
  height: auto !important;
  min-height: 0 !important;
}

#hidden-container {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}



/* =========================================
   SECTION PROMO – VERSION PREMIUM
   ========================================= */

.ygb-promo {
  padding: 60px 0;
  background: #f7f7f8; /* fond très léger, moderne */
}

.ygb-promo-box {
  position: relative;
  padding: 32px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #fdf9e8 60%);
  border: 1px solid #ece5c6;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

/* Badge -20% */
.ygb-promo-badge {
  position: absolute;
  top: -14px;
  right: -14px;
  background: #c9a227;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(201,162,39,0.35);
  letter-spacing: 0.02em;
}

/* Eyebrow */
.ygb-promo-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #7c7c7c;
  margin-bottom: 4px;
}

/* Titre */
.ygb-promo h2 {
  font-size: clamp(26px, 3vw, 34px);
  margin: 0;
  font-weight: 800;
  color: #0e0e48;
}

/* Description */
.ygb-promo-desc {
  font-size: 1rem;
  line-height: 1.6;
  margin: 8px 0 18px;
  color: #4b5563;
}

/* Prix */
.ygb-promo-prices {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 4vw, 50px);
  margin-bottom: 10px;
}

.ygb-price-original,
.ygb-price-new {
  padding: 14px 22px;
  border-radius: 16px;
  min-width: 150px;
}

.ygb-price-original span,
.ygb-price-new span {
  font-size: 1.78rem;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.12em;
}

.ygb-price-original strong {
  display: block;
  margin-top: 20px;
  font-size: 1.2rem;
  color: #9ca3af;
  text-decoration: line-through;
  margin-left: 100px;
}

.ygb-price-new strong {
  display: block;
  margin-top: 4px;
  font-size: 2.4rem;
  color: #c9a227;
  font-weight: 800;
  margin-left: -120px;
}

/* Note */
.ygb-promo-note {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #6b7280;
}

/* CTA */
.ygb-promo-btn {
  margin: 8px auto 0 auto;
}

/* Responsive */
@media (max-width: 640px) {
  .ygb-promo-box {
    padding: 28px 20px;
    text-align: left;
  }

  .ygb-promo-prices {
    flex-direction: column;
    align-items: flex-start;
  }

  .ygb-promo-badge {
    right: 8px;
    top: -12px;
  }
}

/* =========================
   Styles textuels utilitaires
   ========================= */

.gold {
  color: #c9a227;
  font-weight: 900;
  font-size: 1.3em;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 0.55px 0 #c9a227;
}

.gras {
  color: #0e0e48;
  font-weight: 900;
  font-size: 1.1em;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 0.55px 0 #0e0e48;
}

.gras2 {
  color: #c9a227;
  font-weight: 900;
  font-size: 1em;
  -webkit-font-smoothing: antialiased;
}

/* =========================
   PRODUCT INFO — Style FAQ (clean)
   ========================= */

:root{
  --pinfo-text-main: #0f172a;
  --pinfo-text-muted: #4b5563;
  --pinfo-surface: #f7f8fc;
  --pinfo-border: rgba(15, 23, 42, 0.08);
  --pinfo-gold: var(--gold, #c9a227);
}

/* Wrapper */
.pinfo{
  width: 100%;
  max-width: 1120px;
  margin: 26px auto 0;
}

/* Header */
.pinfo-hero{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.pinfo-kicker{
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9ca3af;
}

.pinfo-title{
  margin: 4px 0 0;
  font-family: 'Bebas Neue','Oswald',Arial,sans-serif;
  letter-spacing: .08em;
  color: var(--pinfo-text-main);
  font-size: clamp(20px, 2.2vw, 28px);
}

.pinfo-sub{
  margin: 6px 0 0;
  color: var(--pinfo-text-muted);
  line-height: 1.55;
}

/* Nav (inspiré faq-nav mais plus plat) */
.pinfo-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 2px 0 0;
}

.pinfo-nav-link{
  position: relative;
  font-size: 0.92rem;
  color: #4b5563;
  padding: 7px 10px 7px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, transform .16s ease;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.pinfo-nav-link::before{
  content: "●";
  position: absolute;
  left: 7px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.55rem;
  color: rgba(148, 163, 184, 0.9);
}

.pinfo-nav-link:hover{
  color: var(--pinfo-text-main);
  background: rgba(201, 162, 39, 0.08);
  transform: translateX(2px);
}

.pinfo-nav-link:focus-visible{
  outline: 2px solid var(--pinfo-gold);
  outline-offset: 2px;
}

/* Accordion container (comme faq-accordion) */
.pinfo-accordion{
  border-radius: 20px;
  background: var(--pinfo-surface);
  border: 1px solid var(--pinfo-border);
  box-shadow:
    0 16px 42px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.85);
  padding: 16px 16px 18px;
}

/* Block title (comme faq-block-title) */
.pinfo-block-title{
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9ca3af;
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pinfo-block-title::before{
  content: "◎";
  font-size: 0.65rem;
  color: rgba(148, 163, 184, 0.9);
}

.pinfo-block-title:first-of-type{ margin-top: 2px; }

/* Details item (copie de logique faq-item, mais renommée) */
.pinfo-item{
  border-radius: 14px;
  background: transparent;
  padding: 4px 6px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .16s ease;
}

.pinfo-item[open]{
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

/* Summary */
.pinfo-item > summary{
  list-style: none;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 520;
  color: var(--pinfo-text-main);
  display:flex;
  align-items:center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px; /* allow space for scroll on small screens */
}

.pinfo-item > summary::-webkit-details-marker{ display:none; }

.pinfo-item > summary::after{
  content: "＋";
  font-size: 1.25rem;
  line-height: 1;
  color: #cbd5f5;
  flex-shrink: 0;
  transition: transform .22s ease, color .18s ease, opacity .18s ease;
}

.pinfo-item[open] > summary::after{
  transform: rotate(45deg);
  color: #94a3b8;
  opacity: .9;
}

.pinfo-item > summary:focus-visible{
  outline: 2px solid var(--pinfo-gold);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Panel */
.pinfo-panel{
  padding: 0 2px 2px;
  font-size: 0.94rem;
  color: var(--pinfo-text-muted);
  line-height: 1.6;
  animation: pinfoPanelIn .24s ease-out;
}

@keyframes pinfoPanelIn{
  from{ opacity:0; transform: translateY(-3px); }
  to{ opacity:1; transform: translateY(0); }
}

.pinfo-panel p{ margin: 0 0 10px; }

.pinfo-note{
  margin-top: 10px;
  font-size: .9rem;
  color: #6b7280;
}

.pinfo-mini{
  margin-top: 10px;
  font-size: .9rem;
  color: #6b7280;
}

/* Lists + sizes */
.pinfo-list{
  margin: 0;
  padding-left: 18px;
}

.pinfo-sizes{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin: 8px 0 4px;
}

.pinfo-size{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255,255,255,.75);
}

.pinfo-size strong{
  font-family: 'Bebas Neue','Oswald',Arial,sans-serif;
  letter-spacing: .10em;
}

/* Responsive */
@media (max-width: 640px){
  .pinfo{ margin-top: 18px; }
  .pinfo-accordion{ border-radius: 16px; padding: 12px 12px 14px; }
  .pinfo-sizes{ grid-template-columns: 1fr; }
  .pinfo-item > summary{ font-size: 0.95rem; padding: 7px 2px; }
  .pinfo-panel{ font-size: 0.9rem; }
}


.pinfo-block-title{
  scroll-margin-top: 90px;
}

/* =========================
   SECTION – EXPLICATION YGM
========================= */

.ygm-explain {
  padding: 64px 0;
  background: #f7f8fc;
}

.ygm-explain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.ygm-explain-visual img {
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.ygm-explain-content h2 {
  font-family: 'Designer', system-ui, sans-serif;
  font-size: clamp(28px, 3.2vw, 42px);
  margin-bottom: 14px;
}

.ygm-explain-content .lead {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #5b6f95;
  margin-bottom: 18px;
}

.ygm-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.ygm-features li {
  margin-bottom: 10px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #0e0e48;
}

.ygm-explain-content .closing {
  margin-top: 14px;
  font-size: 1rem;
  color: #0e0e48;
}

@media (max-width: 900px) {
  .ygm-explain-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ygm-explain-content ul {
    text-align: left;
  }
}

/* ------- DIVIDER (full-bleed) ------- */
.ridge-divider{
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  box-sizing: border-box;
  height: 180px;               /* hauteur élargie pour afficher la bande complète */
  overflow: hidden;
  background: transparent;
  margin-top: 20px;
}
.ridge-divider svg{
  position:absolute; left:0; top:0; width:100%; height:100%;
  display:block;
}
.ridge-divider .ridge{ fill: #ffffff; opacity:.1; }
.ridge-divider .far{ opacity:.005; }
.ridge-divider .mid{ opacity:.05; }

.ridge-image {
  width: 100%;
  max-width: none;
  height: 100%;
  display: block;
  margin: 0;
  object-fit: contain;   /* show entire image within the divider */
  object-position: center center; /* center the image vertically/horizontally */
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  padding-left: 8px;
  padding-right: 8px;

/* --- Specific overrides for Adjust D+ input to match chrono selects --- */
.form-group.adjust-dplus-group #adjustedDplus{
  -webkit-appearance: none !important;
  appearance: none !important;
  background: #ffffff !important;
  border: 1px solid #ddd !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
  color: #0e0e48 !important;
  font-size: 1rem !important;
  width: 72px !important;
  max-width: 72px !important;
  text-align: center !important;
  display: inline-block !important;
  font-family: 'Oswald', sans-serif !important;
}
.form-group.adjust-dplus-group #adjustedDplus::placeholder{ color: #6b7280 !important; text-align: center !important; }
.form-group.adjust-dplus-group .unit{ color: #0e0e48 !important; font-weight:700 !important; margin-left:6px !important; font-size:1rem !important; }
.form-group.adjust-dplus-group .form-note{ margin:6px 0 0 !important; font-size:0.78rem !important; color: #9aa3b2 !important; max-width:360px !important; line-height:1.2 !important; font-style: italic !important; }