.cw-commerce-icon-btn {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.cw-commerce-icon-btn:hover { border-color: var(--brand-border); background: var(--surface-hover); }
.cw-cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid var(--bg-elevated);
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-size: 0.625rem;
  font-weight: 700;
}
.cw-account-guest { display: flex; align-items: center; gap: 8px; }
.cw-login-link { display: inline-flex; align-items: center; gap: 7px; color: var(--text-primary); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.cw-login-link:hover { color: var(--brand-primary); }
.cw-account-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}
.cw-account-avatar {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-size: 0.75rem;
  font-weight: 700;
}
.cw-account-user .dropdown-menu { min-width: 210px; padding: 8px; border-radius: 10px; }
.cw-account-user .dropdown-item { padding: 8px 10px; border-radius: 6px; }
.cw-mobile-account { width: 100%; }
.cw-mobile-account .cw-account-guest { display: grid; grid-template-columns: 1fr 1fr; }
.cw-mobile-account .cw-account-user { gap: 4px; }
.cw-mobile-account .cw-account-user:not(.d-none) { display: grid; }
.cw-mobile-account__identity { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px; }
.cw-mobile-account .cw-account-user a,
.cw-mobile-account .cw-account-user button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  text-decoration: none;
}
.cw-mobile-account .cw-account-user a:hover,
.cw-mobile-account .cw-account-user button:hover { background: var(--surface-hover); }

.cw-cart-drawer { position: fixed; z-index: 1100; inset: 0; visibility: hidden; pointer-events: none; }
.cw-cart-drawer.is-open { visibility: visible; pointer-events: auto; }
.cw-cart-drawer__scrim { position: absolute; inset: 0; border: 0; background: var(--overlay); opacity: 0; transition: opacity 200ms ease; }
.cw-cart-drawer.is-open .cw-cart-drawer__scrim { opacity: 1; }
.cw-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  width: min(440px, 100vw);
  height: 100%;
  flex-direction: column;
  background: var(--bg-elevated);
  box-shadow: -16px 0 40px var(--shadow-color);
  transform: translateX(105%);
  transition: transform 220ms ease;
}
.cw-cart-drawer.is-open .cw-cart-drawer__panel { transform: translateX(0); }
.cw-cart-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.cw-cart-drawer__header h2 { margin: 2px 0 0; font-size: 1.125rem; }
.cw-cart-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cw-cart-drawer__footer { padding: 16px 20px 20px; border-top: 1px solid var(--border); background: var(--bg-elevated); }
.cw-cart-loading { padding: 32px 0; color: var(--text-secondary); text-align: center; }
.cw-cart-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cw-cart-line__image { width: 64px; height: 64px; overflow: hidden; border-radius: 8px; background: var(--bg-secondary); }
.cw-cart-line__image img { width: 100%; height: 100%; object-fit: cover; }
.cw-cart-line__placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--text-secondary); }
.cw-cart-line__name { color: var(--text-primary); font-size: 0.875rem; font-weight: 650; }
.cw-cart-line__meta { margin-top: 3px; color: var(--text-secondary); font-size: 0.75rem; }
.cw-cart-line__price { font-size: 0.875rem; font-weight: 650; white-space: nowrap; }
.cw-quantity { display: inline-flex; align-items: center; margin-top: 10px; border: 1px solid var(--border); border-radius: 6px; }
.cw-quantity button { width: 30px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--text-primary); }
.cw-quantity span { min-width: 28px; text-align: center; font-size: 0.8125rem; }
.cw-cart-remove { margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--danger); font-size: 0.75rem; }
.cw-commerce-empty { display: grid; min-height: 280px; place-items: center; color: var(--text-secondary); text-align: center; }
.cw-commerce-empty__icon { display: grid; width: 60px; height: 60px; margin: 0 auto 16px; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand-primary); font-size: 1.35rem; }
.cw-commerce-empty h2 { color: var(--text-primary); font-size: 1.125rem; }
body.cw-cart-open { overflow: hidden; }

.cw-full-cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 24px; }
.cw-full-cart__items,
.cw-full-cart__summary { border-color: var(--border); border-radius: 10px; background: var(--bg-elevated); }
.cw-full-cart__summary { position: sticky; top: 96px; }
.cw-full-cart__summary h2 { margin-bottom: 20px; font-size: 1.125rem; }
.cw-full-cart-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; padding: 20px; border-bottom: 1px solid var(--border); }
.cw-full-cart-line:last-child { border-bottom: 0; }
.cw-full-cart-line__image { display: grid; width: 96px; height: 96px; overflow: hidden; place-items: center; border-radius: 10px; background: var(--bg-secondary); color: var(--text-secondary); }
.cw-full-cart-line__image img { width: 100%; height: 100%; object-fit: cover; }
.cw-full-cart-line__details h2 { margin: 0 0 7px; font-size: 1rem; }
.cw-full-cart-line__details p { margin: 7px 0 0; color: var(--text-secondary); font-size: 0.75rem; }
.cw-full-cart-line__price { display: grid; align-content: start; justify-items: end; gap: 6px; }
.cw-full-cart-line__price small { color: var(--text-secondary); }
.cw-delivery-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; }
.cw-delivery-badge.is-digital { background: var(--accent-soft); color: var(--brand-accent); }
.cw-delivery-badge.is-physical { background: var(--brand-soft); color: var(--brand-primary); }
.cw-summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; color: var(--text-secondary); font-size: 0.875rem; }
.cw-summary-row span:last-child { color: var(--text-primary); text-align: right; }
.cw-summary-total { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 1rem; font-weight: 700; }
.cw-promo-toggle { margin-bottom: 14px; padding: 0; border: 0; background: transparent; color: var(--brand-primary); font-size: 0.8125rem; font-weight: 600; }
.cw-promo-form { margin-bottom: 14px; }
.cw-promo-applied { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 9px 10px; border: 1px solid var(--accent-border); border-radius: 6px; background: var(--accent-soft); color: var(--brand-accent); font-size: 0.75rem; font-weight: 700; }
.cw-promo-applied button { padding: 0; border: 0; background: transparent; color: inherit; text-decoration: underline; }
.cw-inline-error { min-height: 18px; margin-top: 5px; color: var(--danger); font-size: 0.75rem; }
.cw-mixed-note { margin: 12px 0 16px; padding: 10px; border-radius: 6px; background: var(--brand-soft); color: var(--text-secondary); font-size: 0.75rem; }

@media (max-width: 1199.98px) {
  .cw-header__actions .cw-account-guest,
  .cw-header__actions .cw-account-user,
  .cw-header__actions [data-cart-open] { display: none !important; }
}

@media (max-width: 991.98px) {
  .cw-full-cart { grid-template-columns: 1fr; }
  .cw-full-cart__summary { position: static; }
}

@media (max-width: 575.98px) {
  .cw-full-cart-line { grid-template-columns: 72px minmax(0, 1fr); padding: 16px; }
  .cw-full-cart-line__image { width: 72px; height: 72px; }
  .cw-full-cart-line__price { grid-column: 2; justify-items: start; }
}
