@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #111827; --brand-hover: #374151; --accent: #eab308;
  --bg: #f9fafb; --card: #ffffff; --text: #0f172a; --text-soft: #6b7280;
  --radius-lg: 16px; --radius-pill: 999px;
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
html { scroll-behavior: smooth; }
body { font-family: "Poppins", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
a { color: inherit; text-decoration: none; transition: 0.2s; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ========== TOP BAR & HEADER ========== */
.top-bar { background: var(--brand); color: #fff; text-align: center; font-size: 0.75rem; font-weight: 600; padding: 0.5rem; text-transform: uppercase; letter-spacing: 0.1em; }

header { background: var(--card); border-bottom: 1px solid #e5e7eb; padding: 1rem 1.5rem; position: sticky; top: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
header .logo { font-weight: 800; font-size: 1.2rem; letter-spacing: 0.15em; color: var(--brand); }

.navigation.header-actions { display: flex; align-items: center; gap: 1rem; }
.nav-link { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; background: #f3f4f6; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500; color: var(--brand); }
.nav-item { position: relative; }
.dropdown { position: absolute; top: 120%; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--card); border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: var(--shadow-hover); min-width: 180px; opacity: 0; visibility: hidden; transition: all 0.2s ease; overflow: hidden; z-index: 60; }
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown a { display: block; padding: 0.8rem 1rem; font-size: 0.85rem; color: var(--text); }
.dropdown a:hover { background: var(--brand); color: #fff; }

.cart-btn { position: relative; font-size: 1.1rem; padding: 0.5rem; color: var(--brand); }
.cart-count { position: absolute; top: -2px; right: -5px; background: var(--accent); color: #000; font-size: 0.7rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ========== SEARCH BAR ========== */
.header-search { width: 100%; max-width: 600px; margin: 0 auto; position: relative; }
.search-bar { display: flex; align-items: center; background: #f3f4f6; padding: 0.6rem 1rem; border-radius: var(--radius-pill); }
.search-bar input { border: none; background: transparent; outline: none; flex: 1; margin-left: 0.5rem; font-size: 0.9rem; }
#searchResults { position: absolute; top: 110%; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow-hover); border: 1px solid #e5e7eb; z-index: 100; max-height: 300px; overflow-y: auto; display: none; }
#searchResults .item { padding: 0.8rem 1rem; border-bottom: 1px solid #f3f4f6; cursor: pointer; display: flex; justify-content: space-between; font-size: 0.85rem; }

@media (min-width: 768px) {
  header { flex-direction: row; justify-content: space-between; padding: 0.8rem 3rem; }
}

/* ========== GRID PRODUITS (ACCUEIL) ========== */
.main-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.title { text-align: center; font-size: 1.8rem; font-weight: 700; margin: 2rem 0 1.5rem; }
.projects .content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 768px) { .projects .content { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2rem; } }

.project-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.project-image { padding-top: 100%; position: relative; }
.project-image img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.project-info { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.project-category { font-size: 0.75rem; color: var(--text-soft); text-transform: uppercase; margin-bottom: 0.3rem; }
.badge { font-size: 0.65rem; padding: 0.2em 0.6em; border-radius: 4px; font-weight: 600; margin-left: 5px; }
.badge.original { background: #fef3c7; color: #92400e; }
.badge.decant { background: #e0e7ff; color: #3730a3; }
.project-title span { font-size: 0.95rem; font-weight: 600; display: block; margin-bottom: 0.5rem; }

.option-toggle { display: flex; background: #f3f4f6; border-radius: 8px; padding: 3px; margin-top: auto; margin-bottom: 1rem; }
.opt-btn { flex: 1; font-size: 0.75rem; padding: 0.4rem; border-radius: 6px; font-weight: 500; color: var(--text-soft); }
.opt-btn.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* --- MODIF 1 : BOUTON SOUS LE PRIX --- */
.product-meta {
  display: flex;
  flex-direction: column; /* Empile verticalement */
  gap: 0.6rem;
  border-top: 1px solid #f3f4f6;
  padding-top: 0.8rem;
}
.price { font-weight: 700; font-size: 1.1rem; color: var(--brand); }
.add-btn {
  background: var(--brand);
  color: #fff;
  padding: 0.6rem; /* Plus large pour le doigt */
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  width: 100%; /* Prend toute la largeur */
}
.add-btn:hover { background: var(--brand-hover); }

/* ========== PAGE PRODUIT DETAIL (NOUVEAU STYLE) ========== */
.product-detail-wrapper { max-width: 1000px; margin: 2rem auto; padding: 0 1.5rem; display: grid; gap: 2rem; }
.product-detail-img { background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; padding: 2rem; display: flex; justify-content: center; }
.product-detail-img img { max-height: 400px; width: auto; object-fit: contain; }
.product-detail-info h1 { font-size: 1.8rem; line-height: 1.2; margin-bottom: 0.5rem; }
.brand-label { font-size: 1rem; color: var(--text-soft); display: block; margin-bottom: 1rem; }

/* Texte stylé */
.story-box { margin-bottom: 1.5rem; color: #374151; font-size: 0.95rem; line-height: 1.7; }
.notes-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.note-tag { background: #f3f4f6; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.8rem; color: #4b5563; font-weight: 500; }

.variant-list { display: flex; flex-direction: column; gap: 1rem; }
.variant-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; transition: 0.2s; }
.variant-row:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.variant-info strong { display: block; font-size: 0.95rem; }
.variant-info span { font-size: 0.8rem; color: var(--text-soft); }
.variant-action { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.variant-price { font-weight: 700; font-size: 1rem; }
.variant-btn-small { background: var(--brand); color: #fff; padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; }

@media (min-width: 768px) {
  .product-detail-wrapper { grid-template-columns: 1fr 1fr; align-items: start; }
  .variant-action { flex-direction: row; align-items: center; gap: 1rem; }
}

/* ========== PANIER (CORRECTION MOBILE) ========== */
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 400px; /* Pleine largeur sur mobile */
  background: #fff; box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  z-index: 2000; /* SUPER IMPORTANT : Au-dessus de tout */
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
body.cart-open .cart-drawer { transform: translateX(0); }
body.cart-open { overflow: hidden; }
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1999; opacity: 0; visibility: hidden; transition: 0.3s; }
body.cart-open .cart-overlay { opacity: 1; visibility: visible; }

.cart-header { padding: 1.5rem; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; align-items: center; }
.cart-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.cart-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px dashed #e5e7eb; }
.cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.item-details { flex: 1; }
.item-title { font-weight: 600; font-size: 0.9rem; }
.qty-input { width: 40px; text-align: center; border: 1px solid #ddd; border-radius: 4px; margin-right: 10px; }
.remove-btn { color: #ef4444; font-size: 0.8rem; text-decoration: underline; }

.cart-footer { padding: 1.5rem; border-top: 1px solid #f3f4f6; background: #f9fafb; }
.subtotal { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 1rem; }
.checkout-btn { display: block; width: 100%; background: #25D366; color: #fff; text-align: center; padding: 1rem; border-radius: 12px; font-weight: 600; }

/* Footer */
.footer { text-align: center; padding: 3rem 1.5rem; background: #fff; border-top: 1px solid #e5e7eb; margin-top: auto; }
.social-icons { margin-top: 1rem; display: flex; justify-content: center; gap: 1rem; }
