/* ════════════════════════════════
   CART — Style minimal Licorne Passion
   Classes inchangées (.cart-*) ; JS et Twig préservés.
════════════════════════════════ */

body.cart-page {
  background: #fff;
  color: #000;
  font-family: 'Urbanist', sans-serif;
}
body.cart-page .blob { display: none; }

.cart {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  font-family: 'Urbanist', sans-serif;
}

/* ── Header ── */
.cart-header {
  margin-bottom: 32px;
  text-align: center;
}
.cart-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 24px;
  font-weight: 300;
  color: #000;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  margin: 0 0 4px;
}
.cart-subtitle {
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  color: #6a7282;
  margin: 0;
}

/* ── Layout (items left, summary right) ── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}

.cart-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Toolbar ── */
.cart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.cart-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  color: #4a5565;
}
.cart-check-label input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #d1d5dc;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s, background 0.18s;
}
.cart-check-label input[type="checkbox"]:hover { border-color: #000; }
.cart-check-label input[type="checkbox"]:checked { background: #000; border-color: #000; }
.cart-check-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px; top: 0;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.cart-check-label input[type="checkbox"]:disabled { opacity: 0.4; cursor: not-allowed; }

.cart-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font-family: 'Urbanist', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4344f;
  cursor: pointer;
  transition: opacity 0.18s;
}
.cart-clear-btn:hover { opacity: 0.7; }
.cart-clear-btn svg {
  width: 12px; height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Items list ── */
.cart-items {
  display: flex;
  flex-direction: column;
}

.cart-item {
  display: grid;
  grid-template-columns: 24px 80px 1fr auto auto 32px;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  position: relative;
}
.cart-item--deleted,
.cart-item--oos { opacity: 0.7; }

.cart-item-check {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid #d1d5dc;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s, background 0.18s;
  justify-self: center;
}
.cart-item-check:hover:not(:disabled) { border-color: #000; }
.cart-item-check:checked { background: #000; border-color: #000; }
.cart-item-check:checked::after {
  content: '';
  position: absolute;
  left: 3px; top: 0;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.cart-item-check:disabled { opacity: 0.3; cursor: not-allowed; }

.cart-item-img {
  width: 80px;
  height: 80px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-img svg {
  width: 28px; height: 28px;
  fill: none;
  stroke: #d1d5dc;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cart-item-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #000;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: opacity 0.18s;
  text-transform: lowercase;
}
.cart-item-title:hover { opacity: 0.7; }
.cart-item-variant {
  font-family: 'Urbanist', sans-serif;
  font-size: 11px;
  color: #6a7282;
}
/* Composition d'un bundle (sous-liste des composants retenus) */
.cart-item-composition {
  list-style: none;
  margin: 4px 0 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, .025);
  border-left: 2px solid rgba(0, 0, 0, .12);
  border-radius: 0;
  font-family: 'Urbanist', sans-serif;
}
.cart-item-composition li {
  font-size: 11px;
  color: #4a5565;
  line-height: 1.5;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.cart-item-composition__name { font-weight: 500; color: #000; }
.cart-item-composition__variant { color: #6a7282; }
.cart-item-composition__qty {
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 10px;
  color: #6a7282;
  margin-left: auto;
}
.cart-item-unit {
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  color: #4a5565;
}

/* ── Item badges (status flags) ── */
.cart-item-deleted-badge,
.cart-item-oos-badge,
.cart-item-restock-badge,
.cart-item-low-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 3px 8px;
  font-family: 'Urbanist', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
}
.cart-item-deleted-badge {
  color: #c4344f;
  background: #fff5f5;
  border: 1px solid #f0c4cf;
}
.cart-item-oos-badge {
  color: #c4344f;
  background: #fff5f5;
  border: 1px solid #f0c4cf;
}
.cart-item-restock-badge {
  color: #0a7c45;
  background: #f0f9f4;
  border: 1px solid #a3d9bb;
}
.cart-item-low-badge {
  color: #b27300;
  background: #fff8eb;
  border: 1px solid #ddb672;
}
.cart-item-deleted-badge svg,
.cart-item-oos-badge svg,
.cart-item-restock-badge svg,
.cart-item-low-badge svg {
  width: 10px; height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Badge précommande par ligne — noir/blanc inversé pour se distinguer
   sans crier. Le statut « précommande » est informationnel, pas une
   erreur — donc pas de palette rouge/orange comme oos/low. */
.cart-item-preorder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 3px 8px;
  font-family: 'Urbanist', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #000;
}
.cart-item-preorder-badge svg {
  width: 10px; height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Récap précommande global — sous le total, avant le bouton commander.
   Style "panneau d'info" léger, border-left noir pour ancrer visuellement.
   `--mixed` ajoute juste un fond très légèrement orangé pour signaler le
   cas spécifique d'un panier hétérogène (expédition unique différée). */
.cart-preorder-recap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: #f7f7f5;
  border-left: 2px solid #000;
  font-family: 'Urbanist', sans-serif;
  color: #4a5565;
}
.cart-preorder-recap--mixed {
  background: #fff8eb;
  border-left-color: #b27300;
}
.cart-preorder-recap svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #000;
}
.cart-preorder-recap--mixed svg { color: #b27300; }
.cart-preorder-recap__body strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 4px;
}
.cart-preorder-recap--mixed .cart-preorder-recap__body strong { color: #6f4900; }
.cart-preorder-recap__body p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

/* ── Quantity stepper ── */
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5dc;
  height: 32px;
}
.cart-qty-btn {
  width: 28px;
  height: 30px;
  background: #fff;
  border: 0;
  font-family: 'Urbanist', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000;
  cursor: pointer;
  transition: background 0.18s;
}
.cart-qty-btn:hover:not(:disabled) { background: #f3f4f6; }
.cart-qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.cart-qty-input {
  width: 36px;
  height: 30px;
  border: 0;
  border-left: 1px solid #d1d5dc;
  border-right: 1px solid #d1d5dc;
  background: #fff;
  font-family: 'Urbanist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #000;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-qty-input:focus { background: #fafafa; }
.cart-qty-input:disabled { opacity: 0.5; }

.cart-item-subtotal {
  font-family: 'Urbanist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #000;
  white-space: nowrap;
  text-align: right;
  min-width: 70px;
}

.cart-item-remove {
  width: 28px;
  height: 28px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #6a7282;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s;
}
.cart-item-remove:hover { color: #c4344f; }
.cart-item-remove svg {
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Summary card (right column) ── */
.cart-summary { position: sticky; top: 92px; }
.cart-summary-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  padding: 24px;
}
.cart-summary-card h2 {
  font-family: 'Urbanist', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 16px;
}

.cart-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-summary-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  color: #4a5565;
  line-height: 1.4;
}
.cart-summary-line-name {
  flex: 1;
  text-transform: lowercase;
  color: #000;
}
.cart-summary-line-name small { color: #6a7282; font-weight: 400; }
.cart-summary-line-detail {
  white-space: nowrap;
  color: #6a7282;
  font-variant-numeric: tabular-nums;
}
.cart-summary-line-qty { font-weight: 500; color: #000; }

.cart-summary-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 16px 0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  color: #4a5565;
}
.cart-summary-total {
  font-size: 15px;
  font-weight: 600;
  color: #000;
}

.cart-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.18s;
}
.cart-order-btn:hover { opacity: 0.85; }
.cart-order-btn:active { transform: translateY(1px); }
.cart-order-btn svg {
  width: 12px; height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-summary-empty-msg {
  margin-top: 16px;
  padding: 10px;
  text-align: center;
  font-family: 'Urbanist', sans-serif;
  font-size: 11px;
  color: #6a7282;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

/* ── Empty state ── */
.cart-empty {
  text-align: center;
  padding: 80px 24px;
  font-family: 'Urbanist', sans-serif;
  color: #6a7282;
}
.cart-empty svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #d1d5dc;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 16px;
}
.cart-empty p {
  font-size: 14px;
  color: #4a5565;
  margin: 0 0 20px;
}
.cart-cta-btn {
  display: inline-block;
  padding: 12px 22px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-family: 'Urbanist', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.18s;
}
.cart-cta-btn:hover { opacity: 0.85; }

/* ════════════════════════════════
   MODALS (clear cart + login)
════════════════════════════════ */
.cart-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cart-modal-overlay.open { display: flex; }

/* Clear-cart modal */
.cart-modal {
  background: #fff;
  border: 1px solid #000;
  padding: 28px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  font-family: 'Urbanist', sans-serif;
}
.cart-modal-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 1px solid #c4344f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-modal-icon svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: #c4344f;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cart-modal h3 {
  font-family: 'Urbanist', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 8px;
}
.cart-modal p {
  font-family: 'Urbanist', sans-serif;
  font-size: 13px;
  color: #4a5565;
  margin: 0 0 20px;
  line-height: 1.5;
}
.cart-modal-foot {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.cart-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: 'Urbanist', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.cart-modal-btn svg {
  width: 11px; height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cart-modal-btn--cancel:hover { background: #000; color: #fff; }
.cart-modal-btn--confirm {
  background: #c4344f;
  border-color: #c4344f;
  color: #fff;
}
.cart-modal-btn--confirm:hover { opacity: 0.85; }

/* Login modal — uses .auth-* classes (loaded via auth.css) for the form;
   only the modal shell is styled here. */
.cart-login-card {
  position: relative;
  background: #fff;
  border: 1px solid #000;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 380px;
  font-family: 'Urbanist', sans-serif;
}
.cart-login-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #4a5565;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s;
}
.cart-login-close:hover { color: #000; }
.cart-login-close svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Inline cart-login error block */
.cart-login-error {
  margin-top: 4px;
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #f0c4cf;
  font-family: 'Urbanist', sans-serif;
  font-size: 12px;
  color: #c4344f;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .cart { padding: 32px 20px 48px; }
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .cart-summary { position: static; }

  .cart-item {
    grid-template-columns: 24px 64px 1fr 28px;
    gap: 12px;
    padding: 14px 0;
  }
  .cart-item-img { width: 64px; height: 64px; }
  .cart-item-qty,
  .cart-item-subtotal { grid-column: 2 / span 2; }
  .cart-item-subtotal { text-align: left; min-width: 0; }
  .cart-item-remove { grid-row: 1; grid-column: 4; }
}

@media (max-width: 480px) {
  .cart-item {
    grid-template-columns: 24px 56px 1fr;
    gap: 10px;
  }
  .cart-item-img { width: 56px; height: 56px; }
  .cart-item-remove {
    position: absolute;
    top: 8px;
    right: 0;
  }
  .cart-item-qty { grid-column: 2 / -1; justify-self: start; }
  .cart-item-subtotal { grid-column: 2 / -1; }
}
