.cart-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 950;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--btn-bg, var(--primary, #4f46e5));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
}
.cart-fab i { font-size: 22px; }
.cart-fab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.5);
}
.cart-fab-badge.show { opacity: 1; transform: scale(1); }
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1050;
  opacity: 0;
}
.cart-overlay.open { display: block; opacity: 1; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--surface, #fff);
  z-index: 1051;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 48px rgba(0,0,0,.18);
  transition: right .34s cubic-bezier(.22,1,.36,1);
}
.cart-drawer.open { right: 0; }
.cart-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cart-header-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--primary, #4f46e5);
  background: color-mix(in srgb, var(--primary, #4f46e5) 10%, #fff);
}
.cart-header-title { font-weight: 800; color: var(--text, #0f172a); }
.cart-header-count { color: var(--text-muted, #64748b); font-size: 13px; }
.cart-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--text-muted, #64748b);
  cursor: pointer;
}
#cartDrawer .cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
#cartDrawer .cart-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--bg, #f8fafc);
  margin-bottom: 12px;
}
#cartDrawer .cart-item-img,
#cartDrawer .cart-item-img img,
#cartDrawer .cart-item-img-placeholder {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  object-fit: cover;
}
#cartDrawer .cart-item-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary, #4f46e5) 10%, #fff);
  color: var(--primary, #4f46e5);
}
#cartDrawer .cart-item-info { min-width: 0; }
#cartDrawer .cart-item-cat {
  color: var(--primary, #4f46e5);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
#cartDrawer .cart-item-name {
  color: var(--text, #0f172a);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#cartDrawer .cart-item-meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}
#cartDrawer .cart-item-price { color: var(--accent, var(--primary, #4f46e5)); font-weight: 800; }
.cart-suggestions-panel {
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 12px;
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.cart-suggestions-title {
  font-weight: 800;
  color: var(--text, #0f172a);
}
#cartDrawer .cart-item-remove,
#cartDrawer .cart-item-edit {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: #fff;
  color: var(--text, #0f172a);
  cursor: pointer;
}
#cartDrawer .cart-item-remove {
  width: 34px;
  height: 34px;
  color: #ef4444;
}
#cartDrawer .cart-item-wrap {
  display: grid;
  gap: 8px;
}
#cartDrawer .cart-drawer-warning {
  margin: -2px 0 6px;
  padding: 10px;
  border: 1px solid #facc15;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  display: grid;
  gap: 9px;
}
#cartDrawer .cart-drawer-warning-text {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 750;
}
#cartDrawer .cart-drawer-warning-text i {
  margin-top: 2px;
  color: #b45309;
}
#cartDrawer .cart-drawer-warning-text small {
  display: block;
  margin-top: 2px;
  color: #92400e;
  font-size: 11.5px;
  font-weight: 650;
}
#cartDrawer .cart-drawer-warning-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
#cartDrawer .cart-drawer-warning-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #f59e0b;
  border-radius: 9px;
  background: #fff7ed;
  color: #9a3412;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}
#cartDrawer .cart-drawer-warning-help {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}
.cart-footer {
  padding: 12px 20px 14px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: #fff;
}
#cartDrawer .cart-summary {
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  background: var(--bg, #f8fafc);
  margin-bottom: 10px;
}
#cartDrawer .cart-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-muted, #64748b);
  font-size: 13px;
}
#cartDrawer .cart-summary-row.total {
  margin: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--text, #0f172a);
  font-weight: 900;
  font-size: 16px;
}
#cartDrawer .cart-summary-row[hidden] {
  display: none !important;
}
#cartDrawer .cart-summary-compact {
  font-size: 13.5px;
}
#cartDrawer .cart-summary-compact span:last-child {
  font-weight: 700;
  color: var(--text, #0f172a);
}
#cartSavingsRow span,
#cartSavingsRow span:last-child {
  color: #16a34a;
}
.cart-details-toggle {
  width: 100%;
  margin-top: 6px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--primary, #4f46e5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.cart-details-toggle i {
  font-size: 10px;
  transition: transform .18s ease;
}
.cart-details-toggle.is-open i {
  transform: rotate(180deg);
}
#cartDrawer .cart-summary-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #e5e7eb);
}
#cartDrawer .cart-summary-details[hidden] {
  display: none !important;
}
#cartDrawer .cart-summary-details .cart-summary-row {
  font-size: 12.5px;
}
.cart-checkout-btn,
.cart-clear-btn,
.cart-empty-browse {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  font-weight: 800;
  cursor: pointer;
}
.cart-checkout-btn {
  background: var(--btn-bg, var(--primary, #4f46e5));
  color: #fff;
}
.cart-checkout-btn.is-loading {
  opacity: .82;
  cursor: wait;
}
.cart-checkout-btn.is-blocked {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}
.cart-loading-note {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 7px 0 2px;
  color: var(--text-muted, #64748b);
  font-size: 12.5px;
  font-weight: 700;
}
.cart-loading-note.show {
  display: flex;
}
.cart-loading-note i {
  color: var(--primary, #4f46e5);
}
.cart-loading-note.is-warning {
  color: #92400e;
}
.cart-loading-note.is-warning i {
  color: #b45309;
}
.cart-clear-btn {
  margin-top: 7px;
  background: #fff;
  color: var(--text-muted, #64748b);
  border: 1px solid var(--border, #e5e7eb);
}
.cart-empty {
  text-align: center;
  color: var(--text-muted, #64748b);
  padding: 42px 18px;
}
.cart-empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary, #4f46e5) 10%, #fff);
  color: var(--primary, #4f46e5);
}
.cart-empty-title { color: var(--text, #0f172a); font-weight: 900; }
@media (max-width: 600px) {
  .cart-fab { right: 16px; bottom: 20px; width: 52px; height: 52px; }
  .cart-drawer { width: 100vw; }
  #cartDrawer .cart-item { grid-template-columns: 64px minmax(0, 1fr) auto; }
  #cartDrawer .cart-item-img,
  #cartDrawer .cart-item-img img,
  #cartDrawer .cart-item-img-placeholder { width: 64px; height: 64px; }
}
