/* ====================================
    TABLE DES MATIÈRES
    ====================================
    1. Variables et configuration
    2. Reset et base
    3. Typographie
    4. Layout et conteneurs
    5. Composants UI
        a. Boutons
        b. Formulaires
        c. Modals et overlays
    6. En-tête et navigation
    7. Pied de page
    8. Sections de page
        a. Hero
        b. Intro
        c. Avantages
        d. Discord
        e. Témoignages
        f. Programme fidélité
        g. Appels à l'action
    9. Pages spécifiques
        a. Page fidélité
    10. Animations
    11. Utilitaires
    12. Media queries
    ==================================== */

/* 1. Variables et configuration
    ================================== */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --accent-color: #5865F2;
  --dark-color: #333;
  --light-color: #f8f9fa;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --spacing-unit: 20px;
  --border-radius: 5px;
  --transition-speed: 0.3s;
  --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Properly define font-face with correct MIME types */
@font-face {
  font-family: 'YourFont';
  src: url('../fonts/your-font.woff2?v=1.0.2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* Improves performance */
}

/* 2. Reset et base
    ================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  height: auto;
}

/* 3. Typographie
    ================================== */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 30px;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--accent-color);
}

ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 4. Layout et conteneurs
    ================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

section {
  padding: 60px 0;
}

/* 5. Composants UI
    ================================== */
/* a. Boutons */
.primary-btn, .secondary-btn {
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  display: inline-block;
  text-align: center;
}

.primary-btn {
  background-color: var(--primary-color);
  border: none;
  color: white;
}

.primary-btn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.secondary-btn {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.secondary-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.cta-button {
  background-color: var(--accent-color);
  border: none;
  padding: 12px 25px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
  margin-top: 20px;
}

.cta-button:hover {
    background-color: #4752c4;
  transform: translateY(-3px);
}

.cta-button a {
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.button, .cta-button {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white !important;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.button:hover, .cta-button:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

/* b. Formulaires */
/* (Placeholder pour futurs styles de formulaires) */

/* c. Modals et overlays */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  overflow: auto;
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 25px;
  border-radius: var(--border-radius);
  max-width: 600px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: slideDown 0.3s ease-out;
}

.close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
}

.close:hover {
  color: var(--accent-color);
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 998;
}

/* 6. En-tête et navigation
    ================================== */
header {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px var(--spacing-unit);
}

.logo-container {
  display: flex;
  align-items: center;
}

#logo {
  width: 100px;
  margin-right: 10px;
}

logo-container h1 {
  font-size: 1.8rem;
  margin: 0;
  color: var(--primary-color);
}

/* Navigation - Version desktop par défaut */
nav ul {
  display: flex;
  align-items: center;
}

nav li {
  margin: 0 15px;
}

nav a {
  color: var(--dark-color);
  font-weight: 500;
  display: inline-block;
  padding: 8px 0;
  position: relative;
}

nav a:hover {
  color: var(--accent-color);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width var(--transition-speed) ease;
}

nav a:hover::after {
  width: 100%;
}

nav a.active {
  color: var(--accent-color);
}

nav a.active::after {
  width: 100%;
}

nav a i {
  margin-right: 5px;
}

/* Navigation mobile par défaut cachée */
.mobile-menu-toggle, .close-menu {
  display: none;
}

/* Compteurs panier et liste de souhaits */
.cart-count, .wishlist-count {
  background-color: var(--accent-color);
  color: white;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 50%;
  position: absolute;
  top: -5px;
  right: -8px;
}

.cart-icon, .wishlist-icon {
  position: relative;
}

/* 7. Pied de page
    ================================== */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 50px 0 20px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
}

.footer-section {
  width: 100%;
  max-width: 300px;
  margin-bottom: 30px;
}

.footer-section h4 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: rgba(255,255,255,0.7);
  transition: color var(--transition-speed) ease;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* 8. Sections de page
    ================================== */
/* a. Hero */
#hero {
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../../assets/images/ui/aura.jpeg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  text-align: center;
  padding: 120px 0;
}

#hero h2 {
  font-size: 3rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#hero p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

#hero button {
  background-color: var(--accent-color);
  border: none;
  padding: 12px 25px;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}

#hero button:hover {
    background-color: #4752c4;
}

#hero button a {
  color: white;
  text-decoration: none;
}

/* b. Intro */
#intro {
  background-color: white;
  text-align: center;
}

#intro p {
  max-width: 800px;
  margin: 0 auto;
}

/* c. Avantages */
#avantages {
  background-color: var(--light-color);
}

#avantages ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

#avantages li {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 25px;
  width: calc(33.333% - 30px);
  text-align: center;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

#avantages li:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

#avantages i {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}
/* d. Discord */
#discord {
  background-color: #7289DA; /* Discord color */
  color: white;
  text-align: center;
  padding: 50px 0;
}

#discord a {
  display: inline-flex;
  align-items: center;
  background-color: white;
  color: #7289DA;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  margin-top: 20px;
  transition: transform var(--transition-speed) ease;
}

#discord a:hover {
  transform: scale(1.05);
}

#discord img {
  width: 30px;
  margin-right: 10px;
}

/* e. Témoignages */
#temoignages {
  background-color: white;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.testimonial {
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
}

.testimonial i.fa-quote-left {
  font-size: 1.5rem;
  color: var(--accent-color);
  opacity: 0.5;
  margin-bottom: 10px;
}

.client-info {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

.client-info i {
  font-size: 2rem;
  margin-right: 15px;
  color: var(--dark-color);
}

.stars {
  margin-left: auto;
  color: gold;
}

/* f. Programme fidélité */
#fidelity-teaser {
  background-color: #f5f5f5;
  padding: 70px 0;
}

.fidelity-teaser-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Ajout du flex-wrap pour éviter le débordement */
}

.fidelity-teaser-text {
  flex: 1;
  padding-right: 30px;
  min-width: 300px; /* Assure une largeur minimale */
}

.fidelity-badges {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap; /* Permet aux badges de passer à la ligne */
  justify-content: center; /* Centre les badges s'ils passent à la ligne */
}

.badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed) ease;
}

.badge:hover {
  transform: scale(1.1);
}

.badge i {
  font-size: 2rem;
}

.badge.bronze {
  background: linear-gradient(145deg, #cd7f32, #e9967a);
}

.badge.bronze i {
  color: #5d3a15;
}

.badge.silver {
  background: linear-gradient(145deg, #c0c0c0, #e0e0e0);
}

.badge.silver i {
  color: #555;
}

.badge.gold {
  background: linear-gradient(145deg, #ffd700, #ffcc00);
}

.badge.gold i {
  color: #b8860b;
}

/* g. Appels à l'action */
#appel-action {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 70px 0;
}

#appel-action button {
  background-color: white;
  border: none;
  padding: 12px 25px;
  border-radius: var(--border-radius);
  margin-top: 20px;
  cursor: pointer;
  transition: transform var(--transition-speed) ease;
}

#appel-action button:hover {
  transform: translateY(-3px);
}

#appel-action a {
  color: var(--primary-color);
  font-weight: 700;
}

/* 9. Pages spécifiques
    ================================== */
/* a. Page fidélité */
.loyalty-hero {
  background-image: url('../../assets/images/ui/loyalty-hero-bg.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: 120px 0;
}

.loyalty-hero h2 {
  font-size: 3em;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#loyalty-faq {
  padding: 70px 0;
  background-color: #f9f9f9;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 30px;
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-item h3 {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  color: #333;
}

.faq-item h3 i {
  color: var(--accent-color);
  margin-right: 10px;
}

#testimonials-loyalty {
  padding: 70px 0;
  background-color: white;
}

/* 10. Animations
    ================================== */
@keyframes slideDown {
  from {
     transform: translateY(-30px);
     opacity: 0;
  }
  to {
     transform: translateY(0);
     opacity: 1;
  }
}

@keyframes fadeInNav {
  from {
     opacity: 0;
     transform: translateY(20px);
  }
  to {
     opacity: 1;
     transform: translateY(0);
  }
}

/* 11. Utilitaires
    ================================== */
/* CORRECTIFS DE VISIBILITÉ - assurent que le texte est visible */
p, h1, h2, h3, h4, h5, h6, li, span, a, button {
  color: inherit;
}

/* Correction pour le contraste du texte sur fond coloré */
#hero, #discord, #appel-action {
  color: white;
}

/* Fix section spacing to prevent extra space at bottom */
section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 30px;
}

/* Fix for possible flex container overflow */
.flex-container {
  width: 100%;
  max-width: 100%;
}

/* Notice de développement */
.dev-notice {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px 20px;
  text-align: center;
  font-weight: 500;
  border-bottom: 1px solid #f5c6cb;
  position: relative;
  z-index: 999;
}

.dev-notice i {
  margin-right: 10px;
}

.dev-notice p {
  margin: 0;
  line-height: 1.5;
}

.dev-notice strong {
  font-weight: 700;
}

/* Fix for Firefox min-height: auto issue */
section, 
.flex-container,
.any-element-with-min-height-auto {
  min-height: 0; /* Use 0 instead of auto for Firefox compatibility */
}

/* 12. Media queries
    ================================== */
@media (max-width: 992px) {
  /* Toggle et contrôles du menu */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--dark-color);
    cursor: pointer;
    position: relative;
    z-index: 1000;
  }
  
  body.menu-open {
    overflow: hidden;
  }

  /* CRUCIAL: Navigation mobile améliorée */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 70px;
    overflow-y: auto;
  }
  
  /* Important: Cache seulement la navigation desktop, pas tous les menus */
  header > .container > nav > ul {
    display: none;
  }
  
  /* Active state */
  nav.active {
    right: 0;
  }
  
  /* CORRECTION: Assurez-vous que les liens sont visibles */
  nav.active ul {
    display: flex !important;
  }
  
  /* Structure de la liste */
  nav ul {
    flex-direction: column;
    padding: 0 20px;
    margin: 0;
    width: 100%;
    align-items: flex-start;
    display: flex !important; /* Force l'affichage */
  }
  
  nav li {
    margin: 5px 0;
    width: 100%;
    opacity: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: block !important; /* Force l'affichage */
  }
  
  nav a {
    display: block;
    width: 100%;
    padding: 15px 10px;
    font-size: 1.1rem;
    color: var(--dark-color) !important; /* Assure la visibilité */
    border-radius: 8px;
    transition: background-color 0.2s ease;
  }
  
  nav a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: none;
  }
  
  /* Bouton de fermeture */
  .close-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 15px;
    left: 15px; /* Modifié : right → left */
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--dark-color) !important; /* Corrigé pour être visible */
    cursor: pointer;
    z-index: 1000;
  }
  
  /* Overlay */
  .overlay {
    background-color: rgba(0, 0, 0, 0.5);
  }
}

@media (max-width: 768px) {
  /* Avantages section adjustments */
  #avantages li {
     width: 100%;
  }
  
  /* Testimonials grid */
  .testimonials-grid {
     grid-template-columns: 1fr;
  }

  /* Fidelity teaser content */
  .fidelity-teaser-content {
     text-align: center;
  }

  .fidelity-badges {
     justify-content: center;
  }

  .fidelity-teaser-text h2 {
     font-size: 1.7rem;
  }

  /* Legal pages */
  #mentions-legales .container,
  #politique-confidentialite .container,
  #cgu .container {
     padding: 20px 15px;
  }
  
  #mentions-legales h2,
  #politique-confidentialite h2,
  #cgu h2 {
     font-size: 1.8rem;
     margin-bottom: 20px;
  }
  
  #mentions-legales p,
  #politique-confidentialite p,
  #cgu p {
     font-size: 0.95rem;
     margin-bottom: 15px;
  }
  
  /* Fix for section heights */
  section {
     min-height: auto;
     padding: 40px 0;
  }
  
  /* Amélioration des détails produits */
  .pc-details-wrapper {
    flex-direction: column;
  }
  
  .pc-gallery, .pc-description {
    width: 100%;
  }
  
  /* Fiches produits */
  .product-content section {
    padding: 30px 0;
  }
  
  /* Réduire l'espacement des sections */
  section {
    padding: 40px 0;
  }
  
  /* Améliorer la navigation des onglets */
  .tabs {
    flex-direction: column;
  }
  
  /* Améliorer les options de paiement */
  .payment-methods {
    flex-direction: column;
  }
  
  .payment-method {
    width: 100%;
    margin-bottom: 20px;
  }

  /* Adaptation des boutons pour petits écrans */
  .action-buttons {
    gap: 10px;
  }
  
  /* Optimisation des espaces entre sections */
  section:not(:first-of-type) {
    padding-top: 30px;
  }

  .fidelity-teaser-content {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
  
  .fidelity-teaser-text {
    padding-right: 0; /* Supprime le padding qui cause un débordement */
    width: 100%;
  }
  
  .fidelity-badges {
    justify-content: center;
    width: 100%;
  }
  
  .badge {
    margin-bottom: 15px; /* Espacement vertical entre les badges */
  }
}

@media (max-width: 480px) {
  /* Additional small screen fixes */
  .container {
     padding: 0 15px;
  }
  
  h2 {
     font-size: 1.6rem;
  }
  
  /* Make sure sections have proper padding */
  section {
     padding: 30px 0;
  }
  
  /* Fix for modals */
  .modal-content {
     width: 95%;
     margin: 15% auto;
     padding: 20px;
  }
  
  /* Fix for cart and wishlist */
  .cart-item {
     flex-direction: column;
  }
  
  #checkout-btn {
     width: 100%;
  }
  
  /* Fix footer spacing */
  footer .footer-section {
     margin-bottom: 20px;
  }
  
  /* Amélioration des textes pour la lisibilité sur mobile */
  body {
    font-size: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
  
  /* Amélioration des boutons et éléments interactifs */
  .primary-btn, .secondary-btn, .buy-now-btn, .wishlist-btn, .more-payment-options {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 8px;
    text-align: center;
  }
  
  /* Améliorer l'espacement des sections */
  section {
    padding: 25px 0;
  }
  
  /* Améliorer les performances */
  .performance-grid {
    grid-template-columns: 1fr;
  }
  
  /* Améliorer les fiches produit */
  .price-tag {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .price-tag .installment {
    margin-top: 5px;
  }
  
  /* Amélioration des tableaux de comparaison */
  .comparison-table {
    font-size: 14px;
  }
  
  .comparison-table th, .comparison-table td {
    padding: 8px 5px;
  }
  
  /* Optimiser le header */
  header .container {
    padding: 10px 15px;
  }
  
  #logo {
    width: 60px;
  }
  
  /* Amélioration de la navigation mobile */
  nav {
    width: 100%;
    max-width: none;
  }
  
  /* Optimiser le header */
  header .container {
    padding: 8px 15px;
  }
  
  /* Amélioration des formulaires */
  input, select, textarea {
    font-size: 16px; /* Évite le zoom sur les champs sur iOS */
    padding: 12px;
  }
  
  /* Ajuster les tailles de boutons pour faciliter l'appui tactile */
  button, .primary-btn, .secondary-btn, .buy-now-btn, .wishlist-btn {
    min-height: 48px;
  }
  
  /* Optimiser les espacements des listes */
  ul li {
    margin-bottom: 12px;
  }

  .fidelity-badges {
    gap: 15px; /* Réduit l'espacement sur très petits écrans */
  }
  
  .badge {
    width: 70px; /* Réduit la taille des badges */
    height: 70px;
  }
  
  .badge i {
    font-size: 1.7rem; /* Réduit la taille des icônes */
  }
}

@media (max-width: 360px) {
  .fidelity-badges {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .badge {
    width: 60px;
    height: 60px;
  }
}

/* Correction pour éviter les problèmes de fixed positioning sur iOS */
@supports (-webkit-overflow-scrolling: touch) {
  nav {
    -webkit-overflow-scrolling: touch;
  }
  
  body.menu-open {
    position: fixed;
    width: 100%;
  }
}