/* ===================================================
   📱 STRUCTURE MOBILE / ANDROID / PWA – VERSION PRO
   =================================================== */

/* ❌ NAVBAR DESKTOP MASQUÉE SUR MOBILE */
@media (max-width: 768px) {
  .navbar.fixed-top {
    display: none !important;
  }
}

/* ===================================================
   🔝 HEADER MOBILE
   =================================================== */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 64px;
  background: #d9f08c;

  display: flex;
  align-items: center;
  justify-content: space-between;

  z-index: 10000;
}

/* Logo */
.mobile-logo {
  font-size: 16px;
  font-weight: 700;
}

/* Icônes */
.mobile-nav i {
  font-size: 20px;
}

/* Badge panier */
.mobile-badge {
  font-size: 11px;
  padding: 2px 6px;
}

/* ===================================================
   🔽 MENU MOBILE SLIDE-DOWN
   =================================================== */
.mobile-menu {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;

  background: #fff;
  z-index: 9999;

  transform: translateY(-20px);
  opacity: 0;
  pointer-events: none;
  transition: all .3s ease;
}

.mobile-menu.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu a {
  display: block;
  padding: 14px 18px;
  text-decoration: none;
  color: #333;
}

/* ===================================================
   📂 CATÉGORIES SCROLL
   =================================================== */
.categories-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
}

.categories-scroll .btn {
  white-space: nowrap;
  border-radius: 20px;
}

/* ===================================================
   🔻 BOTTOM NAV ANDROID
   =================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  height: 64px;
  background: #d9f08c;

  display: flex;
  justify-content: space-around;
  align-items: center;

  z-index: 10000;
  box-shadow: 0 -3px 10px rgba(0,0,0,.15);
}

.bottom-nav a {
  text-decoration: none;
  color: #333;
  font-size: 12px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bottom-nav a i {
  font-size: 22px;
}

.bottom-nav a.active {
  color: #0d6efd;
}

.bottom-nav .badge {
  position: absolute;
  top: -4px;
  right: -10px;
  background: red;
  color: #fff;
  font-size: 11px;
  border-radius: 50%;
  padding: 2px 6px;
}

/* ===================================================
   📦 DÉCALAGE CONTENU
   =================================================== */
@media (max-width: 768px) {
  body.is-app {
    padding-top: 70px;
    padding-bottom: 80px;
  }
}

/* ===================================================
   🖥️ DESKTOP
   =================================================== */
@media (min-width: 769px) {
  .mobile-nav,
  .bottom-nav {
    display: none !important;
  }
}
/* ===================================================
   🖥️ FIX DESKTOP – DÉCALAGE SOUS NAVBAR FIXED
   =================================================== */
@media (min-width: 769px) {
  body.is-app {
    padding-top: 90px; /* hauteur navbar desktop */
  }
}
@media (min-width: 769px) {
  .categories-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }
}
/* ===================================================
   📱 FIX BOUTON MENU ☰ (ANDROID / PWA)
   =================================================== */
.mobile-nav .mobile-icon,
#mobileMenuBtn {
  margin-left: 12px;          /* espace depuis le bord */
  padding: 8px 10px;          /* zone tactile confortable */
  font-size: 22px;            /* taille icône */
  line-height: 1;
  border-radius: 8px;

  background: transparent;
  border: none;
}

/* Effet visuel au toucher (Android-like) */
#mobileMenuBtn:active {
  background: rgba(0,0,0,0.1);
}
.bottom-nav a {
  position: relative; /* 🔴 OBLIGATOIRE pour le badge */
}
/* ===============================
   🛒 BADGE PANIER – FIX ANDROID
   =============================== */
.bottom-nav .badge {
  position: absolute;

  top: 0px;
  right: -6px;

  min-width: 18px;
  height: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #e53935;
  color: #fff;

  font-size: 11px;
  font-weight: 700;

  border-radius: 50%;
  line-height: 1;

  padding: 0 4px;
}
.bottom-nav .badge {
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.cart-count {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(0.6); }
  100% { transform: scale(1); }
}
/* =========================================
   🧠 FIX MODAL vs NAVBAR FIXED (ANDROID)
   ========================================= */

/* Quand un modal Bootstrap est ouvert */
body.modal-open .mobile-nav,
body.modal-open .bottom-nav {
  display: none !important;
}
/* =========================================
   🖼️ FIX LOGO / IMAGE FORM (REGISTER / LOGIN)
   ========================================= */

.form-logo,
.auth-logo,
.register-logo,
.login-logo,
.form-logo img {
  max-width: 160px !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 auto 20px auto;
  display: block;
}

/* Empêche tout débordement */
.auth-container,
.register-container,
.login-container {
  overflow: hidden;
}
form img {
  max-width: 160px;
  height: auto;
}
/* =====================================
   📱 PAGE AUTH (LOGIN / REGISTER)
   ===================================== */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d9f08c, #f7ffd9);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 15px 35px rgba(0,0,0,.15);
  animation: slideUp .5s ease;
}

/* LOGO */
.auth-logo {
  max-width: 120px;
  display: block;
  margin: 0 auto 12px;
}

/* TITRES */
.auth-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

/* FORM */
.auth-form .form-group {
  position: relative;
  margin-bottom: 20px;
}

.auth-form input {
  width: 100%;
  padding: 12px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  font-size: 15px;
}

.auth-form label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  padding: 0 6px;
  color: #888;
  pointer-events: none;
  transition: .3s;
  font-size: 14px;
}

.auth-form input:focus + label,
.auth-form input:valid + label {
  top: -7px;
  font-size: 12px;
  color: #0d6efd;
}

/* BOUTON */
.btn-auth {
  width: 100%;
  padding: 12px;
  background: #0d6efd;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-auth:active {
  transform: scale(.98);
}

/* FOOTER */
.auth-footer {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
}

.auth-footer a {
  color: #0d6efd;
  font-weight: 600;
  text-decoration: none;
}

/* ANIMATION */
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* 🔥 CORRECTION LOGO INSCRIPTION (FORCE) */
.auth-logo {
  max-width: 110px !important;
  max-height: 110px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* CENTRAGE GLOBAL */
.auth-wrapper {
  min-height: 100vh !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* CARTE */
.auth-card {
  width: 100% !important;
  max-width: 380px !important;
  text-align: center !important;
}
/* 👁️ TOGGLE PASSWORD */
.password-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #777;
  font-size: 18px;
}

.toggle-password:hover {
  color: #0d6efd;
}
.toggle-password:active {
  transform: translateY(-50%) scale(0.9);
}
/* ===============================
   🌿 FOND PLEIN ÉCRAN – AUTH
   =============================== */

/* HTML & BODY pleine hauteur */
html, body {
  height: 100%;
}

/* Wrapper pleine hauteur */
.auth-wrapper {
  min-height: 100vh;
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    180deg,
    #e6f7a9 0%,
    #d9f08c 100%
  );
}
/* 👁️ Icône afficher / cacher mot de passe */
.password-toggle {
  position: absolute;
  top: 38px;
  right: 14px;
  cursor: pointer;
  font-size: 18px;
  user-select: none;
  opacity: 0.7;
}

.password-toggle:hover {
  opacity: 1;
}
/* Champ mot de passe */
.password-input {
  padding-right: 44px; /* espace pour l'œil */
}

/* Icône œil dans le champ */
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  z-index: 2;
}

.password-toggle:hover {
  opacity: 1;
}
/* Message */
.password-feedback {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* États visuels */
.is-invalid {
  border: 2px solid #dc3545 !important;
}

.is-valid {
  border: 2px solid #198754 !important;
}

.text-weak {
  color: #dc3545;
}

.text-strong {
  color: #198754;
}

/* Icône œil */
.password-toggle {
  position: absolute;
  right: 14px;
  top: 38px;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.6;
}
/* 📱 MOBILE : on cache le bouton du formulaire */
@media (max-width: 768px) {
  .form-confirm-btn {
    display: none !important;
  }
}
/* ===============================
   🎉 ANIMATION SUCCÈS COMMANDE
   =============================== */

.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.success-overlay.d-none {
  display: none;
}

.success-box {
  background: #fff;
  padding: 32px 26px;
  border-radius: 18px;
  text-align: center;
  animation: popIn 0.5s ease-out;
}

.success-box h3 {
  margin-top: 12px;
  font-weight: 700;
}

.success-box p {
  color: #555;
}

.checkmark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #28a745;
  color: #fff;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  animation: scaleCheck 0.6s ease;
}

/* Animations */
@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes scaleCheck {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
