/* ===== CART ICON IN NAV ===== */
.cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.55);
  color: #0f0a2e;
  cursor: pointer;
  transition: transform .2s, background .2s;
  flex-shrink: 0;
}
.cart-icon:hover {
  background: rgba(255,255,255,.85);
  transform: translateY(-1px);
}
.cart-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.cart-icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 3px 8px rgba(124,58,237,.45);
  border: 1.5px solid #fff;
  letter-spacing: -.02em;
}
.cart-icon-badge--visible {
  display: inline-flex;
  animation: cart-badge-pop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cart-badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ===== DRAWER OVERLAY ===== */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.cart-drawer--open {
  pointer-events: auto;
}
.cart-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,6,34,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
}
.cart-drawer--open .cart-overlay {
  opacity: 1;
}

/* ===== DRAWER PANEL ===== */
.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  /* --cart-scale est défini par cart.js si l'utilisateur a pinch-zoomé,
     pour annuler le zoom et afficher le panier à taille native. */
  transform: translateX(100%) scale(var(--cart-scale, 1));
  transform-origin: top right;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -25px 0 60px -20px rgba(11,6,34,.35);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #0f0a2e;
}
.cart-drawer--open .cart-panel {
  transform: translateX(0) scale(var(--cart-scale, 1));
}

/* ===== HEADER ===== */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f0eef7;
}
.cart-title {
  font-size: 19px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.01em;
}
.cart-title-count {
  color: #7C3AED;
}
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f5f3ff;
  border: 0;
  cursor: pointer;
  color: #4F46E5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.cart-close:hover {
  background: #ede9fe;
  transform: rotate(90deg);
}
.cart-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* ===== ITEMS ===== */
.cart-items-wrapper {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cart-items {
  list-style: none;
  margin: 0;
  padding: 8px 24px;
}
.cart-item {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #f0eef7;
}
.cart-item:last-child {
  border-bottom: 0;
}
.cart-item-image {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  background: #f5f3ff;
  object-fit: contain;
  flex-shrink: 0;
  padding: 6px;
  border: 1px solid #ede9fe;
}
.cart-item-image-link {
  display: block;
  flex-shrink: 0;
  align-self: flex-start;
  border-radius: 14px;
  transition: transform .2s, box-shadow .2s;
  line-height: 0;
}
.cart-item-image-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -8px rgba(124,58,237,.45);
}
.cart-item-image-link:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.cart-item-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.cart-item-name-link {
  color: inherit;
  text-decoration: none;
  transition: color .15s;
}
.cart-item-name-link:hover {
  color: #4F46E5;
}
.cart-item-name-link:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
  border-radius: 4px;
}
.cart-item-remove {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.cart-item-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}
.cart-item-remove svg {
  width: 15px;
  height: 15px;
}
.cart-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.cart-item-variant {
  font-size: 12px;
  color: #64748b;
  background: #f5f3ff;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
}
.cart-item-price-block {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-left: auto;
}
.cart-item-old {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}
.cart-item-price {
  font-weight: 800;
  color: #4F46E5;
  font-size: 15px;
  letter-spacing: -.01em;
}
.cart-item-place {
  font-size: 12px;
  color: #475569;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.4;
  border: 1px solid #ede9fe;
}
.cart-item-place-label {
  color: #4F46E5;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: block;
  margin-bottom: 2px;
}
.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e0deef;
  border-radius: 10px;
  overflow: hidden;
  width: max-content;
  background: #fff;
}
.cart-item-qty button {
  width: 32px;
  height: 32px;
  border: 0;
  background: #fff;
  cursor: pointer;
  color: #0f0a2e;
  font-size: 16px;
  font-weight: 700;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cart-item-qty button:hover {
  background: #f5f3ff;
  color: #4F46E5;
}
.cart-item-qty button:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}
.cart-item-qty span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  font-size: 14px;
  font-weight: 700;
  padding: 0 4px;
  border-left: 1px solid #e0deef;
  border-right: 1px solid #e0deef;
  height: 32px;
}

/* ===== EMPTY STATE ===== */
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 18px;
  text-align: center;
}
.cart-empty-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7C3AED;
}
.cart-empty-icon svg {
  width: 36px;
  height: 36px;
}
.cart-empty p {
  color: #64748b;
  font-size: 15px;
  margin: 0;
  font-weight: 500;
}
.cart-empty-cta {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 8px 22px -6px rgba(124,58,237,.55);
  display: inline-block;
}
.cart-empty-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -6px rgba(124,58,237,.65);
}

/* ===== FOOTER ===== */
.cart-footer {
  border-top: 1px solid #f0eef7;
  padding: 16px 24px 20px;
  background: #fff;
}
.cart-totals {
  margin-bottom: 14px;
}
.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 8px;
  color: #64748b;
}
.cart-row:last-child {
  margin-bottom: 0;
}
.cart-row.cart-subtotal {
  font-size: 18px;
  font-weight: 800;
  color: #0f0a2e;
  margin-top: 10px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #f0eef7;
  letter-spacing: -.01em;
}
.cart-savings-amount {
  color: #10b981;
  font-weight: 700;
}
.cart-checkout-btn {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 60%, #06B6D4 100%);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 26px -6px rgba(124,58,237,.6), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .2s, box-shadow .2s;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.cart-checkout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -6px rgba(124,58,237,.7), inset 0 1px 0 rgba(255,255,255,.35);
}
.cart-checkout-btn svg {
  width: 16px;
  height: 16px;
}
.cart-payments {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.cart-payment-badge {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ===== ADD-TO-CART TOAST FEEDBACK ===== */
.cart-flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f0a2e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 28px -6px rgba(11,6,34,.4);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 110;
  opacity: 0;
  transition: opacity .25s, transform .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.cart-flash--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.cart-flash svg {
  width: 16px;
  height: 16px;
  color: #10b981;
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  .cart-panel {
    width: 100vw;
  }
  .cart-header {
    padding: 18px 18px 14px;
  }
  .cart-items {
    padding: 4px 18px;
  }
  .cart-footer {
    padding: 14px 18px 18px;
  }
  .cart-item-image {
    width: 64px;
    height: 64px;
  }
}
