.cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  z-index: 1001;
  display: none;
  flex-direction: column;
  width: min(92vw, 420px);
  background: var(--c-bg);
  box-shadow: var(--shadow-lg);
}

.cart-drawer.open {
  display: flex;
}

.cart-drawer__close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 3;
}

.cart-drawer__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.cart-drawer .header {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 20px;
  padding-inline-end: 64px;
  border-bottom: 1px solid var(--c-line);
}

.cart-drawer .header .cart {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}

.cart-drawer .header .cart span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 700;
}

.cart-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
}

.cart-drawer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-drawer .empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  color: var(--c-muted);
  text-align: center;
  font-weight: 500;
}

.cart-drawer .empty-cart .icon {
  width: 40px;
  height: 40px;
  color: var(--c-subtle);
}

.cart-drawer .cart-item .item-body {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--c-line);
}

.cart-drawer .cart-item:last-child .item-body {
  border-bottom: 0;
}

.cart-drawer .cart-item img {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
}

.cart-drawer .item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding-inline-end: 36px;
}

.cart-drawer .item-details .product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.cart-drawer .item-details .variants {
  font-size: 13px;
  color: var(--c-muted);
}

.cart-drawer .item-details .product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.cart-drawer .item-details .price {
  font-size: 15px;
  color: var(--c-price-now, #16a34a);
}

.cart-drawer .item-details .compare-price {
  font-size: 13px;
  color: var(--c-price-old, #dc2626);
  text-decoration: line-through;
}

.cart-drawer .remove-item-btn,
.cart-drawer .cart-item .spinner {
  position: absolute;
  top: 12px;
  inset-inline-end: -8px;
}

.cart-drawer .cart-item .spinner {
  top: 24px;
  inset-inline-end: 4px;
  color: var(--c-muted);
}

.cart-drawer .remove-item-btn {
  color: var(--c-subtle);
}

.cart-drawer .remove-item-btn:hover {
  color: var(--c-danger);
}

.cart-drawer .footer {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line);
  background: var(--c-bg);
}

.cart-drawer .footer .price-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cart-drawer .footer .total-price {
  font-weight: 600;
  color: var(--c-muted);
}

.cart-drawer .footer .currency-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-ink);
}

/* Bundles (drawer + cart page) */
.cart-bundle-group {
  margin: 12px 0;
  border: 1px solid var(--c-line);
  border-radius: var(--r);
  overflow: hidden;
}

.cart-bundle-group .bundle-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}

.cart-bundle-group .bundle-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.cart-bundle-group .bundle-title {
  font-weight: 700;
  font-size: 15px;
}

.cart-bundle-group .bundle-total {
  font-weight: 700;
  color: var(--c-primary);
}

.cart-bundle-group .remove-bundle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--c-subtle);
}

.cart-bundle-group .remove-bundle-btn:hover {
  color: var(--c-danger);
}

.cart-bundle-group .remove-bundle-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.cart-bundle-group .bundle-item-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-line);
}

.cart-bundle-group .bundle-item-row:last-child {
  border-bottom: 0;
}

.cart-bundle-group .bundle-item-image {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--c-surface);
}

.cart-bundle-group .bundle-item-name {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.cart-bundle-group .bundle-item-variants span {
  font-size: 13px;
  color: var(--c-muted);
}

.cart-bundle-group .bundle-item-variants span:not(:last-child)::after {
  content: ", ";
}

.cart-bundle-group .bundle-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.cart-bundle-group .bundle-item-price .price {
  font-size: 15px;
  color: var(--c-price-now, #16a34a);
}

.cart-bundle-group .bundle-item-price .compare-at {
  font-size: 13px;
  color: var(--c-price-old, #dc2626);
  text-decoration: line-through;
}

.cart-bundle-group .gift {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-success);
  font-weight: 700;
}

.cart-bundle-group .gift .icon {
  width: 16px;
  height: 16px;
}
