:root {
  --primary: #00bcd4;
  --secondary: #80deea;
  --accent: #009688;
  --background: #f4fdfd;
  --text-dark: #1b1b1b;
  --text-light: #666;
  --footer-bg: #0f2027;
  --white: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: var(--background);
  color: var(--text-dark);
  scroll-behavior: smooth;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.logo img { height: 50px;}

nav ul { list-style: none; display: flex; gap: 1.5rem; margin: 0; padding: 0; }
nav a { text-decoration: none; color: var(--text-dark); font-weight: 500; transition: color 0.3s; }
nav a:hover, nav a.active { color: var(--primary); font-weight: 600; }

.hero { text-align: center; padding: 8rem 2rem; background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), 
            url('https://images.unsplash.com/photo-1501004318641-b39e6451bec6?auto=format&fit=crop&w=1470&q=80') 
            center/cover no-repeat;
 color: white; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url('https://www.transparenttextures.com/patterns/polished-metal.png'); opacity: 0.1; z-index: 0; }
.hero-content { position: relative; z-index: 1; animation: fadeInUp 1.5s ease; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.hero p.slogan { font-size: 1.5rem; font-weight: 600; color: var(--accent); margin-bottom: 1.5rem; }
.hero p.description { font-size: 1.2rem; margin-bottom: 2rem; }
.btn { display: inline-block; padding: 0.9rem 2rem; background: var(--white); color: var(--primary); border-radius: 30px; text-decoration: none; font-weight: 600; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.btn:hover { background: var(--accent); color: var(--white); transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,153,204,0.4); }

.products { padding: 5rem 2rem; text-align: center; background: var(--white); }
.products h1 { font-size: 2.5rem; color: var(--primary); margin-bottom: 0.5rem; }
.products p { color: var(--text-light); font-size: 1.1rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; padding: 0 1rem; }
.product-card { background: var(--white); border-radius: 16px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; }
.product-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0,188,212,0.2); }
.product-card img { width: 100%; height: 200px; object-fit: cover; }
.product-card h2 { color: var(--primary); font-size: 1.4rem; margin: 1rem 0 0.5rem; }
.product-card p { color: var(--text-light); margin-bottom: 0.5rem; padding: 0 1rem; }
.product-card .price { color: var(--accent); font-weight: 600; margin-bottom: 1rem; font-size: 1.1rem; }
.product-card a { display: inline-block; margin-bottom: 1rem; padding: 0.5rem 1.2rem; background: var(--primary); color: var(--white); border-radius: 25px; text-decoration: none; transition: 0.3s; }
.product-card a:hover { background: var(--accent); }

footer { text-align: center; padding: 2rem; background: var(--footer-bg); color: var(--white); position: relative; }
footer p { margin: 0; font-size: 0.9rem; }
/* PRODUCT PAGE STYLES */
.product-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.product-gallery {
  flex: 1 1 45%;
  text-align: center;
}

.product-gallery #mainImage {
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.thumbnails {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.thumbnails img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.thumbnails img:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.product-info {
  flex: 1 1 45%;
  max-width: 500px;
}

.product-info h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.price {
  font-size: 1.8rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1rem;
}

.price span {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-left: 0.3rem;
}

.btn-cart {
  display: inline-block;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,188,212,0.3);
}

.btn-cart:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,188,212,0.5);
}

.product-section {
  margin-top: 2rem;
}

.product-section h2 {
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.product-section ul,
.product-section ol {
  margin-left: 1.2rem;
  line-height: 1.6;
}

.reviews {
  margin-top: 2rem;
  font-style: italic;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 900px) {
  .product-container {
    flex-direction: column;
    align-items: center;
  }
  .product-gallery,
  .product-info {
    flex: 1 1 100%;
    text-align: center;
  }
  .product-info {
    margin-top: 2rem;
  }
}
/* Active thumbnail highlight */
.thumbnails img.active-thumb {
  border-color: var(--accent);
  transform: scale(1.05);
}
/* --- Gallery arrows --- */
.main-image-wrapper {
  position: relative;
  display: inline-block;
}
.main-image-wrapper img {
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.5);
  border: none;
  font-size: 2rem;
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.25s ease;
}
.arrow:hover { background: rgba(255,255,255,0.85); }
.arrow.left { left: 10px; }
.arrow.right { right: 10px; }

/* === PAIEMENT PAGE === */
.paiement-container {
  max-width: 600px;
  margin: 3rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  text-align: left;
}

.paiement-container h1 {
  text-align: center;
  color: var(--accent);
  margin-bottom: 2rem;
}

.commande {
  margin-bottom: 2rem;
}

.commande-details {
  background: var(--bg, #f4fdfd);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  line-height: 1.6;
}

.carte-section h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.paiement-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paiement-form label {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

.paiement-form input {
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 1rem;
  margin-top: 0.3rem;
}

.inline-fields {
  display: flex;
  gap: 1rem;
}

.btn-payer {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.btn-payer:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.paiement-message,
.paiement-success {
  text-align: center;
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 600;
}

.paiement-message {
  background: #e0f7fa;
  color: var(--accent);
}

.paiement-success {
  background: #e8f5e9;
  color: #2e7d32;
}

.hidden {
  display: none;
}

/* === Cart Counter === */
.cart-icon {
  position: relative;
  font-size: 1.2rem;
  color: var(--text-dark);
  text-decoration: none;
}

#cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 6px;
  min-width: 18px;
  text-align: center;
}
@keyframes pulseAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.pulse { animation: pulseAnim 0.3s ease; }

/* === MODERN CART PAGE === */
.cart-section {
  max-width: 900px;
  margin: 3rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.08);
}

.cart-section h2 {
  color: var(--accent);
  text-align: center;
  margin-bottom: 2rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg, #f4fdfd);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.05);
}

.cart-item img {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  margin-right: 1.2rem;
}

.item-info {
  flex: 1;
}
.item-info h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}
.item-info p {
  margin: 4px 0;
  color: var(--text-light);
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.custom-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensures the image scales while maintaining its aspect ratio */
  object-position: center; /* Centers the image within the container */
}


.qty-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.qty-btn:hover { background: var(--accent); }

.qty-display {
  font-weight: 600;
  font-size: 1rem;
}

.remove-btn {
  border: none;
  background: none;
  color: #d9534f;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.remove-btn:hover { color: #c9302c; }

.cart-summary {
  margin-top: 2rem;
  text-align: right;
}
.cart-summary h3 {
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.cart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-secondary {
  background: #e0f7fa;
  color: var(--accent);
  padding: 0.9rem 1.4rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* Responsive */
@media (max-width: 700px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
