/* Cart drawer + checkout - mobile first */
:root {
  --cm-bg: #FFFFFF;
  --cm-bg-alt: #FFF8F0;
  --cm-bg-cream: #FDF1E6;
  --cm-line: #F0E2D4;
  --cm-line-2: #E0CBB1;
  --cm-ink: #1A1A1A;
  --cm-ink-2: #404040;
  --cm-ink-3: #707070;
  --cm-green: #00A862;
  --cm-green-dark: #008A50;
  --cm-red: #E2231A;
  --cm-gold: #E8B547;
  --cm-gold-dark: #B8862A;
  --cm-wine: #8E1F2E;
  --cm-wine-dark: #6B1422;
  --cm-coral: #FF6B47;
}

/* Overlay */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 10, 18, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 998;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

/* Drawer */
.cart-drawer {
  position: fixed; top: 0; right: 0;
  width: 420px; max-width: 100vw; height: 100vh;
  background: var(--cm-bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0.4, 1);
  z-index: 999;
  box-shadow: -8px 0 32px rgba(0,0,0,0.18);
}
.cart-drawer.open { transform: translateX(0); }

.cd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 3px solid var(--cm-gold);
  background: linear-gradient(135deg, var(--cm-bg-cream) 0%, #FFF 100%);
}
.cd-head h3 {
  margin: 0; font-size: 16px; font-weight: 900;
  color: var(--cm-wine); text-transform: uppercase;
  letter-spacing: 0.04em; display: flex; align-items: center; gap: 10px;
}
.cd-close {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  color: var(--cm-ink-2);
  cursor: pointer; border: 0;
}
.cd-close:hover { background: var(--cm-wine); color: #FFF; }

.cd-body {
  flex: 1; overflow-y: auto;
  padding: 12px;
}

.cd-empty {
  text-align: center; padding: 60px 24px;
  color: var(--cm-ink-3);
  display: none;
}
.cd-empty svg { color: var(--cm-gold); margin-bottom: 14px; }
.cd-empty h4 { margin: 0 0 8px; color: var(--cm-ink); font-size: 16px; font-weight: 800; }
.cd-empty p { margin: 0 0 20px; font-size: 13px; }

.cd-item {
  display: grid; grid-template-columns: 70px 1fr 32px;
  gap: 12px; padding: 14px 12px;
  border-bottom: 1px solid var(--cm-line);
  align-items: start;
}
.cd-img {
  width: 70px; height: 70px;
  object-fit: contain;
  background: var(--cm-bg-cream);
  border-radius: 6px;
  border: 1px solid var(--cm-line);
}
.cd-info { min-width: 0; }
.cd-title {
  font-size: 13px; font-weight: 700;
  color: var(--cm-ink);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cd-variant {
  font-size: 11px; color: var(--cm-ink-3);
  margin-bottom: 6px;
}
.cd-price {
  font-size: 15px; font-weight: 900;
  color: var(--cm-red);
  margin-bottom: 8px;
}
.cd-qty {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--cm-line-2);
  border-radius: 4px;
  overflow: hidden;
}
.cd-qty .qty-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--cm-bg-cream);
  font-weight: 900; font-size: 16px;
  color: var(--cm-wine);
  cursor: pointer; border: 0;
}
.cd-qty .qty-btn:hover { background: var(--cm-gold); color: #FFF; }
.cd-qty .qty-input {
  width: 40px; height: 28px;
  border: 0; outline: 0;
  text-align: center;
  font-size: 13px; font-weight: 700;
  -moz-appearance: textfield;
}
.cd-qty .qty-input::-webkit-outer-spin-button,
.cd-qty .qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.cd-remove {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--cm-ink-3);
  background: transparent;
  cursor: pointer; border: 0;
  transition: all 160ms;
}
.cd-remove:hover { background: rgba(226,35,26,0.08); color: var(--cm-red); }

.cd-foot {
  border-top: 2px solid var(--cm-gold);
  padding: 16px 18px;
  background: linear-gradient(180deg, #FFF 0%, var(--cm-bg-cream) 100%);
  display: none;
}
.cd-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--cm-ink-2);
  margin-bottom: 6px;
}
.cd-row.total {
  font-size: 18px; font-weight: 900;
  color: var(--cm-wine);
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--cm-line-2);
}
.cd-row.total .val { color: var(--cm-red); }
.cd-row.free .val { color: var(--cm-green); font-weight: 700; }

.cd-cta {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; height: 50px;
  background: linear-gradient(135deg, var(--cm-green) 0%, var(--cm-green-dark) 100%);
  color: #FFF; font-size: 14px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 4px; text-decoration: none;
  margin-top: 14px;
  box-shadow: 0 6px 18px rgba(0,168,98,0.4);
  transition: transform 120ms;
}
.cd-cta:hover { transform: translateY(-2px); }

.cd-trust {
  display: flex; justify-content: center; gap: 14px;
  margin-top: 10px; font-size: 11px;
  color: var(--cm-ink-3);
}
.cd-trust span { display: flex; align-items: center; gap: 4px; }

@media (max-width: 480px) {
  .cart-drawer { width: 100vw; }
  .cd-head h3 { font-size: 14px; }
}
