/* Sticky Cart Drawer */

.bsp-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
}

.bsp-cart-drawer.is-open {
  pointer-events: auto;
}

.bsp-cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: var(--bsp-cart-overlay, rgba(17, 24, 39, 0.55));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bsp-cart-drawer.is-open .bsp-cart-drawer__overlay {
  opacity: 1;
}

.bsp-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(100%, var(--bsp-cart-drawer-width, 420px));
  height: 100%;
  background: var(--bsp-cart-bg, #fff);
  box-shadow: -8px 0 40px rgba(17, 24, 39, 0.18);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.bsp-cart-drawer.is-open .bsp-cart-drawer__panel {
  transform: translateX(0);
}

.bsp-cart-drawer__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.bsp-cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 12px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.bsp-cart-drawer__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--bsp-cart-title, #111827);
}

.bsp-cart-drawer__close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 4px;
}

.bsp-cart-drawer__close:hover {
  color: #111827;
}

/* Free shipping progress */
.bsp-cart-drawer__shipping {
  padding: 0 22px 16px;
  flex-shrink: 0;
}

.bsp-cart-drawer__shipping-text {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--bsp-cart-text, #374151);
  font-weight: 500;
}

.bsp-cart-drawer__shipping-text--success {
  color: #059669;
}

.bsp-cart-drawer__progress {
  height: 8px;
  background: var(--bsp-cart-progress-bg, #fce4ec);
  border-radius: 99px;
  overflow: hidden;
}

.bsp-cart-drawer__progress-bar {
  display: block;
  height: 100%;
  background: var(--bsp-cart-progress, var(--bsp-pink-primary, #f06292));
  border-radius: 99px;
  transition: width 0.35s ease;
}

.bsp-cart-drawer__progress-label {
  margin: 6px 0 0;
  text-align: right;
  font-size: 12px;
  color: #6b7280;
}

.bsp-cart-drawer__progress-label span {
  margin: 0 4px;
}

/* Scrollable body */
.bsp-cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 22px;
}

.bsp-cart-drawer__empty {
  padding: 40px 0;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

/* Cart items */
.bsp-cart-drawer__items {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}

.bsp-cart-drawer__item {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: start;
}

.bsp-cart-drawer__item-thumb {
  background: #fff5f8;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.bsp-cart-drawer__item-thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.bsp-cart-drawer__item-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.bsp-cart-drawer__item-title a {
  color: var(--bsp-cart-title, #111827);
  text-decoration: none;
}

.bsp-cart-drawer__item-meta {
  margin: 0 0 4px;
  font-size: 12px;
  color: #9ca3af;
}

.bsp-cart-drawer__item-price {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bsp-cart-price, #111827);
}

.bsp-cart-drawer__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.bsp-cart-drawer__qty-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: #fff;
  color: #374151;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.bsp-cart-drawer__qty-btn:hover {
  background: #f9fafb;
}

.bsp-cart-drawer__qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  line-height: 30px;
}

.bsp-cart-drawer__remove {
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  margin-top: 4px;
}

.bsp-cart-drawer__remove:hover {
  color: #ef4444;
}

/* Upsell */
.bsp-cart-drawer__upsell {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.bsp-cart-drawer__upsell-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.bsp-cart-drawer__upsell-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
}

.bsp-cart-drawer__upsell-thumb {
  background: #fff5f8;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.bsp-cart-drawer__upsell-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
}

.bsp-cart-drawer__upsell-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--bsp-cart-title, #111827);
  text-decoration: none;
  margin-bottom: 2px;
}

.bsp-cart-drawer__upsell-meta {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
}

.bsp-cart-drawer__upsell-price {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.bsp-cart-drawer__upsell-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 32px;
  padding: 0 12px;
  background: var(--bsp-cart-upsell-btn-bg, var(--bsp-pink-primary, #f06292));
  color: var(--bsp-cart-upsell-btn-text, #fff) !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.bsp-cart-drawer__upsell-add:hover {
  background: var(--bsp-cart-accent, var(--bsp-pink-categories, #ec407a));
  color: var(--bsp-cart-upsell-btn-text, #fff) !important;
}

/* Summary */
.bsp-cart-drawer__summary {
  padding: 16px 22px;
  border-top: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.bsp-cart-drawer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #6b7280;
}

.bsp-cart-drawer__row strong {
  color: #111827;
  font-weight: 600;
}

.bsp-cart-drawer__row--total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  font-size: 15px;
  color: #111827;
}

.bsp-cart-drawer__row--total strong,
.bsp-cart-drawer__total {
  font-size: 18px;
  font-weight: 700;
}

.bsp-cart-drawer__info-icon {
  vertical-align: middle;
  margin-left: 2px;
  color: #9ca3af;
}

/* Actions */
.bsp-cart-drawer__actions {
  padding: 0 22px 16px;
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}

.bsp-cart-drawer__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.bsp-cart-drawer__btn--checkout {
  background: var(--bsp-cart-checkout-bg, var(--bsp-pink-primary, #f06292));
  color: var(--bsp-cart-checkout-text, #fff) !important;
  border: 0;
}

.bsp-cart-drawer__btn--checkout:hover {
  background: var(--bsp-cart-accent, var(--bsp-pink-categories, #ec407a));
  color: var(--bsp-cart-checkout-text, #fff) !important;
}

.bsp-cart-drawer__btn--view-cart {
  background: var(--bsp-cart-view-bg, #fff);
  color: var(--bsp-cart-view-text, #111827) !important;
  border: 1px solid var(--bsp-cart-view-border, #d1d5db);
}

.bsp-cart-drawer__btn--view-cart:hover {
  background: #f9fafb;
}

/* Trust badges */
.bsp-cart-drawer__trust {
  padding: 14px 22px 20px;
  border-top: 1px solid #f3f4f6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex-shrink: 0;
  background: #fafafa;
}

.bsp-cart-drawer__trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-size: 10px;
  line-height: 1.35;
  color: #6b7280;
}

.bsp-cart-drawer__trust-item svg {
  color: var(--bsp-cart-trust-icon, var(--bsp-pink-primary, #f06292));
  flex-shrink: 0;
}

.bsp-cart-drawer__trust-item span {
  color: var(--bsp-cart-trust-text, #6b7280);
}

body.bsp-cart-drawer-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .bsp-cart-drawer__trust {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bsp-cart-drawer__trust-item {
    flex-direction: row;
    text-align: left;
    font-size: 11px;
  }
}
