.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 9998;
}
.cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg, #fff);
  color: var(--text, #111);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
}
.cart-drawer.is-open {
  transform: translateX(0);
}
body.cart-drawer-locked {
  overflow: hidden;
}
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cart-drawer-header h2 {
  margin: 0;
  font-family: var(--font-heading, sans-serif);
  font-size: 1.35rem;
}
.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text, #111);
}
.cart-drawer-warning {
  display: none;
  margin: 0.75rem 1.25rem;
  padding: 8px 10px;
  background: var(--warning-bg, #fffbeb);
  border: 1px solid var(--warning-border, #fde68a);
  border-radius: 4px;
  color: var(--warning-text, #92400e);
  font-size: 13px;
  line-height: 1.4;
}
.cart-drawer-warning.is-visible {
  display: block;
}
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.cart-drawer-empty {
  color: var(--text-light, #6b7280);
  text-align: center;
  margin-top: 2rem;
}
.cart-drawer-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  column-gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  transition: opacity 0.15s ease;
}
.cart-drawer-item.is-busy {
  opacity: 0.5;
  pointer-events: none;
}
.cart-drawer-item-img img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}
.cart-drawer-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.cart-drawer-item-name {
  color: var(--link-color, #111);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}
.cart-drawer-item-name:hover {
  text-decoration: underline;
}
.cart-drawer-item-variant {
  color: var(--text-light, #6b7280);
  font-size: 0.82rem;
}
.cart-drawer-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}
.cart-drawer-qty-minus,
.cart-drawer-qty-plus {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.cart-drawer-qty-minus:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cart-drawer-qty-value {
  min-width: 1.5em;
  text-align: center;
  font-size: 0.9rem;
}
.cart-drawer-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  text-align: right;
}
.cart-drawer-remove {
  background: none;
  border: none;
  color: var(--text-light, #6b7280);
  text-decoration: underline;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}
.cart-drawer-item-price {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.cart-drawer-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border, #e5e7eb);
}
.cart-drawer-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 0.85rem;
}
.cart-drawer-footer .primary-button,
.cart-drawer-footer .secondary-button {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.6rem;
}
@media (max-width: 480px) {
  .cart-drawer {
    width: 100vw;
  }
}
