/* ── Cart Drawer (Knuspr-style) ── */
.cart-drawer-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,.4); opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.cart-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw; z-index: 8001;
  background: #fff;
  box-shadow: -4px 0 32px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.cart-drawer.open { transform: translateX(0); }

/* ── Header (dark, Knuspr-style) ── */
.cart-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.15rem;
  background: var(--c-dark-bg, #1a1d1b);
  color: #fff;
  flex-shrink: 0;
}
.cart-drawer__header-left {
  display: flex; align-items: center; gap: .65rem;
}
.cart-drawer__cart-icon {
  position: relative;
  width: 32px; height: 32px;
  display: grid; place-items: center;
}
.cart-drawer__cart-icon svg { stroke: #fff; }
.cart-drawer__badge {
  position: absolute; top: -4px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-size: .6rem; font-weight: 700;
  background: var(--c-primary, #1b6d3d); color: #fff;
  border-radius: 999px;
  display: grid; place-items: center;
  line-height: 1;
}
.cart-drawer__total {
  font-size: 1.05rem; font-weight: 700;
}
.cart-drawer__close {
  width: 32px; height: 32px;
  border: none; background: rgba(255,255,255,.12);
  border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
  color: #fff; font-size: 1.15rem;
  transition: background .15s;
}
.cart-drawer__close:hover { background: rgba(255,255,255,.2); }

/* ── Body ── */
.cart-drawer__body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Empty state */
.cart-drawer__empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  min-height: 60vh;
}
.cart-drawer__empty svg { color: #d0d5d2; margin-bottom: 1rem; }
.cart-drawer__empty-title {
  font-size: 1.15rem; font-weight: 700;
  color: var(--c-text, #1a1d1b);
  margin-bottom: .4rem;
}
.cart-drawer__empty-text {
  font-size: .9rem; color: var(--c-text-muted, #6b706d);
  max-width: 28ch; line-height: 1.55;
  margin-bottom: .75rem;
}
.cart-drawer__empty-min {
  font-size: .85rem; font-weight: 700;
  color: var(--c-text, #1a1d1b);
  margin-bottom: 1rem;
}
.cart-drawer__empty-cta {
  display: inline-block;
  padding: .65rem 1.5rem;
  background: var(--c-primary, #1b6d3d); color: #fff;
  border-radius: 10px; font-weight: 700; font-size: .9rem;
  text-decoration: none;
  transition: background .15s;
}
.cart-drawer__empty-cta:hover { background: var(--c-primary-dark, #134f2c); text-decoration: none; }

/* ── Supplier group ── */
.cd-group {
  border-bottom: 6px solid var(--c-bg, #f5f5f3);
}
.cd-group__header {
  padding: .65rem 1.15rem;
  font-size: .78rem; font-weight: 700;
  color: var(--c-text-muted, #6b706d);
  background: var(--c-bg, #f5f5f3);
  border-bottom: 1px solid var(--c-border, #e4e6e5);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Cart item ── */
.cd-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: .75rem;
  align-items: start;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--c-border, #e4e6e5);
  position: relative;
}
.cd-item__img {
  width: 56px; height: 56px;
  border-radius: 10px;
  background: var(--c-bg, #f5f5f3);
  display: grid; place-items: center;
  font-size: 1.3rem;
  overflow: hidden;
}
.cd-item__img img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 2px;
}

.cd-item__info { min-width: 0; }
.cd-item__name {
  font-size: .84rem; font-weight: 600;
  line-height: 1.3; margin-bottom: .15rem;
  color: var(--c-text, #1a1d1b);
}
.cd-item__meta {
  font-size: .72rem; color: var(--c-text-muted, #6b706d);
  margin-bottom: .45rem;
}

.cd-item__controls {
  display: flex; align-items: center; gap: 0;
  background: var(--c-bg, #f5f5f3);
  border-radius: 8px;
  border: 1px solid var(--c-border, #e4e6e5);
  overflow: hidden;
}
.cd-item__trash {
  width: 32px; height: 32px;
  border: none; background: none;
  cursor: pointer; color: var(--c-text-muted, #999);
  display: grid; place-items: center;
  transition: color .15s, background .15s;
}
.cd-item__trash:hover { color: #dc2626; background: #fef2f2; }
.cd-item__qty {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 700;
  color: var(--c-text, #1a1d1b);
  border-left: 1px solid var(--c-border, #e4e6e5);
  border-right: 1px solid var(--c-border, #e4e6e5);
}
.cd-item__plus {
  width: 32px; height: 32px;
  border: none; background: var(--c-primary, #1b6d3d);
  cursor: pointer; color: #fff;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 700;
  border-radius: 0 7px 7px 0;
  transition: background .15s;
}
.cd-item__plus:hover { background: var(--c-primary-dark, #134f2c); }

.cd-item__right {
  text-align: right;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: .25rem;
}
.cd-item__price {
  font-size: .9rem; font-weight: 700;
  color: var(--c-text, #1a1d1b);
  white-space: nowrap;
}
.cd-item__remove {
  border: none; background: none;
  cursor: pointer; color: #ccc; font-size: .75rem;
  padding: 0; transition: color .15s;
}
.cd-item__remove:hover { color: #dc2626; }

/* ── Footer ── */
.cart-drawer__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--c-border, #e4e6e5);
  padding: .85rem 1.15rem;
  background: #fff;
}

.cd-min-bar {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .85rem;
  background: var(--c-bg, #f5f5f3);
  border-radius: 10px;
  margin-bottom: .75rem;
  font-size: .82rem;
  color: var(--c-text-muted, #6b706d);
}
.cd-min-bar svg { flex-shrink: 0; color: var(--c-text-muted, #999); }
.cd-min-bar strong { color: var(--c-text, #1a1d1b); }
.cd-min-bar--ok { background: var(--c-primary-light, #e6f4ec); }
.cd-min-bar--ok svg { color: var(--c-primary, #1b6d3d); }

.cd-checkout-btn {
  display: block; width: 100%;
  padding: .85rem;
  background: var(--c-primary, #1b6d3d); color: #fff;
  border: none; border-radius: 12px;
  font-weight: 700; font-size: 1rem;
  text-align: center; cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.cd-checkout-btn:hover { background: var(--c-primary-dark, #134f2c); text-decoration: none; color: #fff; }

.cd-continue-btn {
  display: block; width: 100%; margin-top: .5rem;
  padding: .55rem;
  background: transparent; color: var(--c-text-muted, #6b706d);
  border: none; font-weight: 500;
  font-size: .82rem; text-align: center; cursor: pointer;
  transition: color .15s;
}
.cd-continue-btn:hover { color: var(--c-primary, #1b6d3d); }

/* ── Cart toast ── */
.cart-toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--c-dark-bg, #1a1d1b); color: #fff;
  padding: .65rem 1.25rem;
  border-radius: 10px;
  font-size: .85rem; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 9999;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.cart-toast.show { transform: translateX(-50%) translateY(0); }
