/* ============================================================
   AMAYAS — Styles Panier & Cart Drawer
   ============================================================ */

/* ── Icône panier navbar ───────────────────────────────────── */
.cart-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--texte, #1c1c1c);
  transition: color 0.2s;
  flex-shrink: 0;
}
.cart-nav-btn:hover { color: var(--bordeaux, #6B1E1E); }
.cart-nav-btn svg   { display: block; }

.cart-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 18px; height: 18px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Cart Drawer overlay ──────────────────────────────────── */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.3s;
}
.cart-drawer.open {
  background: rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
body.cart-open { overflow: hidden; }

/* ── Drawer panel ────────────────────────────────────────── */
.cart-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.15);
}
.cart-drawer.open .cart-drawer-panel { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f0ebe3;
  flex-shrink: 0;
}
.cart-drawer-header h3 {
  font-family: var(--font-titre, serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--texte, #1c1c1c);
}
.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
.cart-drawer-close:hover { color: var(--bordeaux, #6B1E1E); }

/* ── Items list ──────────────────────────────────────────── */
.cart-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.cart-drawer-content::-webkit-scrollbar { width: 4px; }
.cart-drawer-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid #f8f5f0;
}
.cart-item-img {
  width: 72px; height: 72px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  background: #f5f0ea;
  flex-shrink: 0;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--texte, #1c1c1c);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-sub  { font-size: 0.72rem; color: #888; margin-bottom: 4px; }
.cart-item-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bordeaux, #6B1E1E);
  margin-bottom: 8px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid #e8e2db;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.cart-qty-btn {
  background: none;
  border: none;
  padding: 5px 12px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--texte, #1c1c1c);
  line-height: 1;
  transition: background 0.15s;
}
.cart-qty-btn:hover { background: #f5f0ea; }
.cart-qty-val {
  padding: 5px 8px;
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 28px;
  text-align: center;
  border-left: 1.5px solid #e8e2db;
  border-right: 1.5px solid #e8e2db;
}

.cart-item-del {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: #bbb;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  margin-top: 2px;
}
.cart-item-del:hover { color: #dc2626; }

/* ── Panier vide ─────────────────────────────────────────── */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}
.cart-empty-icon { font-size: 2.5rem; }
.cart-empty p    { color: #888; font-size: 0.9rem; }
.cart-btn-catalog {
  margin-top: 8px;
  display: inline-block;
  padding: 10px 22px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.cart-btn-catalog:hover { background: #4f1515; }

/* ── Footer du drawer ────────────────────────────────────── */
.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid #f0ebe3;
  flex-shrink: 0;
  background: #faf7f4;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
#cartDrawerTotal { color: var(--bordeaux, #6B1E1E); }
.cart-shipping-note {
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 14px;
}
.btn-checkout {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
.btn-checkout:hover { background: #4f1515; }

.cart-continue-shopping {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: #888;
  text-decoration: underline;
  margin-top: 12px;
  cursor: pointer;
  transition: color 0.15s;
}
.cart-continue-shopping:hover { color: var(--bordeaux, #6B1E1E); }

/* ── Boutons produit ────────────────────────────────────── */
.btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.1s;
}
.btn-add-cart:hover  { background: #4f1515; }
.btn-add-cart:active { transform: scale(0.98); }
.btn-add-cart.added  { background: #16a34a; }

.btn-buy-now {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: none;
  color: var(--bordeaux, #6B1E1E);
  border: 2px solid var(--bordeaux, #6B1E1E);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: all 0.2s;
}
.btn-buy-now:hover {
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
}

.product-cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.product-cta-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  color: #1a7f3c;
  border: 1.5px solid #b7dfca;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.2s;
}
.product-cta-wa:hover { background: #f0faf5; }

/* Sticky bar produit */
.sticky-commander { z-index: 500; }
.sticky-btn-add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.2s;
}
.sticky-btn-add-cart:hover { background: #4f1515; }

/* ── Toast notification ──────────────────────────────────── */
.cart-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c1c1c;
  color: #fff;
  padding: 11px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Page Panier (/panier) ───────────────────────────────── */
.panier-page { padding: 60px 0 80px; min-height: 60vh; }
.panier-page h1 {
  font-family: var(--font-titre, serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
  margin-bottom: 8px;
}
.panier-page .panier-sub { color: #888; font-size: 0.9rem; margin-bottom: 40px; }

.panier-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 820px) {
  .panier-layout { grid-template-columns: 1fr; }
}

/* Liste d'articles dans /panier */
.panier-items { display: flex; flex-direction: column; gap: 0; }
.panier-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #f0ebe3;
}
.panier-item-img {
  width: 88px; height: 88px;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  background: #f5f0ea;
  flex-shrink: 0;
}
.panier-item-info { flex: 1; min-width: 0; }
.panier-item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.panier-item-sub  { font-size: 0.78rem; color: #888; margin-bottom: 6px; }
.panier-item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bordeaux, #6B1E1E);
}
.panier-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid #e8e2db;
  border-radius: 8px;
  overflow: hidden;
}
.panier-qty-btn {
  background: none;
  border: none;
  padding: 7px 14px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--texte, #1c1c1c);
  transition: background 0.15s;
}
.panier-qty-btn:hover { background: #f5f0ea; }
.panier-qty-val {
  padding: 7px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
  border-left: 1.5px solid #e8e2db;
  border-right: 1.5px solid #e8e2db;
}
.panier-item-del {
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.panier-item-del:hover { color: #dc2626; }

/* Résumé + formulaire */
.panier-summary {
  background: #faf7f4;
  border-radius: 14px;
  padding: 28px;
  position: sticky;
  top: 90px;
}
.panier-summary h2 {
  font-family: var(--font-titre, serif);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.panier-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1.5px solid #e8e2db;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.panier-total-sub {
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 20px;
}
#panierTotal { color: var(--bordeaux, #6B1E1E); }

/* Formulaire checkout */
.checkout-form { display: flex; flex-direction: column; gap: 12px; }
.checkout-form label { font-size: 0.8rem; font-weight: 600; color: #555; }
.checkout-form input,
.checkout-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e8e2db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.checkout-form input:focus,
.checkout-form textarea:focus { border-color: var(--bordeaux, #6B1E1E); }
.checkout-form textarea { min-height: 80px; resize: vertical; }
.checkout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-confirm-order {
  width: 100%;
  padding: 15px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: background 0.2s;
  margin-top: 4px;
}
.btn-confirm-order:hover    { background: #4f1515; }
.btn-confirm-order:disabled { opacity: 0.6; cursor: not-allowed; }
.checkout-cod {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
}

/* États checkout */
.checkout-success,
.checkout-empty {
  text-align: center;
  padding: 60px 20px;
}
.checkout-success-icon { font-size: 3rem; margin-bottom: 16px; }
.checkout-success h2  { font-family: var(--font-titre, serif); font-size: 1.6rem; font-weight: 400; margin-bottom: 10px; }
.checkout-success p   { color: #666; font-size: 0.9rem; margin-bottom: 20px; }
.checkout-empty-icon  { font-size: 3rem; margin-bottom: 16px; }
.checkout-empty p     { color: #888; margin-bottom: 20px; }
.btn-back-catalog {
  display: inline-block;
  padding: 12px 28px;
  background: var(--bordeaux, #6B1E1E);
  color: #fff;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-back-catalog:hover { background: #4f1515; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .cart-toast { bottom: 20px; font-size: 0.8rem; padding: 10px 16px; }
  .panier-item-img { width: 68px; height: 68px; }
}
