/**
 * Barre de navigation inférieure — mobile & tablette
 * Style flottant avec bouton central surélevé (notch)
 * Palette YAYEMATY
 */

@media (min-width: 993px) {
  .bottom-nav {
    display: none !important;
  }
}

@media (max-width: 992px) {
  html.has-bottom-nav body {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }

  html.has-bottom-nav .user-content,
  html.has-bottom-nav .admin-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  html.has-admin-bottom-nav .admin-content {
    padding-top: clamp(12px, 2.5vw, 20px) !important;
  }

  html.has-user-bottom-nav .user-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  html.has-bottom-nav .social-floating {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    right: clamp(0.6rem, 2vw, 0.9rem);
  }
}

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10020;
  width: 100%;
  min-height: 62px;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: env(safe-area-inset-left, 0px) !important;
  padding-right: env(safe-area-inset-right, 0px) !important;
  box-sizing: border-box;
  border: none;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0;
}

.bottom-nav--has-center {
  padding-top: 28px;
}

@media (max-width: 992px) {
  .bottom-nav {
    display: flex;
  }

  .bottom-nav--contable,
  .bottom-nav--livreur,
  .bottom-nav--user,
  .bottom-nav--has-center {
    justify-content: space-between;
  }
}

/* Surface blanche flottante */
.bottom-nav::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  border-radius: 0;
  background: var(--color-blanc);
  box-shadow:
    0 -2px 16px rgba(var(--color-noir-rgb), 0.08),
    0 1px 6px rgba(var(--color-noir-rgb), 0.06);
  z-index: 0;
}

.bottom-nav--has-center::before {
  top: 22px;
  border-radius: 0;
}

/* Encoche concave autour du bouton central (suit la position de l'item) */
.bottom-nav-item--center::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: 22px;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 14px 0, transparent 13px, var(--color-blanc) 14px)
      0 0 / 50% 100% no-repeat,
    radial-gradient(
        circle at calc(100% - 14px) 0,
        transparent 13px,
        var(--color-blanc) 14px
      )
      100% 0 / 50% 100% no-repeat;
}

.bottom-nav-item {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px 0 2px;
  border: none;
  background: transparent;
  text-decoration: none;
  color: var(--color-gris);
  cursor: pointer;
  font-family: var(--font-corps, "Poppins", sans-serif);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
}

.bottom-nav-item--dashboard.is-active .bottom-nav-icon {
  background: rgba(var(--color-orange-rgb), 0.12);
  color: var(--color-orange);
}

.bottom-nav-item--dashboard.is-active .bottom-nav-label {
  color: var(--color-orange);
  font-weight: 700;
}

.bottom-nav-item:hover {
  text-decoration: none;
  color: var(--color-noir);
}

.bottom-nav-icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--color-noir);
  color: var(--color-blanc);
  flex-shrink: 0;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.bottom-nav-label {
  font-size: 1.2rem; /* 12px @ html 10px (boutique) */
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  color: var(--color-gris);
  width: 100%;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
  transition:
    color 0.2s ease,
    font-weight 0.2s ease;
}

.bottom-nav-item.is-active .bottom-nav-label,
.bottom-nav-item--menu.is-open .bottom-nav-label {
  color: var(--color-noir);
  font-weight: 600;
}

.bottom-nav-item.is-active:not(.bottom-nav-item--center) .bottom-nav-icon,
.bottom-nav-item--menu.is-open .bottom-nav-icon {
  background: var(--color-noir);
  box-shadow: 0 4px 14px rgba(var(--color-noir-rgb), 0.22);
}

.bottom-nav-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e53935;
  color: var(--color-blanc);
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-blanc);
  box-shadow: 0 2px 6px rgba(229, 57, 53, 0.35);
}

/* Bouton central surélevé (FAB) */
.bottom-nav-item--center {
  padding-top: 0;
}

.bottom-nav-item--center .bottom-nav-icon {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    var(--color-orange),
    var(--color-orange-dark)
  );
  color: var(--color-blanc);
  font-size: 22px;
  border: 5px solid var(--color-blanc);
  box-shadow:
    0 8px 24px rgba(var(--color-orange-rgb), 0.38),
    0 2px 8px rgba(var(--color-noir-rgb), 0.08);
  z-index: 3;
}

.bottom-nav-item--center .bottom-nav-label {
  margin-top: 30px;
}

.bottom-nav-item--center.is-active .bottom-nav-icon,
.bottom-nav-item--center:hover .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-orange-dark),
    var(--color-orange)
  );
  transform: translateX(-50%) scale(1.04);
}

.bottom-nav-item--center.is-active .bottom-nav-label {
  color: var(--color-orange-dark);
  font-weight: 600;
}

.bottom-nav-item--center .bottom-nav-badge {
  top: -2px;
  right: -2px;
  z-index: 4;
}

/* Couleurs par onglet — boutique */
.bottom-nav-item--accueil .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-bleu),
    var(--color-bleu-dark)
  );
}

.bottom-nav-item--accueil.is-active .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-bleu-dark),
    var(--color-bleu)
  );
  box-shadow: 0 4px 14px rgba(var(--color-bleu-rgb), 0.35);
}

.bottom-nav-item--produits .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-orange),
    var(--color-orange-dark)
  );
}

.bottom-nav-item--produits.is-active .bottom-nav-icon {
  box-shadow: 0 4px 14px rgba(var(--color-orange-rgb), 0.35);
}

.bottom-nav-item--compte .bottom-nav-label {
  max-width: none;
}

.bottom-nav-item--compte .bottom-nav-icon {
  background: var(--color-noir);
}

.bottom-nav-item--compte.is-active .bottom-nav-icon {
  background: var(--color-noir-soft);
  box-shadow: 0 4px 14px rgba(var(--color-noir-rgb), 0.25);
}

.bottom-nav-item--menu .bottom-nav-icon {
  background: var(--color-gris);
}

.bottom-nav-item--menu.is-open .bottom-nav-icon,
.bottom-nav-item--menu.is-active .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-jaune-dark),
    var(--color-jaune)
  );
  color: var(--color-noir);
  box-shadow: 0 4px 14px rgba(var(--color-jaune-rgb), 0.35);
}

/* Couleurs — admin / user dashboard */
.bottom-nav-item--invoice .bottom-nav-icon,
.bottom-nav-item--facture .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-orange),
    var(--color-orange-dark)
  );
}

.bottom-nav-item--devis .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-jaune),
    var(--color-jaune-dark)
  );
  color: var(--color-noir);
}

.bottom-nav-item--contacts .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-bleu),
    var(--color-bleu-dark)
  );
}

.bottom-nav-item--rapports .bottom-nav-icon {
  background: var(--color-noir);
}

.bottom-nav-item--commandes.bottom-nav-item--center .bottom-nav-icon,
.bottom-nav-item--zones.bottom-nav-item--center .bottom-nav-icon,
.bottom-nav-item--parametres.bottom-nav-item--center .bottom-nav-icon,
.bottom-nav-item--contacts.bottom-nav-item--center .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-orange),
    var(--color-orange-dark)
  );
}

.bottom-nav-item--map .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-bleu),
    var(--color-bleu-dark)
  );
}

.bottom-nav-item--livreurs .bottom-nav-icon {
  background: var(--color-noir);
}

.bottom-nav-item--profil .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-gris),
    var(--color-noir-soft)
  );
}

/* Espace client — tableau de bord */
.bottom-nav--user {
  justify-content: space-between;
}

.bottom-nav--user .bottom-nav-item--dashboard .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-bleu),
    var(--color-bleu-dark)
  );
}

.bottom-nav--user .bottom-nav-item--dashboard.is-active .bottom-nav-icon {
  box-shadow: 0 4px 14px rgba(var(--color-bleu-rgb), 0.35);
}

.bottom-nav--user .bottom-nav-item--mes-commandes .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-orange),
    var(--color-orange-dark)
  );
}

.bottom-nav--user .bottom-nav-item--mes-commandes.is-active .bottom-nav-icon {
  box-shadow: 0 4px 14px rgba(var(--color-orange-rgb), 0.35);
}

.bottom-nav--user .bottom-nav-item--livres .bottom-nav-icon {
  background: linear-gradient(145deg, #2e7d4f, #1b5e3a);
}

.bottom-nav--user .bottom-nav-item--livres.is-active .bottom-nav-icon {
  box-shadow: 0 4px 14px rgba(46, 125, 79, 0.35);
}

.bottom-nav--user .bottom-nav-item--profil.is-active .bottom-nav-icon {
  box-shadow: 0 4px 14px rgba(var(--color-noir-rgb), 0.25);
}

.bottom-nav-item--logout .bottom-nav-icon {
  background: #c62828;
}

.bottom-nav-item--comptes .bottom-nav-icon {
  background: linear-gradient(
    145deg,
    var(--color-bleu),
    var(--color-bleu-dark)
  );
}

.bottom-nav-item--parametres:not(.bottom-nav-item--center) .bottom-nav-icon {
  background: var(--color-noir);
}

.bottom-nav-item.is-active:not(.bottom-nav-item--center) .bottom-nav-label {
  color: var(--color-noir);
}

/* Admin : racine navigateur ~16px (style.css html 10px non chargé) */
.bottom-nav--admin .bottom-nav-label {
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}

.bottom-nav--admin .bottom-nav-item--dashboard.is-active .bottom-nav-label {
  font-weight: 600;
}

@media (max-width: 380px) {
  .bottom-nav-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .bottom-nav-item--center .bottom-nav-icon {
    width: 52px;
    height: 52px;
    top: -30px;
    font-size: 20px;
    border-width: 4px;
  }

  .bottom-nav-item--center .bottom-nav-label {
    margin-top: 26px;
  }

  .bottom-nav-label {
    font-size: 1.1rem;
  }

  .bottom-nav--admin .bottom-nav-label {
    font-size: 0.7rem;
  }
}
