:root {
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #111;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-card: #1e1e1e;
  --text: #f0f0f0;
  --text-muted: #aaa;
  --accent: #fff;
  --border: #333;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 1.4rem; font-weight: 700; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-actions input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-size: 0.9rem;
  width: 200px;
}

.nav-actions input:focus { border-color: #888; }

.nav-actions button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.nav-actions button:hover { background: var(--bg); }

.filters { display: flex; gap: 10px; padding: 20px 32px; flex-wrap: wrap; }

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 24px 32px 40px;
}

.product-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

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

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}

.card-body { padding: 16px; }
.card-body h3 { font-size: 1rem; margin-bottom: 4px; }
.card-body .brand { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.price { font-weight: 700; font-size: 1.1rem; }

.btn-add {
  padding: 8px 16px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}

.btn-add:hover { opacity: 0.8; }

.wishlist-icon {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--bg-card);
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.wishlist-icon:hover { transform: scale(1.15); }
.wishlist-icon.active { color: red; }

.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}

.cart-sidebar {
  position: fixed;
  top: 0; right: -400px;
  width: 380px;
  height: 100vh;
  background: var(--bg-card);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}

.cart-sidebar.open { right: 0; }
.cart-overlay.open { display: block; }

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 { font-size: 1.2rem; }
.cart-header button { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; background: #eee; }
.cart-item-info { flex: 1; }    
/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  font-size: 0.9rem;
  min-width: 260px;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid #22c55e; }
.toast.error   { border-left: 4px solid #ef4444; }
.toast.info    { border-left: 4px solid #3b82f6; }

.toast-icon { font-size: 1.1rem; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(60px); }
}

.toast.hiding {
  animation: slideOut 0.3s ease forwards;
}

/* ===== ANIMATIONS PRODUITS ===== */
.product-card {
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.10s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.20s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.30s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.40s; }

/* ===== MODAL PRODUIT ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: 20px;
  width: 90%;
  max-width: 560px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.modal img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.modal-body { padding: 24px; }
.modal-body h2 { font-size: 1.4rem; margin-bottom: 4px; }
.modal-body .brand { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.modal-body .description { font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; color: var(--text-muted); }

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer .price { font-size: 1.5rem; font-weight: 700; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  color: var(--text);
  z-index: 1;
}

.modal-wrapper { position: relative; }

/* ===== BTN VOIR DÉTAIL ===== */
.btn-detail {
  padding: 8px 14px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-detail:hover {
  background: var(--bg);
  color: var(--text);
}