/* ---- 1. Variables CSS ---------------------------------------- */
:root {
  --color-green:       #6b7c5a;
  --color-green-dark:  #5a6b49;
  --color-black:       #111827;
  --color-white:       #ffffff;
  --color-beige:       #f5f1e8;
  --color-beige-grad:  #f5f1e8;
  --color-gray-text:   #6b7280;
  --color-gray-light:  #9ca3af;
  --color-gray-border: #e5e7eb;
  --color-green-ok:    #16a34a;
  --color-red:         #ef4444;

  --font-family:  'Inter', sans-serif;
  --radius-md:    1rem;
  --radius-lg:    1.5rem;
  --radius-full:  9999px;

  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);

  --transition: 0.3s cubic-bezier(.4, 0, .2, 1);

  --container-max: 80rem;
  --container-px:  1.5rem;
}

/* ---- 2. Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
  font-family: var(--font-family);
  background: linear-gradient(to bottom, var(--color-beige-grad), var(--color-white));
  color: var(--color-black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img    { display: block; max-width: 100%; height: auto; }
a      { text-decoration: none; color: inherit; }
ul     { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ---- 3. Layout ----------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* ---- 4. Navigation ------------------------------------------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgb(0 0 0 / .05);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-black);
}

.logo-icon {
  width: 2.5rem; height: 2.5rem;
  background: var(--color-green);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.nav-links {
  display: none;
  gap: 3rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  transition: color var(--transition);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-cart {
  position: relative;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-full);
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #374151;
  transition: background var(--transition);
}

.btn-cart:hover { background: #e5e7eb; }

.cart-badge {
  position: absolute;
  top: -0.25rem; right: -0.25rem;
  width: 1.25rem; height: 1.25rem;
  background: var(--color-green);
  color: white;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.btn-account {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--color-black);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition);
}

.btn-account:hover { background: #1f2937; }

.btn-menu {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

/* ---- 5. Page panier ------------------------------------------ */
.cart-page {
  padding-top: 8rem;
  padding-bottom: 5rem;
}

.cart-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 2rem;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

/* ---- 6. Article de panier ------------------------------------ */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  transition: box-shadow var(--transition);
}

.cart-item:hover { box-shadow: var(--shadow-lg); }

.item-img {
  width: 8rem;
  height: 8rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  overflow: hidden;
}

.item-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.item-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 0.25rem;
}

.item-sub {
  font-size: 0.875rem;
  color: var(--color-gray-text);
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.item-price-wrap { text-align: right; }

.item-unit-price {
  font-size: 0.875rem;
  color: var(--color-gray-text);
  margin-bottom: 0.25rem;
}

.item-total-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-green);
}

/* ---- 7. Contrôle quantité ------------------------------------ */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qty-btn {
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-full);
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  color: var(--color-black);
  transition: background var(--transition), color var(--transition);
}

.qty-btn:hover:not(:disabled) { background: #e5e7eb; }

.qty-btn:disabled {
  background: #f9fafb;
  color: #d1d5db;
  cursor: default;
}

.qty-val {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-black);
  min-width: 3rem;
  text-align: center;
}

/* Bouton supprimer */
.btn-delete {
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--color-gray-light);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.btn-delete:hover {
  color: var(--color-red);
  background: #fef2f2;
}

/* ---- 8. Récapitulatif ---------------------------------------- */
.cart-summary {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: sticky;
  top: 8rem;
}

.cart-summary h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-black);
  margin-bottom: 1.5rem;
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #374151;
}

.summary-row--total {
  border-top: 1px solid var(--color-gray-border);
  padding-top: 1rem;
}

.summary-row--total span:first-child {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-black);
}

.total-amount {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-green);
}

.fw-semibold { font-weight: 600; }
.text-green   { color: var(--color-green-ok); }

/* Trust badges */
.summary-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--color-gray-text);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.trust-item i { color: var(--color-green-ok); }

/* ---- 9. Boutons ---------------------------------------------- */
.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--color-green);
  color: white;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-checkout i { font-size: 1.25rem; }

.btn-checkout:hover {
  background: var(--color-green-dark);
  transform: scale(1.04);
  box-shadow: var(--shadow-xl);
}

.btn-continue {
  display: block;
  text-align: center;
  color: var(--color-green);
  font-weight: 500;
  margin-top: 1.5rem;
  transition: color var(--transition);
}

.btn-continue:hover { color: var(--color-green-dark); }

/* ---- 10. Responsive ------------------------------------------ */
@media (min-width: 768px) {
  .nav-links   { display: flex; }
  .btn-account { display: flex; }
  .btn-menu    { display: none; }
}

@media (min-width: 1024px) {
  .cart-layout { grid-template-columns: 2fr 1fr; }
}