/**
 * Barre de navigation inférieure — mobile & tablette
 * Palette Sugar Paper : rose, doré, orange terre, marron, turquoise
 */

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

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

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

  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-bottom-nav .social-floating {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    right: 14px;
  }
}

.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10020;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-around;
  min-height: unset;
  overflow: visible;
  background: #ffffff;
  border-top: 1px solid rgba(229, 72, 138, 0.18);
  box-shadow: 0 -6px 28px rgba(107, 47, 32, 0.1);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  gap: 4px;
}

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

.bottom-nav-item {
  flex: 1;
  min-width: 0;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  text-decoration: none;
  color: #6b2f20;
  cursor: pointer;
  border-radius: 16px;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: var(--font-corps, 'Poppins', sans-serif);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:hover {
  text-decoration: none;
}

.bottom-nav-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  color: var(--texte-fonce, #3d2800);
}

.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--couleur-dominante, #e5488a);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(229, 72, 138, 0.35);
}

/* Accueil — rose principal */
.bottom-nav-item--accueil .bottom-nav-icon {
  background: rgba(229, 72, 138, 0.12);
  color: var(--couleur-dominante, #e5488a);
}

.bottom-nav-item--accueil.is-active {
  background: rgba(229, 72, 138, 0.1);
}

.bottom-nav-item--accueil.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #e5488a, #c26638);
  color: #fff;
  box-shadow: var(--ombre-promo, 0 4px 15px rgba(229, 72, 138, 0.25));
}

.bottom-nav-item--accueil.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Produits — doré / beige */
.bottom-nav-item--produits .bottom-nav-icon {
  background: rgba(145, 138, 68, 0.14);
  color: #918a44;
}

.bottom-nav-item--produits.is-active {
  background: rgba(145, 138, 68, 0.12);
}

.bottom-nav-item--produits.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #918a44, #6b2f20);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 47, 32, 0.22);
}

.bottom-nav-item--produits.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Panier — orange terre */
.bottom-nav-item--panier .bottom-nav-icon {
  background: rgba(194, 102, 56, 0.14);
  color: #c26638;
}

.bottom-nav-item--panier.is-active {
  background: rgba(194, 102, 56, 0.1);
}

.bottom-nav-item--panier.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #c26638, #6b2f20);
  color: #fff;
  box-shadow: 0 4px 14px rgba(194, 102, 56, 0.28);
}

.bottom-nav-item--panier.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Compte — marron foncé */
.bottom-nav-item--compte .bottom-nav-icon {
  background: rgba(107, 47, 32, 0.1);
  color: #6b2f20;
}

.bottom-nav-item--compte.is-active {
  background: rgba(107, 47, 32, 0.08);
}

.bottom-nav-item--compte.is-active .bottom-nav-icon {
  background: #6b2f20;
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 47, 32, 0.25);
}

.bottom-nav-item--compte.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Menu — turquoise secondaire */
.bottom-nav-item--menu .bottom-nav-icon {
  background: rgba(32, 197, 199, 0.14);
  color: var(--turquoise, #20c5c7);
}

.bottom-nav-item--menu.is-open {
  background: rgba(32, 197, 199, 0.1);
}

.bottom-nav-item--menu.is-open .bottom-nav-icon {
  background: linear-gradient(135deg, #20c5c7, #918a44);
  color: #fff;
  box-shadow: 0 4px 14px rgba(32, 197, 199, 0.3);
}

.bottom-nav-item--menu.is-open .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Invoice admin — rose principal */
.bottom-nav-item--invoice .bottom-nav-icon {
  background: rgba(229, 72, 138, 0.12);
  color: var(--couleur-dominante, #e5488a);
}

.bottom-nav-item--invoice.is-active {
  background: rgba(229, 72, 138, 0.1);
}

.bottom-nav-item--invoice.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #e5488a, #c26638);
  color: #fff;
  box-shadow: var(--ombre-promo, 0 4px 15px rgba(229, 72, 138, 0.25));
}

.bottom-nav-item--invoice.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Devis admin — accent promo */
.bottom-nav-item--devis .bottom-nav-icon {
  background: rgba(247, 127, 0, 0.14);
  color: var(--accent-promo, #f77f00);
}

.bottom-nav-item--devis.is-active {
  background: rgba(247, 127, 0, 0.1);
}

.bottom-nav-item--devis.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #f77f00, #c26638);
  color: #fff;
  box-shadow: 0 4px 14px rgba(247, 127, 0, 0.28);
}

.bottom-nav-item--devis.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Facture admin — turquoise */
.bottom-nav-item--facture .bottom-nav-icon {
  background: rgba(32, 197, 199, 0.14);
  color: #20c5c7;
}

.bottom-nav-item--facture.is-active {
  background: rgba(32, 197, 199, 0.1);
}

.bottom-nav-item--facture.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #20c5c7, #918a44);
  color: #fff;
  box-shadow: 0 4px 14px rgba(32, 197, 199, 0.28);
}

.bottom-nav-item--facture.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Contacts admin — doré */
.bottom-nav-item--contacts .bottom-nav-icon {
  background: rgba(145, 138, 68, 0.14);
  color: #918a44;
}

.bottom-nav-item--contacts.is-active {
  background: rgba(145, 138, 68, 0.1);
}

.bottom-nav-item--contacts.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #918a44, #c26638);
  color: #fff;
  box-shadow: 0 4px 14px rgba(145, 138, 68, 0.28);
}

.bottom-nav-item--contacts.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Rapports admin — marron */
.bottom-nav-item--rapports .bottom-nav-icon {
  background: rgba(107, 47, 32, 0.1);
  color: #6b2f20;
}

.bottom-nav-item--rapports.is-active {
  background: rgba(107, 47, 32, 0.08);
}

.bottom-nav-item--rapports.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #6b2f20, #c26638);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 47, 32, 0.25);
}

.bottom-nav-item--rapports.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Commandes admin — même palette que panier (orange terre) */
.bottom-nav-item--commandes .bottom-nav-icon {
  background: rgba(194, 102, 56, 0.14);
  color: #c26638;
}

.bottom-nav-item--commandes.is-active {
  background: rgba(194, 102, 56, 0.1);
}

.bottom-nav-item--commandes.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #c26638, #6b2f20);
  color: #fff;
  box-shadow: 0 4px 14px rgba(194, 102, 56, 0.28);
}

.bottom-nav-item--commandes.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Profil admin — marron */
.bottom-nav-item--profil .bottom-nav-icon {
  background: rgba(107, 47, 32, 0.1);
  color: #6b2f20;
}

.bottom-nav-item--profil.is-active {
  background: rgba(107, 47, 32, 0.08);
}

.bottom-nav-item--profil.is-active .bottom-nav-icon {
  background: #6b2f20;
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 47, 32, 0.25);
}

.bottom-nav-item--profil.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Comptes admin — doré */
.bottom-nav-item--comptes .bottom-nav-icon {
  background: rgba(145, 138, 68, 0.14);
  color: #918a44;
}

.bottom-nav-item--comptes.is-active {
  background: rgba(145, 138, 68, 0.12);
}

.bottom-nav-item--comptes.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #918a44, #6b2f20);
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 47, 32, 0.22);
}

.bottom-nav-item--comptes.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Paramètres admin — turquoise */
.bottom-nav-item--parametres .bottom-nav-icon {
  background: rgba(32, 197, 199, 0.14);
  color: var(--turquoise, #20c5c7);
}

.bottom-nav-item--parametres.is-active {
  background: rgba(32, 197, 199, 0.1);
}

.bottom-nav-item--parametres.is-active .bottom-nav-icon {
  background: linear-gradient(135deg, #20c5c7, #918a44);
  color: #fff;
  box-shadow: 0 4px 14px rgba(32, 197, 199, 0.3);
}

.bottom-nav-item--parametres.is-active .bottom-nav-label {
  color: #6b2f20;
  font-weight: 700;
}

/* Nav contable : 3 items équilibrés */
.bottom-nav--contable .bottom-nav-item {
  max-width: none;
}

/* Admin — padding contenu */
@media (max-width: 992px) {
  html.has-admin-bottom-nav .admin-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    padding-left: 6px;
    padding-right: 6px;
    gap: 2px;
  }

  .bottom-nav-item {
    padding: 5px 2px;
  }

  .bottom-nav-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .bottom-nav-label {
    font-size: 10px;
  }
}
