/**
 * Moto — feuille basse rétractable + poignée (v1.0.0-sheet).
 * Poignée pleine largeur (cible tactile confortable), pastille aux
 * couleurs de la marque, libellé d'aide quand la feuille est repliée.
 */

.moto-sheet-grip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  min-height: 30px;
  padding: 0.5rem 0 0.4rem;
  border: none;
  background: transparent;
  /* Le geste vertical pilote la feuille, il ne scrolle pas la page. */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.moto-sheet-grip__pill {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--moto-gradient, linear-gradient(90deg, #ff5f4d, #7b39b7));
  opacity: 0.72;
  transition: width 0.18s ease, opacity 0.18s ease;
}

.moto-sheet-grip:active .moto-sheet-grip__pill,
.moto-sheet-grip.is-grabbing .moto-sheet-grip__pill {
  width: 58px;
  opacity: 1;
}

/* Aide affichée seulement une fois la feuille rangée. */
.moto-sheet-grip__hint {
  height: 0;
  overflow: hidden;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-soft, #615073);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.moto-sheet--collapsed .moto-sheet-grip__hint {
  height: auto;
  opacity: 1;
}

/* Pendant la mesure des deux bornes : aucune animation. */
.moto-sheet--measuring {
  transition: none !important;
}

/* —— Passager : feuille d'accueil —— */
#screen-book .uber-sheet--home {
  transition: max-height 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}

#screen-book .uber-sheet--home.moto-sheet--collapsed {
  max-height: calc(56px + var(--safe-bottom, 0px));
}

/* —— Chauffeur : dock d'accueil —— */
#screen-home .uber-dock--home {
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}

#screen-home .uber-dock--home.moto-sheet--collapsed {
  max-height: calc(54px + var(--safe-bottom, 0px));
}

/* Contenu rangé : retiré du parcours de tabulation et des lecteurs
   d'écran une fois l'animation finie (le clip visuel ne suffit pas). */
.moto-sheet--collapsed > *:not(.moto-sheet-grip) {
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  #screen-book .uber-sheet--home,
  #screen-home .uber-dock--home,
  .moto-sheet-grip__pill,
  .moto-sheet-grip__hint {
    transition: none;
  }
}
