/* ===== Déclaration des variables CSS ===== */
:root {
  --primary-color: #050505;
  --secondary-color: #ff9e00;
  --tertiary-color: #ff9900;
  --background-color: #ffffff;
  --text-color: #333333;
  --header-gradient: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  --transition-speed: 0.3s;
  --card-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --card-shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ===== Styles Globaux ===== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

/* ===== Header ===== */
.sticky-header {
  position: sticky;
  top: 0;
  background: var(--header-gradient);
  z-index: 1000;
  padding: 10px;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-content nav a {
  margin: 0 15px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
}

/* ===== Hero Section ===== */
.hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Section Catégories ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-speed);
}
.category-card:hover {
  transform: translateY(-5px);
}
.category-card img {
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: 5px;
  box-shadow: var(--card-shadow);
}
.category-card span {
  margin-top: 10px;
  font-size: 1em;
}
/* Fiche produit */
.product-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.product-table th {
  background: var(--secondary-color);
  color: #fff;
}
.buy-button:hover {
  box-shadow: var(--card-shadow-hover);
}


/* ===== Grille Produits ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
}
.product-card {
  display:flex;
  flex-direction: column;
  border: 1px solid #ddd;
  padding: 10px;
  background-color: var(--background-color);
  border-radius: 5px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition-speed) ease, opacity 0.6s ease,
    transform 0.6s ease;
  opacity: 0;
  transform: translateY(20px);
}
.product-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}
.product-card img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  margin-bottom: 10px;
}
.product-name {
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  font-size: 1.1em;
  margin: 10px 0;
  text-align: center;
}
.buy-link {
  display: block;
  text-align: center;
  text-decoration: none;
  background-color: var(--tertiary-color);
  color: #fff;
  padding: 8px;
  border-radius: 3px;
  margin-top: auto;
}

/* ===== Pagination ===== */
.pagination {
  text-align: center;
  margin: 20px 0;
}
.pagination a {
  margin: 0 5px;
  text-decoration: none;
  color: var(--primary-color);
}
.pagination a[aria-current="page"] {
  font-weight: bold;
}

/* ===== Footer ===== */
footer {
  background-color: #000;
  color: #fff;
  padding: 15px;
}
.footer-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.footer-content a {
  color: #fff;
  text-decoration: none;
}
.footer-logo img,
.footer-contact img {
  height: 30px;
}
/* Ajustements demandés */
/* Logo sizing */
.logo-img {
  max-height: 50px;
  width: auto;
}
.footer-logo-img {
  max-height: 30px;
  width: auto;
}
/* Navigation spacing */
.nav-link {
  margin: 0 20px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: bold;
}
.nav-link:hover {
  opacity: 0.8;
}
/* Categories grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px;
}
/* Products grid max 4 columns */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px;
}
/* Responsive adjustments */
@media (max-width: 1024px) {
  .categories-grid,
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .categories-grid,
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .categories-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .product-grid {
    grid-template-columns: 1fr;
  }
  .header-content {
    flex-direction: column;
  }
}

/* 1. Animation de fondu entrant (fade-in) */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 2. Animation de fondu sortant (fade-out) */
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* 3. Classe appliquée au <body> au chargement */
body.page-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* 4. Classe déclenchant le fondu sortant */
body.page-fade-out {
  animation: fadeOut 0.5s ease forwards;
}

