@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Inter:wght@400;500;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fafafa;
  color: #222;
}

:root {
  --gold: #D4AF37;
  --gold-light: #F5E7B3;
  --gold-dark: #996515;
}

h1, h2, h3, .navbar-brand {
  font-family: 'Playfair Display', serif;
}

/* ========== HEADER & NAVIGATION ========== */
.main-header {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.navbar-brand {
  font-size: 1.8rem;
  color: var(--gold-dark);
  text-decoration: none;
}

.navbar-brand i {
  margin-right: 0.4rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-links a {
  margin-left: 1.5rem;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

.nav-links a:hover {
  color: var(--gold-dark);
}

.nav-links .cart-link i {
  font-size: 1.1rem;
}

#cart-count {
  background: var(--gold);
  color: white;
  border-radius: 50%;
  padding: 0.1em 0.4em;
  font-size: 0.7rem;
  position: absolute;
  top: -8px;
  right: -12px;
}

/* ========== BURGER ========== */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--gold-dark);
  padding: 0.3rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: white;
    padding: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 200;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
    width: 100%;
    margin-left: 0;
  }

  .main-header {
    position: relative;
  }

  /* Grille admin une colonne */
  .admin-layout {
    grid-template-columns: 1fr !important;
  }

  /* Cartes produits */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  }
}

/* ========== BANNIÈRE PROMO ========== */
.promo-banner {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  text-align: center;
  padding: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.promo-banner a {
  color: white;
  text-decoration: underline;
}

/* ========== GRILLE PRODUITS ========== */
.category-section {
  margin: 3rem 0;
}

.category-section h2 {
  border-bottom: 2px solid var(--gold-light);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--gold-dark);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.product-img, .main-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.product-img-placeholder {
  width: 100%;
  height: 220px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
}

.product-details {
  padding: 1rem;
}

.product-details h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.category-badge {
  font-size: 0.8rem;
  color: var(--gold-dark);
  background: var(--gold-light);
  padding: 0.2em 0.6em;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.description {
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.size {
  font-size: 0.85rem;
  color: #555;
}

.price {
  font-weight: 700;
  font-size: 1.2rem;
  color: #000;
  margin: 0.6rem 0;
}

.stock {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.stock.in-stock { color: #2e7d32; }
.stock.out-of-stock { color: #c62828; }

/* ========== GALERIE IMAGES ========== */
.image-gallery { position: relative; }
.thumbnail-row {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}
.thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
}
.thumbnail:hover { border-color: var(--gold); }

/* ========== SÉLECTEUR COULEUR ========== */
.color-selector {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.color-selector select {
  padding: 0.3rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}
.color-swatch-small {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #aaa;
  display: inline-block;
  vertical-align: middle;
}

/* ========== BOUTON AJOUT PANIER ========== */
.btn-add-to-cart {
  width: 100%;
  background: var(--gold);
  color: white;
  border: none;
  padding: 0.7rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.btn-add-to-cart:hover { background: var(--gold-dark); }
.btn-add-to-cart:disabled { background: #ccc; cursor: not-allowed; }

/* ========== PANIER ========== */
.cart-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
}
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}
.cart-table th, .cart-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.cart-table th { background: #f9f9f9; }
.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.quantity-control button {
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
}
.quantity-control span { min-width: 30px; text-align: center; }
.btn-remove { background: transparent; border: none; color: red; cursor: pointer; font-size: 1.2rem; }
.original-price { text-decoration: line-through; color: #888; font-size: 0.9rem; margin-right: 0.3rem; }
.discounted-price { font-weight: bold; color: #2e7d32; }
.cart-total { text-align: right; font-size: 1.3rem; font-weight: bold; margin: 1rem 0; }
.order-form {
  background: #f8f8f8;
  border: 1px solid #ddd;
  padding: 1.5rem;
  border-radius: 12px;
  display: none;
}
.order-form.active { display: block; }
.order-form label { display: block; margin: 0.5rem 0 0.2rem; font-weight: 500; }
.order-form input, .order-form textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.btn-order {
  background: var(--gold);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.btn-continue {
  background: #007bff;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}
.success-message {
  background: #d4edda;
  color: #155724;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  display: none;
}
.success-message.active { display: block; }
.color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #aaa;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.3rem;
}

/* ========== ADMIN ========== */
.admin-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
}
.form-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.form-card h3 { margin-top: 0; }
.form-card label { display: block; margin-top: 1rem; font-weight: 500; }
.form-card input, .form-card select, .form-card textarea {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.2rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.btn-gold {
  background: var(--gold);
  color: white;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}
.btn-gold:hover { background: var(--gold-dark); }
.btn-edit { background: #ffc107; color: #000; padding: 0.3rem 0.7rem; text-decoration: none; border-radius: 4px; }
.btn-delete { background: #dc3545; color: white; padding: 0.3rem 0.7rem; border: none; border-radius: 4px; cursor: pointer; }
.product-table, .orders-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.product-table th, .product-table td, .orders-table th, .orders-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.product-table th, .orders-table th { background: #f9f9f9; }
.product-table img { max-width: 60px; max-height: 60px; border-radius: 4px; }
.error { color: red; margin-bottom: 1rem; }

.color-list, .discount-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.color-list li, .discount-list li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.color-swatch-big { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #ccc; display: inline-block; }
.delete-btn { background: transparent; border: none; color: red; cursor: pointer; font-size: 1.1rem; }
.add-form { display: flex; gap: 0.5rem; align-items: end; margin-top: 0.5rem; flex-wrap: wrap; }
.add-form input[type="text"], .add-form input[type="number"] { width: auto; flex: 1; }
.add-form button { padding: 0.4rem 0.8rem; }

/* ========== STATUTS COMMANDE ========== */
.status-badge {
  display: inline-block;
  padding: 0.2em 0.8em;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-new { background: #3498db; color: white; }
.status-processing { background: #f39c12; color: white; }
.status-delivered { background: #2ecc71; color: white; }
.status-cancelled { background: #e74c3c; color: white; }

.order-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  background: #f0f0f0;
  font-weight: 500;
}
.filter-btn.active { background: var(--gold); color: white; }
select.status-select { padding: 0.2rem; border-radius: 4px; }
.whatsapp-btn {
  background: #25D366;
  color: white;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
}

/* ========== DASHBOARD ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.stat-card i { font-size: 2rem; color: var(--gold); }
.stat-value { font-size: 2rem; font-weight: bold; color: var(--gold-dark); }
.low-stock { margin-top: 2rem; }
.low-stock ul { list-style: none; }
.low-stock li { padding: 0.3rem 0; border-bottom: 1px solid #eee; }

/* ========== LOGIN ========== */
.login-box {
  max-width: 400px;
  margin: 5rem auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  text-align: center;
}
.login-box h2 i { color: var(--gold); }
.login-box input, .login-box button { width: 100%; padding: 0.7rem; margin: 0.4rem 0; border-radius: 6px; border: 1px solid #ddd; }
.login-box button { background: var(--gold); color: white; border: none; font-weight: bold; cursor: pointer; }

/* ========== CONFIRMATION ========== */
.confirmation-container {
  max-width: 600px;
  margin: 4rem auto;
  text-align: center;
  background: #f9f9f9;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #eee;
}
.check-icon { font-size: 3rem; color: #2ecc71; }
.order-id { font-weight: bold; font-size: 1.4rem; margin: 1rem 0; }
.whatsapp-link {
  display: inline-block;
  background: #25D366;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  margin-top: 1rem;
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 2rem;
  background: #222;
  color: #aaa;
  margin-top: 4rem;
}

/* ========== RESPONSIVE COMPLÉMENTS ========== */
@media (max-width: 768px) {
  .product-table, .orders-table {
    display: block;
    overflow-x: auto;
  }
  .order-filters {
    flex-direction: column;
  }
  .add-form {
    flex-direction: column;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .cart-table { font-size: 0.85rem; }
  .quantity-control button { width: 25px; height: 25px; }
}
/* ========== FOOTER ========== */
footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3,
.footer-section h4 {
  color: var(--gold);
  margin-bottom: 1rem;
  font-family: 'Playfair Display', serif;
}

.footer-section h3 i {
  margin-right: 0.5rem;
}

.footer-section p {
  line-height: 1.6;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.contact-list li i {
  color: var(--gold);
  width: 20px;
  text-align: center;
}

.contact-list a {
  color: #ccc;
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--gold);
}

.social-icons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #333;
  color: #ccc;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: var(--gold);
  color: #1a1a1a;
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #333;
  font-size: 0.9rem;
  color: #888;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  .footer-section {
    text-align: center;
  }

  .contact-list li {
    justify-content: center;
  }

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