/* ========================================================================
   VENDÔMOISE DE FERMETURES - STYLES COMMUNS
   Fichier CSS centralisé pour tous les composants réutilisables
   ======================================================================== */

/* ========== 1. VARIABLES CSS ========== */
:root {
  /* Couleurs principales */
  --color-primary: #ac890e;
  --color-primary-dark: #9a7b0c;
  --color-primary-light: #d4a017;

  /* Couleurs de fond */
  --color-bg-dark: #1a1a1a;
  --color-bg-dark-2: #2c2c2c;
  --color-bg-dark-3: #3b3b3b;
  --color-bg-light: #f8f8f8;

  /* Couleurs de texte */
  --color-text-dark: #2c2c2c;
  --color-text-light: #ffffff;
  --color-text-muted: #555;
  --color-text-light-muted: #ddd;
  --color-text-lighter: #aaa;

  /* Couleurs utilitaires */
  --color-error: #e74c3c;
  --color-success: #28a745;
  --color-admin: #dc3545;
  --color-commercial: #3b82f6;

  /* Rayons de bordure */
  --radius-sm: 15px;
  --radius-md: 20px;
  --radius-lg: 25px;
  --radius-full: 50%;

  /* Ombres */
  --shadow-sm: 0 4px 20px rgba(172, 137, 14, 0.3);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 30px 100px rgba(172, 137, 14, 0.2);

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.3s ease;

  /* Espacements */
  --spacing-xs: 10px;
  --spacing-sm: 15px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
  --spacing-xl: 40px;

  /* Tailles maximales */
  --max-width-content: 1400px;
  --max-width-container: 1200px;
  --max-width-form: 450px;
}

/* ========== BOUTONS RETOUR UNIFORMISÉS ========== */
/* Bouton retour fixed (top-left) pour pages catalogue/config/techniques */
.back-button {
  position: fixed;
  top: 30px;
  left: 30px;
  background: rgba(172, 137, 14, 0.9);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(172, 137, 14, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95em;
  border: none;
  cursor: pointer;
}

.back-button:hover {
  background: rgba(154, 123, 12, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(172, 137, 14, 0.4);
}

/* Logo centré pour toutes les pages */
.logo-container {
  text-align: center;
  margin-bottom: 30px;
}

.logo-container img {
  max-width: clamp(220px, 50vw, 380px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(172, 137, 14, 0.3));
}

/* Titre principal centré avec gradient */
.main-content h1 {
  font-size: clamp(2em, 4vw, 3em);
  font-weight: 300;
  margin-bottom: 40px;
  text-align: center;
  background: linear-gradient(135deg, #ffffff, #ac890e);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(172, 137, 14, 0.3);
}

/* Responsive - Bouton retour en position relative sur mobile */
@media (max-width: 768px) {
  .back-button {
    position: relative;
    top: 0;
    left: 0;
    margin: 20px auto;
    display: inline-flex;
  }

  .logo-container img {
    max-width: 250px;
  }

  .main-content h1 {
    font-size: 2.2em;
    margin-bottom: 30px;
  }
}

@media (max-width: 480px) {
  .logo-container img {
    max-width: 160px;
  }

  .main-content h1 {
    font-size: 1.8em;
    margin-bottom: 25px;
  }
}

/* ========== 2. RESET & BASE ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--color-bg-dark);
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-dark-2) 25%, var(--color-bg-dark-3) 75%, var(--color-bg-dark-2) 100%);
  background-attachment: fixed;
  color: var(--color-text-light);
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  opacity: 1;
}

/* Préférences système - Désactive animations si demandé */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== 3. BACKGROUND & ANIMATIONS ========== */
/* Particules d'arrière-plan animées */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 80%, rgba(172, 137, 14, 0.1) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(172, 137, 14, 0.05) 0%, transparent 50%), radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  z-index: -1;
  animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  33% {
    transform: translateY(-20px) rotate(120deg);
  }

  66% {
    transform: translateY(10px) rotate(240deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ========== 4. LAYOUT & CONTAINERS ========== */
.main-content {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
  z-index: 1;
}

.container {
  width: 100%;
  max-width: var(--max-width-container);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ========== 5. LOGO ========== */
.logo-container {
  margin: var(--spacing-xl) 0 var(--spacing-md) 0;
  text-align: center;
}

.logo-container img {
  max-width: 200px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}

.logo-container img:hover {
  transform: scale(1.05);
}

/* ========== 6. TYPOGRAPHIE ========== */
h1 {
  font-size: clamp(2em, 4vw, 3em);
  font-weight: 300;
  margin-bottom: var(--spacing-xl);
  color: var(--color-primary);
  text-shadow: 0 4px 20px rgba(172, 137, 14, 0.3);
}

/* ========== 7. BOUTON RETOUR ========== */
.back-button {
   display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  top: var(--spacing-xs);
  left: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(172, 137, 14, 0.9);
  backdrop-filter: blur(10px);
  color: var(--color-text-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
  z-index: 1000;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
}

.back-button:hover {
  background: rgba(154, 123, 12, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(172, 137, 14, 0.4);
}

/* ========== 8. GRILLES DE PRODUITS ========== */
.products,
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-lg);
  justify-content: center;
  padding: var(--spacing-md) 0;
  width: 100%;
  max-width: var(--max-width-container);
  margin: 0 auto;
}

/* ========== 9. CARTES (PRODUITS & DASHBOARD) ========== */
.product-card,
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  color: var(--color-text-dark);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow-md), var(--shadow-xl);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(172, 137, 14, 0.2);
  height: 100%;
}

/* Effet shimmer sur les cartes */
.product-card::before,
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(172, 137, 14, 0.1), transparent);
  transition: left 0.5s ease;
}

.product-card:hover::before,
.card:hover::before {
  left: 100%;
}

.product-card:hover,
.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow:
    var(--shadow-lg),
    0 30px 100px rgba(172, 137, 14, 0.2);
}

/* Titres des cartes */
.product-card h2,
.card h2 {
  font-size: 1.4em;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-text-dark);
}

.product-card h2 i,
.card h2 i {
  font-size: 1.3em;
  color: var(--color-primary);
  transition: transform 0.3s ease;
}

.product-card:hover h2 i,
.card:hover h2 i {
  transform: scale(1.2) rotate(5deg);
}

/* Paragraphes des cartes */
.product-card p,
.card p {
  font-size: 1.1em;
  margin-bottom: 25px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Images dans les cartes */
.product-card img {
  max-width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  margin: var(--spacing-sm) auto;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.product-card:hover img {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ========== 10. BOUTONS ========== */
.product-card button,
.card button,
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: var(--color-text-light);
  padding: 15px 25px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  transition: var(--transition-smooth);
  width: auto;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(172, 137, 14, 0.3);
}

.product-card button::before,
.card button::before,
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.product-card button:hover::before,
.card button:hover::before,
.btn-primary:hover::before {
  left: 100%;
}

.product-card button:hover,
.card button:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), #b8940f);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(172, 137, 14, 0.4);
}

/* ========== 11. LOADING OVERLAY ========== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg-dark);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  transition: opacity 0.5s ease;
}

.loading-overlay.show {
  display: flex;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  border: 3px solid rgba(172, 137, 14, 0.2);
  border-radius: var(--radius-full);
  border-top: 3px solid var(--color-primary);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: var(--color-primary);
  font-size: 1.2em;
  margin-top: 20px;
  font-weight: 600;
}

/* ========== 12. FOOTER ========== */
.footer {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-bg-dark), #222);
  padding: 25px var(--spacing-md);
  margin-top: var(--spacing-xl);
  text-align: center;
  color: var(--color-text-light-muted);
  width: 100%;
  position: relative;
  border-top: 1px solid rgba(172, 137, 14, 0.2);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.footer-content {
  max-width: var(--max-width-container);
  margin: 0 auto;
}

.footer-social,
.footer .social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.footer-social-link,
.footer .social-link {
  background: var(--color-primary);
  color: var(--color-text-light);
  width: 2.5rem;
  height: 2.5rem;
  line-height: 2.5rem;
  text-align: center;
  border-radius: var(--radius-full);
  font-size: 1.2rem;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-social-link:hover,
.footer .social-link:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.footer-website,
.footer .site-link {
  display: inline-block;
  color: var(--color-primary);
  font-weight: bold;
  text-decoration: none;
  margin-bottom: 0.5rem;
  font-size: 1.1em;
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid rgba(172, 137, 14, 0.2);
  transition: all 0.3s ease;
}

.footer-website:hover,
.footer .site-link:hover {
  color: var(--color-text-light);
  background: rgba(172, 137, 14, 0.15);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.footer-legal,
.footer .legal {
  font-size: 0.85rem;
  color: var(--color-text-lighter);
  margin-top: var(--spacing-sm);
}

/* ========== 13. UTILITAIRES ========== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-auto {
  margin-top: auto;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

/* ========== 14. MEDIA QUERIES RESPONSIVE ========== */

/* Tablette : ≤1024px */
@media (max-width: 1024px) {
  .products,
  .cards-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
  }

  .logo-container img {
    max-width: 150px;
  }

  h1 {
    font-size: 2rem;
  }
}

/* Mobile : ≤767px */
@media (max-width: 767px) {
  body {
    padding: 0.5rem;
  }

  .back-button {
    top: var(--spacing-xs);
    left: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
  }

  .main-content {
    padding: var(--spacing-md) var(--spacing-xs);
  }

  .products,
  .cards-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .product-card,
  .card {
    padding: var(--spacing-md);
  }

  .product-card h2,
  .card h2 {
    font-size: 1.1rem;
  }

  .product-card button,
  .card button {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .footer {
    padding: var(--spacing-md) var(--spacing-xs);
    font-size: 0.85rem;
  }

  .footer-social {
    gap: var(--spacing-xs);
  }
}

/* Très petit écran : ≤479px */
@media (max-width: 479px) {
  .logo-container img {
    max-width: 120px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .back-button {
    font-size: 0.8rem;
  }
}
