/* Barre du bas (mobile) : remplace celle du framework.
 * Une pilule blanche posée au-dessus du contenu, l'onglet courant dans une pastille pêche. */
.bottomMenu {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom) * 0.6);
  z-index: 100;
  padding: 6px;
  border-radius: 999px;
  background-color: rgb(var(--background-primary));
  color: rgb(var(--text-primary));
  box-shadow: 0 12px 32px -12px rgba(42, 35, 64, 0.45); /* taste-skill-ignore : élément flottant (menu, fenêtre, barre) */
}

.bottomMenu .row {
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;

  /* Onglets de même largeur, mais jamais plus étroits que leur plus long mot (« Institutions ») */
  & .MenuElement {
    flex: 1 1 0;
    width: auto;
    min-width: min-content;
    min-height: 54px;
    padding: 6px 4px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 999px;
    color: rgb(var(--text-secondary));
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;

    & svg {
      width: 24px;
      height: 24px;
    }

    /* Libellé sur deux lignes au plus (« Institutions familiales ») */
    & .label {
      max-width: 100%;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      text-align: center;
      white-space: normal;
      overflow-wrap: normal;
      font-size: 0.68rem;
      font-weight: 700;
      line-height: 1.15;
    }

    /* Les mots d'un enfant dépendent de la liste des enfants : même onglet allumé */
    &:has(.icon_selected:not(.d-none)),
    #page-mots_denfants &:has(input[value="liste_des_enfants"]) {
      background-color: rgb(var(--pastel-peche));
      color: rgb(var(--text-primary));
    }

    &:active {
      transform: scale(0.94);
    }
  }

  & .dropdown-BottomMenu {
    min-width: 0;
    width: calc(100vw - 24px);
    padding: 8px;
    border: none;
    border-radius: 24px;
    background-color: rgb(var(--background-primary)) !important;
    box-shadow: 0 12px 32px -12px rgba(42, 35, 64, 0.45); /* taste-skill-ignore : élément flottant (menu, fenêtre, barre) */
    margin-bottom: 10px !important;

    & .dropdown-item {
      min-height: 44px;
      display: flex;
      align-items: center;
      padding: 0 16px;
      border-radius: 16px;
      font-weight: 700;
      color: rgb(var(--text-primary));
    }

    & .dropdown-item:hover,
    & .dropdown-item:focus {
      background-color: rgb(var(--background-secondary));
    }
  }
}

.scaleMenuElement {
  transform: scale(0.94);
}

/* Réserve la place de la barre en bas de page */
.bottomMenuSpace {
  height: calc(66px + 24px);
  padding-bottom: env(safe-area-inset-bottom) !important;
}

@media (prefers-reduced-motion: reduce) {
  .bottomMenu .row .MenuElement {
    transition: none;
  }
}
