#cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  width: 400px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--t-slow);
  box-shadow: -10px 0 40px rgba(0,0,0,0.8);
}
#cart-sidebar.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}
.cart-count-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 500;
}
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--fg-muted);
  border: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.cart-close:hover { background: var(--accent); color: var(--white); }

#cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--fg-muted);
}
.cart-empty-emoji { font-size: 3rem; margin-bottom: 12px; }
.cart-empty h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fg);
}
.cart-empty p { font-size: 0.82rem; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg);
}

.cart-item-thumb,
.cart-item-emoji {
  width: 52px;
  height: 52px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
  position: relative;
}
.cart-item-thumb .cart-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.cart-item-price {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.cart-qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-alt);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fg);
  transition: background var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-qty-btn:hover { background: var(--border-strong); }
.cart-qty-val {
  width: 32px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.cart-item-remove {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.cart-item-remove:hover { background: rgba(255,58,58,0.1); color: var(--red); }
.cart-item-remove svg { width: 15px; height: 15px; stroke-width: 2; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-delivery-bar {
  padding: 12px 20px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border-bottom: 1px solid var(--line-1, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-delivery-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2, #888);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-align: center;
}

.cart-delivery-progress {
  width: 100%;
  height: 6px;
  background: var(--control-bg, rgba(0, 0, 0, 0.08));
  border-radius: 100px;
  overflow: hidden;
}

.cart-delivery-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, #CC1F1F);
  border-radius: 100px;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.cart-delivery-note {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
}

.cart-delivery-unlock,
.cart-delivery-unlocked {
  font-size: 0.82rem;
  font-weight: 700;
  color: #00C47A;
  text-align: center;
  background: rgba(0, 196, 122, 0.12);
  border: 1px solid rgba(0, 196, 122, 0.25);
  padding: 8px 12px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cart-delivery-unlock.show,
.cart-delivery-unlocked.show {
  display: flex !important;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-subtotal-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.cart-subtotal-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--fg);
}

#checkout-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--r);
  background: var(--accent);
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform var(--t-mid), box-shadow var(--t-mid), opacity var(--t-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#checkout-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
#checkout-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
