/* ==========================================================================
   1. Variables & Styles Globaux
   ========================================================================== */
:root {
  --primary: #3f4f44;
  --secondary: #f8f8f8;
  --accent: #ff7e5f;
  --light: #ffffff;
  --dark: #333333;
  --card-bg: #e8c8b0;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --color-primary: var(--primary);
  --color-accent: var(--accent);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: inherit;
}

html {
  height: 100%;
}

body {
  font-family: "PT Sans", sans-serif;
  background-color: #f9f9f9;
  color: var(--dark);
  line-height: 1.6;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

main {
  padding: 12px;
  flex: 1;
}

.container {
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
  transition: var(--transition);
}

.section-title {
  font-family: "Marcellus", serif;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 50px;
  color: var(--primary);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background: var(--accent);
  margin: 15px auto 0;
}

.error-message {
  background-color: #ffebee;
  color: #c62828;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
  text-align: center;
  border-left: 5px solid #c62828;
  font-family: "PT Sans", sans-serif;
}

/* ==========================================================================
   3. Header 
   ========================================================================== */

.header-container {
  position: relative;
  z-index: 1;
  height: 90vh;
  min-height: 600px;
  color: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.header-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 70%;
  background-image: url("../Image/headcover.jpeg");
  animation: kenBurnsEffect 30s ease-in-out infinite alternate;
  z-index: 1;
}

.header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.2) 100%
  );
  z-index: 2;
}

.header-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 2rem;
  animation: fadeInUp 1.2s ease-out;
}

.header-title-main {
  font-family: "Marcellus", serif;
  font-size: 3rem;
  font-weight: 600;
  color: var(--light);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.header-subtitle {
  font-family: "PT Sans", sans-serif;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.header-cta-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-button,
.cta-button-secondary {
  padding: 12px 28px;
  font-family: "PT Sans", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.cta-button {
  background-color: var(--accent);
  color: white;
}

.cta-button:hover {
  background-color: #ff6a45;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.cta-button-secondary {
  background-color: transparent;
  color: var(--light);
  border-color: var(--light);
}

.cta-button-secondary:hover {
  background-color: var(--light);
  color: var(--dark);
  transform: translateY(-4px);
}

@media (max-width: 768px) {
  .header-container {
    height: 80vh;
    min-height: 500px;
  }

  .header-container::before {
    animation: none;
  }

  .header-title-main {
    font-size: 2.2rem;
  }

  .header-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    height: 70vh;
  }

  .header-title-main {
    font-size: 1.9rem;
  }

  .header-subtitle {
    font-size: 1rem;
  }

  .header-cta-group {
    flex-direction: column;
    align-items: center;
  }

  .cta-button,
  .cta-button-secondary {
    width: 80%;
    max-width: 300px;
  }
}

/* ==========================================================================
   4.1. Filtres et Recherche de Produits
   ========================================================================== */

.product-filters {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
  margin-bottom: 40px;
}

.product-filters .section-title {
  margin-bottom: 30px;
}

.filter-controls {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.search-bar {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.search-bar i {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--primary);
  opacity: 0.6;
}

#searchInput {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-family: "PT Sans", sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.3);
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.filter-btn {
  background-color: var(--secondary);
  color: var(--dark);
  border: 2px solid transparent;
  padding: 8px 18px;
  border-radius: 50px;
  font-family: "PT Sans", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  background-color: #e0e0e0;
}

.filter-btn.active {
  background-color: var(--primary);
  color: var(--light);
  border-color: var(--primary);
}

/* ==========================================================================
   4.2. Grille et Style des Cartes Produits (STYLE AMÉLIORÉ)
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 30px;
}

.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  border: 1px solid #f0f0f0;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

.image-container {
  height: 220px;
  overflow: hidden;
  position: relative;
}

.product-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}

.product-category {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-title {
  font-family: "Marcellus", serif;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  font-weight: 600;
  line-height: 1.4;
  flex-grow: 1;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
  font-family: "Marcellus", serif;
}

.product-actions {
  margin-top: auto;
}

.add-to-cart {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "PT Sans", sans-serif;
  font-size: 0.9rem;
  width: 100%;
  justify-content: center;
}

.add-to-cart:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 126, 95, 0.4);
}

#no-results-message {
  grid-column: 1 / -1;
  text-align: center;
}

/* ==========================================================================
   5. Bannière Promotionnelle (STYLE AMÉLIORÉ)
   ========================================================================== */
.promo-banner {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    url("../Image/imagebannière1.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  height: 350px;
  margin: 60px 0;
  position: relative;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.promo-content {
  position: relative;
  z-index: 2;
}

.promo-text-elegant {
  font-family: "Marcellus", serif;
  font-size: 2.5rem;
  font-weight: 500;
  text-shadow: 1px 1px 15px rgba(0, 0, 0, 0.5);
  padding: 0 1rem;
}

@media (max-width: 768px) {
  .promo-banner {
    height: 300px;
    background-attachment: scroll;
  }

  .promo-text-elegant {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .promo-banner {
    height: 250px;
  }

  .promo-text-elegant {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   6. Footer (Styles pour la visibilité, le reste est dans footer.php)
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   7. Panier (Flottant, Sidebar, Overlay)
   ========================================================================== */

body.cart-open {
  overflow: hidden;
}

.cart-open .container,
.cart-open .site-footer {
  filter: blur(2px);
  pointer-events: none;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.cart-open .cart-overlay {
  opacity: 1;
  pointer-events: all;
}

.cart-floating {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: var(--transition);
}

.cart-floating:hover {
  transform: scale(1.1);
  background: var(--accent);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 93vh;
  background: white;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  margin-top: 70px;
}

.cart-open .cart-sidebar {
  right: 0;
}

.cart-header {
  padding: 20px;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-family: "Marcellus", serif;
  font-size: 1.5rem;
  margin: 0;
}

.close-cart {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 15px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-family: "Marcellus", serif;
  font-size: 1.1rem;
  margin: 0 0 5px 0;
  color: var(--primary);
}

.cart-item-price {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
}

.quantity-btn {
  background: #f0f0f0;
  border: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.quantity-value {
  margin: 0 10px;
  min-width: 20px;
  text-align: center;
}

.remove-item {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 5px;
}

.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: #777;
}

.cart-summary {
  padding: 20px;
  background: #f9f9f9;
  border-top: 1px solid #eee;
}

.subtotal {
  font-weight: bold;
  padding: 10px 0;
  border-top: 1px solid #eee;
  margin-top: 10px;
  text-align: right;
}

.delivery-info {
  padding: 15px;
  margin: 15px 0;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 0.9rem;
}

.delivery-info.free {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: bold;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-family: "Marcellus", serif;
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.checkout-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 15px;
  width: 100%;
  border-radius: 8px;
  font-family: "PT Sans", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.checkout-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

@media (max-width: 990px) {
  .cart-sidebar {
    margin-top: 0;
  }
}

/* ==========================================================================
   8. Animations
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kenBurnsEffect {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.1) translate(-2%, 2%);
  }
}
/* ==========================================================================
   9. Responsive Design (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .header-container {
    padding: 80px 15px;
    height: 70vh;
    min-height: 400px;
    clip-path: ellipse(120% 100% at 50% 0%);
  }

  .header-content h1 {
    font-size: 2.2rem;
  }

  .header-content p {
    font-size: 1rem;
  }

  .promo-banner {
    padding: 60px 20px;
  }

  .promo-title {
    font-size: 2.2rem;
  }

  .promo-text {
    font-size: 1.1rem;
  }

  .cart-sidebar {
    max-width: 85vw;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .container {
    padding: 0 10px;
  }

  .header-container {
    clip-path: ellipse(150% 100% at 50% 0%);
    height: 60vh;
    min-height: 300px;
  }

  .header-content {
    padding: 25px;
  }

  .header-content h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }

  .header-content p {
    font-size: 0.9rem;
  }

  .cta-button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .promo-banner {
    padding: 50px 15px;
    background-attachment: scroll;
  }

  .promo-title {
    font-size: 1.8rem;
  }

  .promo-text {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .promo-button {
    padding: 10px 25px;
    font-size: 0.9rem;
  }

  .cart-sidebar {
    max-width: 100vw;
    width: 100%;
  }
}
