/* ========================================
   DRAWER.CSS — Mini panier latéral
======================================== */

/* ── Overlay ── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.drawer-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer ── */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100dvh;
  background: var(--color-creme, #faf9f7);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.1);
}
.drawer.is-open {
  transform: translateX(0);
}

/* ── Header ── */
.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md, 1.25rem);
  border-bottom: 1px solid var(--color-or-pale, #e8dcc8);
  flex-shrink: 0;
}
.drawer__title {
  font-family: var(--font-titre, serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-noir, #1a1a1a);
  letter-spacing: 0.03em;
}
.drawer__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-noir, #1a1a1a);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s;
}
.drawer__close:hover { color: var(--color-or, #c9a96e); }

/* ── Body ── */
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm, 0.75rem) var(--space-md, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.75rem);
}

/* ── Item produit ── */
.drawer__item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: var(--space-sm, 0.75rem);
  align-items: center;
  padding-bottom: var(--space-sm, 0.75rem);
  border-bottom: 1px solid var(--color-or-pale, #e8dcc8);
}
.drawer__item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--border-radius-xs, 4px);
  background: var(--color-or-pale, #e8dcc8);
}
.drawer__item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.drawer__item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-noir, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer__item-variante {
  font-size: 0.78rem;
  color: var(--color-sable, #8a7d6b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.drawer__item-prix {
  font-size: 0.95rem;
  color: var(--color-noir, #1a1a1a);
  font-weight: 500;
}

/* ── Actions (quantité + supprimer) ── */
.drawer__item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Contrôle — 2 + */
.drawer__qty {
  display: flex;
  align-items: center;
  gap: 10px;
}
.drawer__qty-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1;
  color: var(--color-noir, #1a1a1a);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, opacity 0.2s;
  padding: 0;
}
.drawer__qty-btn:hover {
  color: var(--color-or, #c9a96e);
}
.drawer__qty-value {
  min-width: 18px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-noir, #1a1a1a);
  user-select: none;
}

/* Bouton supprimer */
.drawer__item-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: #ccc;
  transition: color 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.drawer__item-delete:hover { color: #c0392b; }

/* ── Panier vide ── */
.drawer__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm, 0.75rem);
  color: var(--color-sable, #8a7d6b);
  text-align: center;
  padding: var(--space-lg, 2.5rem);
}
.drawer__empty i {
  font-size: 2rem;
  color: var(--color-or-pale, #e8dcc8);
}

/* ── Footer ── */
.drawer__footer {
  padding: var(--space-md, 1.25rem);
  border-top: 1px solid var(--color-or-pale, #e8dcc8);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.75rem);
  flex-shrink: 0;
}
.drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-noir, #1a1a1a);
  padding-bottom: var(--space-xs, 0.375rem);
}

/* ── Responsive mobile ── */
@media (max-width: 480px) {
  .drawer { max-width: 100%; }
}
