/* ==========================================================================
   Slide-out Cart Sidebar
   ========================================================================== */

/* ── Overlay ───────────────────────────────────────────────────────────── */

.ai-dtc-slide-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ai-dtc-slide-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Panel ─────────────────────────────────────────────────────────────── */

.ai-dtc-slide-cart {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: 420px;
  max-width: 100vw;
  height: 100dvh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20254a;
}

.ai-dtc-slide-cart.is-open {
  transform: translateX(0);
}

body.ai-dtc-slide-cart-open {
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────────────────── */

.ai-dtc-slide-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(32, 40, 73, 0.12);
  flex-shrink: 0;
}

.ai-dtc-slide-cart__title {
  margin: 0;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #20254a;
}

.ai-dtc-slide-cart__count {
  font-weight: 700;
}

.ai-dtc-slide-cart__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5e6784;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ai-dtc-slide-cart__close:hover {
  background: rgba(32, 40, 73, 0.06);
  color: #20254a;
}

/* ── Body (scrollable items) ──────────────────────────────────────────── */

.ai-dtc-slide-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* ── Cart Item Row ─────────────────────────────────────────────────────── */

.ai-dtc-slide-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(32, 40, 73, 0.08);
}

.ai-dtc-slide-cart-item:last-child {
  border-bottom: 0;
}

.ai-dtc-slide-cart-item__image {
  flex-shrink: 0;
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff1ec;
  text-decoration: none;
}

.ai-dtc-slide-cart-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ai-dtc-slide-cart-item__info {
  flex: 1;
  min-width: 0;
}

.ai-dtc-slide-cart-item__info h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #20254a;
}

.ai-dtc-slide-cart-item__info h3 a {
  color: inherit;
  text-decoration: none;
}

.ai-dtc-slide-cart-item__info h3 a:hover {
  text-decoration: underline;
}

.ai-dtc-slide-cart-item__price {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
  color: #20254a;
}

/* ── Stepper (quantity selector) ───────────────────────────────────────── */

.ai-dtc-slide-cart-item__stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(32, 40, 73, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.ai-dtc-slide-cart-item__stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5e6784;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ai-dtc-slide-cart-item__stepper-btn:hover {
  background: rgba(32, 40, 73, 0.06);
  color: #20254a;
}

.ai-dtc-slide-cart-item__stepper-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  font-size: 13px;
  font-weight: 700;
  color: #20254a;
}

/* ── Remove Button ─────────────────────────────────────────────────────── */

.ai-dtc-slide-cart-item__remove {
  flex-shrink: 0;
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5e6784;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ai-dtc-slide-cart-item__remove:hover {
  color: #d34646;
}

/* ── Empty State ───────────────────────────────────────────────────────── */

.ai-dtc-slide-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  text-align: center;
  color: #5e6784;
}

.ai-dtc-slide-cart__empty svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.ai-dtc-slide-cart__empty p {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.ai-dtc-slide-cart__continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 24px;
  border: 2px solid #20254a;
  border-radius: 999px;
  color: #20254a;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.ai-dtc-slide-cart__continue:hover {
  background: #20254a;
  color: #fff;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.ai-dtc-slide-cart__footer {
  flex-shrink: 0;
  padding: 20px 24px;
  border-top: 1px solid rgba(32, 40, 73, 0.12);
}

.ai-dtc-slide-cart__subtotal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
}

.ai-dtc-slide-cart__subtotal-row span {
  color: #5e6784;
}

.ai-dtc-slide-cart__subtotal-row strong {
  font-size: 18px;
  font-weight: 900;
  color: #20254a;
}

.ai-dtc-slide-cart__checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #20254a;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(32, 37, 74, 0.25);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-dtc-slide-cart__checkout-btn:hover {
  background: #151d43;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(32, 37, 74, 0.35);
}

.ai-dtc-slide-cart__view-cart {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #5e6784;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ai-dtc-slide-cart__view-cart:hover {
  color: #20254a;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .ai-dtc-slide-cart {
    width: 100vw;
  }

  .ai-dtc-slide-cart__header {
    padding: 16px 20px;
  }

  .ai-dtc-slide-cart__body {
    padding: 12px 20px;
  }

  .ai-dtc-slide-cart__footer {
    padding: 16px 20px;
  }
}

/* ── Reduced Motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ai-dtc-slide-cart,
  .ai-dtc-slide-cart-overlay {
    transition-duration: 0ms !important;
  }
}
