/*Style pour Home*/
:root {
  /* PALETTE OFFICIELLE KATALOG */
  --katalog-bordeaux: #902135;
  /* Base / Identité forte */
  --katalog-blue: #183cb6;
  /* Actions / Interactivité */
  --katalog-green: #4eb368;
  /* Validation / Succès */
  --katalog-orange: #ffa500;
  /* Alertes / Panier */
  --katalog-white: #ffffff;
  --katalog-black: #131921;
  /* Fond Header sombre */
  --text-dark: #1f2937;
  --gray-light: #f3f4f6;
  --gray-bg: #eaeded;
  --secondary-gray: #666666;
}

body {
  background-color: var(--gray-bg);
  margin: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--text-dark);
}

/* Header & Nav */
.active-link {
  border-bottom: 3px solid var(--katalog-white);
  font-weight: 700;
  padding-bottom: 3px;
}
/*Gestion Soulignement en entête*/
/* Le lien par défaut */
.nav-brand-link {
  color: white;
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.3s ease;
}

.nav-brand-link:hover {
  opacity: 0.8;
}

.main-menu a {
  color: white;
  text-decoration: none;
  padding: 5px 0;
  transition: 0.2s;
  font-weight: 500;
}

.main-menu a:hover {
  color: var(--gray-light);
  border-bottom: 3px solid rgba(255, 255, 255, 0.5);
}

/* Aside Sidebar */
.aside-open {
  left: 0 !important;
}

.aside-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  backdrop-filter: blur(2px);
}

/* Slider CSS */

.dot {
  height: 10px;
  width: 10px;
  margin: 0 6px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  transition: 0.3s;
}

.dot.active {
  background-color: var(--katalog-bordeaux);
  width: 25px;
  border-radius: 5px;
}

/* Resources Carousels */
.res-card {
  min-width: 220px;
  max-width: 220px;
  background: white;
  padding: 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.res-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--katalog-blue);
}

.scroll-container {
  display: flex;
  gap: 20px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 15px 5px;
}

.scroll-btn {
  background: white;
  border: 1px solid #ddd;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
  color: var(--katalog-bordeaux);
}

/* Petit triangle indicateur sur le menu */
#userDropdown::before {
  content: "";
  position: absolute;
  top: -9px;
  /* On l'aligne exactement sous l'icône fa-caret-down du bouton */
  right: 25px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 9px solid white;
  filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.05));
  /* Optionnel: pour l'ombre sur le triangle */
}

/* On s'assure que le dropdown lui-même est bien placé par rapport au bord droit */
#userDropdown {
  right: 10px;
  /* Ajuste cette valeur pour que le triangle pointe bien vers le caret */
}

/* CSS pour ala bulle*/
.menu-link {
  display: block;
  color: var(--text-dark);
  text-decoration: none;
  padding: 10px 0;
  transition: 0.2s;
}

.menu-link i {
  margin-right: 12px;
  width: 20px;
  transition: 0.2s;
}

.menu-link:hover {
  color: var(--katalog-bordeaux);
}

.menu-link:hover i {
  color: var(--katalog-bordeaux);
}

/* Background des link*/
.nav-link-item {
  display: flex;
  /* Force le lien à remplir toute la largeur */
  align-items: center;
  /* Centre l'icône et le texte verticalement */
  gap: 15px;
  /* Espace entre l'icône et le texte */
  padding: 10px 20px;
  /* Définit la hauteur et l'espacement latéral du gris */
  width: 100%;
  /* Occupe 100% du <li> */
  box-sizing: border-box;
  /* Garantit que le padding ne dépasse pas de la div */
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: background-color 0.2s ease;
  /* Animation fluide du gris */
}

/* L'EFFET HOVER SUR TOUTE LA LARGEUR */
.nav-link-item:hover {
  background-color: var(--gray-bg);
  /* Ton gris clair (var(--gray-light)) */
}

/*Toogle menu CSS*/
.menu-toggle {
  cursor: pointer;
  font-weight: 900;
  display: inline-flex;
  /* S'adapte au contenu */
  align-items: center;
  gap: 10px;
  padding: 10px 25px;
  z-index: 2;
  color: white;
  /* Supposant que ton header est sombre */

  /* La bordure est là, mais invisible au départ */
  border: 1.5px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

/* L'EFFET AU SURVOL */
.menu-toggle:hover {
  border-color: white;
  /* La bordure devient blanche */
  background-color: rgba(255, 255, 255, 0.1);
  /* Optionnel : léger fond brillant */
  padding: 10px 25px;
}

.menu-toggle i {
  transition: transform 0.2s;
}

.menu-toggle:hover i {
  transform: scale(1.1);
  /* Micro-interaction sur l'icône */
}

/* Chevron Balise select Toutes nos catégories*/
.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  border-radius: 4px 0 0 4px;
  border: none;
  padding: 0 35px 0 15px;
  background: #f3f3f3;
  font-size: 0.85rem;
  font-family: "Montserrat", sans-serif;
  border-right: 1px solid #ddd;
  cursor: pointer;
  height: 40px;
}

/* Icône */
.select-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  pointer-events: none;
  color: #555;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 4px 0 0 4px;
  border: none;
  padding: 0 35px 0 15px;
  background: #f3f3f3;
  font-size: 0.85rem;
  font-family: "Montserrat", sans-serif;
  border-right: 1px solid #ddd;
  cursor: pointer;
  height: 100%;
  /* Important pour remplir le formulaire */
}

/* Style de base pour tous les liens du footer */
.footer-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  /* Permet un soulignement à la taille du texte */
  position: relative;
  padding-bottom: 2px;
}

/* Effet au survol : Uniquement sur les liens NON actifs */
.footer-link:not(.footer-active-link):hover {
  color: var(--katalog-bordeaux);
  transform: translateX(5px);
  /* Remplace le padding-left pour plus de fluidité */
}

/* --- LE LIEN ACTIF --- */
.footer-active-link {
  color: var(--katalog-bordeaux) !important;
  /* Force la couleur bordeaux */
  font-weight: 800;
}

.footer-logo {
  height: 160px;
  border: 1.5px solid transparent;
  transition: all 0.4s ease;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px;
}

.footer-logo:hover {
  border-color: var(--katalog-bordeaux);
  transform: scale(1.05);
}

/* Bouton de retour en Haut*/
/* Bouton de retour en Haut */
.btn-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #902135;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(144, 33, 53, 0.4);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s,
    transform 0.2s,
    box-shadow 0.2s;
  z-index: 999;
}

.btn-scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.btn-scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(144, 33, 53, 0.5);
}

.btn-scroll-top:active {
  transform: translateY(0);
}

/*Pour ma Nav*/
.sub-navbar {
  height: 44px;
  background: #7a1b2d;
  color: white;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
  font-family: "Montserrat", sans-serif;
  font-size: 0.85rem;
  /* On ajoute une ombre subtile pour la démarquer du contenu */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Scrollable wrapper — scrolls on mobile, centered on desktop */
.sub-nav-scroll {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: 1300px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.sub-nav-scroll::-webkit-scrollbar {
  display: none;
}

.sub-nav-scroll .nav-link {
  white-space: nowrap;
  padding: 0 18px;
  height: 44px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: opacity 0.2s;
}

.menu-toggle:hover {
  opacity: 0.8;
}

.main-menu {
  display: flex;
  gap: 35px;
  margin: 0 auto;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

/* Style de base des liens */
.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: #fee2e2; /* Rappel du fond d'erreur clair de ta charte graphique */
}

/* La classe injectée par ton tag Django active_link */
.active-link {
  font-weight: 700;
  border-bottom: 2px solid white; /* Indicateur visuel de page active */
}

.nav-spacer {
  width: 80px;
}

/*Logo Header*/
.nav-logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 60px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 4px;
  transition: all 0.3s ease-in-out;
}

/* On remplace le JavaScript par du pur CSS */
.nav-logo-link:hover .nav-logo-img {
  transform: scale(1.05);
}

/*Bouton de recherche*/
.custom-select {
  position: relative;
  display: flex;
  align-items: center;
  background: #f9fafb;
  border-right: 1px solid #ddd; /* Séparation avec le champ texte */
  min-width: 180px;
}

.custom-select select {
  appearance: none; /* Supprime la flèche par défaut du navigateur */
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 35px 0 15px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  outline: none;
}

/* L'icône de flèche personnalisée */
.select-icon {
  position: absolute;
  right: 12px;
  pointer-events: none; /* L'icône ne doit pas bloquer le clic sur le select */
  color: var(--katalog-bordeaux);
  font-size: 0.8rem;
}

/* Effet au focus pour l'utilisateur */
.custom-select:focus-within {
  background: white;
}

.search-form {
  display: flex;
  flex-grow: 0.7;
  height: 42px;
  margin: 0 40px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: visible;
  border: 1px solid #ddd;
  background: white;
  position: relative;
}

/* Le champ de saisie */
.search-input {
  flex-grow: 1;
  border: none;
  padding: 0 20px;
  outline: none;
  font-size: 0.95rem;
  font-family: "Montserrat", sans-serif; /* Harmonisation avec ta charte */
  color: var(--text-main);
}

/* Le bouton de recherche */
.search-button {
  background-color: var(--katalog-orange);
  border: none;
  color: white;
  width: 55px;
  cursor: pointer;
  font-size: 1.1rem;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-button:hover {
  background-color: #e67e22; /* Une version légèrement plus sombre pour le feedback */
  transform: scale(1.05);
}

.search-button:active {
  transform: scale(0.95);
}

/* Style spécifique pour le custom-select dans le formulaire */
.search-form .custom-select {
  border-right: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 4px 0 0 4px;
}

.search-form .search-button {
  border-radius: 0 4px 4px 0;
}

/* --- SIDEBAR --- */
.sidebar {
  position: fixed;
  left: -350px;
  top: 0;
  width: 350px;
  height: 100%;
  background: white;
  z-index: 10000;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  background: var(--katalog-bordeaux);
  color: white;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-login-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-close {
  margin-left: auto;
  cursor: pointer;
  font-size: 1.5rem;
}

.sidebar-content {
  width: 100%;
  padding-top: 20px;
}

.sidebar-title {
  padding: 0 20px;
  color: var(--katalog-bordeaux);
  letter-spacing: 1px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.sidebar-divider {
  border: 0;
  border-top: 1px solid var(--gray-light);
  margin: 20px 0;
}

.icon-orange {
  color: var(--katalog-orange);
}
.icon-blue {
  color: var(--katalog-blue);
}

/* --- HEADER PRINCIPAL --- */
.main-header {
  background: var(--gray-bg);
  color: var(--text-dark);
  padding: 12px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Menu Utilisateur */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.user-menu-btn {
  font-size: 0.85rem;
  cursor: pointer;
  text-align: right;
  padding-right: 10px;
}

.account-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.caret-icon {
  font-size: 0.7rem;
  margin-left: 5px;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  width: 260px;
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 10000;
  padding: 20px;
}

.btn-login-dropdown {
  display: block;
  background: var(--katalog-orange);
  color: white;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
  margin-bottom: 15px;
  transition: 0.3s;
}

.dropdown-footer {
  text-align: center;
  font-size: 0.85rem;
  border-top: 1px solid #eee;
  padding-top: 15px;
  color: var(--text-dark);
}

.link-blue {
  color: var(--katalog-blue);
  text-decoration: none;
  font-weight: 800;
}

/* Sélection */
.cart-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  cursor: pointer;
  position: relative;
  padding: 5px;
  transition: 0.2s;
}

.cart-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--katalog-white);
  font-size: 1rem;
  font-weight: 600;
  z-index: 2;
  line-height: 1;
}

.cart-wrapper i {
  font-size: 2.2rem;
  color: var(--katalog-orange);
}

.cart-text {
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
}

/* --- FOOTER --- */
.footer-main {
  background: var(--gray-bg);
  color: var(--text-dark);
  padding: 40px 25px;
  border-bottom: 1px solid #3a4553;
}

.footer-grid {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 80px;
}

.footer-section-title {
  text-align: left;
  margin-bottom: 20px;
}

.footer-section-title h4 {
  margin-bottom: 8px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dark);
}

.title-underline {
  width: 250px;
  height: 2px;
  background: var(--katalog-bordeaux);
  border-radius: 10px;
}

.footer-links-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}

.footer-contact p {
  text-align: left;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.footer-contact i {
  color: var(--katalog-bordeaux);
  margin-right: 10px;
  width: 20px;
}

.footer-bottom {
  background: var(--katalog-black);
  color: #999;
  padding: 15px;
  font-size: 0.85rem;
}

.footer-bottom-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom-links {
  display: flex;
  gap: 30px;
}

.footer-bottom-links a {
  color: #999;
  text-decoration: none;
}

/* Utilitaires */
.border-top {
  border-top: 1px solid #eee;
}
.logout-btn {
  border: none;
  border-top: 1px solid #eee;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 17px;
  padding-top: 10px;
  margin-top: 5px;
}

/* Conteneur des actions à droite (Compte + Sélection) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Bouton du menu utilisateur */
.user-menu-btn {
  font-size: 0.85rem;
  cursor: pointer;
  text-align: right;
  padding-right: 10px;
  color: var(--text-dark);
}

.account-label {
  font-size: 0.95rem;
  font-weight: 700;
}

/* Section Espace Contributeur / Admin */
.contributor-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--fee2e2); /* Utilisation de ta couleur d'erreur fond */
}

.btn-contributor {
  display: block;
  background: var(--katalog-orange);
  color: white;
  text-align: center;
  padding: 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
  margin-bottom: 15px;
  transition: 0.3s;
}

.btn-contributor:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Titre de section dans la sidebar */
.menu-title {
  color: var(--katalog-orange);
  font-size: 1.1rem;
  font-weight: 600;
  display: block;
  margin-bottom: 10px;
}

/* Liens du menu déroulant et de la sidebar */
.menu-link.border-top {
  border-top: 1px solid #eee;
}

/* Bouton Déconnexion spécifique */
.logout-btn {
  border: none;
  border-top: 1px solid #eee;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 17px;
  padding: 15px 0;
  margin-top: 5px;
  font-family: "Montserrat", sans-serif;
  color: var(--text-dark);
  transition: 0.2s;
}

.logout-btn:hover {
  color: var(--katalog-bordeaux);
}

/* Image du logo dans le footer */
.footer-brand {
  text-align: left;
}

@media (max-width: 599px) {
  .footer-brand {
    text-align: center;
  }
}

/* Liens du bas de page (Mentions, CGU) */
.footer-bottom-links a {
  color: #999;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-bottom-links a:hover {
  color: white;
}

/* État actif de la Sidebar (JS class) */
.sidebar.aside-open {
  left: 0 !important;
}

/*Style  Dashboard*/
