/* Ecommerce-style side cart drawer */
.side-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.side-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.side-cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(400px, 94vw);
  background: #ffffff !important;
  color: #1a1f2c !important;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
  transition: transform 0.28s ease;
}

html:not(.rtl) body:not(.rtl) .side-cart-drawer,
body:not(.rtl) .side-cart-drawer {
  right: 0;
  left: auto;
  transform: translateX(105%);
}

body.rtl .side-cart-drawer,
html.rtl .side-cart-drawer,
.rtl .side-cart-drawer {
  left: 0;
  right: auto;
  transform: translateX(-105%);
  box-shadow: 8px 0 32px rgba(15, 23, 42, 0.18);
}

.side-cart-drawer.is-open {
  transform: translateX(0) !important;
}

/* Reset inherited top-nav light text colors */
.top-navbar .side-cart-drawer,
.top-navbar .side-cart-drawer a,
.top-navbar .side-cart-drawer strong,
.top-navbar .side-cart-drawer span,
.top-navbar .side-cart-drawer button,
.side-cart-drawer,
.side-cart-drawer a,
.side-cart-drawer strong,
.side-cart-drawer span,
.side-cart-drawer button {
  color: #1a1f2c !important;
}

.side-cart-header {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(26, 31, 44, 0.1);
  flex-shrink: 0;
  background: #fff;
}

.side-cart-header strong {
  color: #111827 !important;
  font-size: 1rem;
}

.side-cart-header .text-primary,
.side-cart-header svg {
  color: var(--primary, #ff6600) !important;
  stroke: var(--primary, #ff6600) !important;
}

.side-cart-body {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 1.15rem;
  max-height: none;
  background: #fff;
}

.side-cart-footer {
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid rgba(26, 31, 44, 0.1);
  flex-shrink: 0;
  background: #f8fafc !important;
}

.side-cart-footer strong {
  color: #111827 !important;
  font-size: 0.95rem;
}

.side-cart-footer .text-primary {
  color: var(--primary, #ff6600) !important;
  font-size: 1.05rem;
}

.side-cart-footer .btn-primary {
  color: #fff !important;
  background-color: var(--primary, #ff6600) !important;
  border-color: var(--primary, #ff6600) !important;
}

.side-cart-footer .btn-outline-primary {
  color: var(--primary, #ff6600) !important;
  background: #fff !important;
  border: 1.5px solid var(--primary, #ff6600) !important;
  font-weight: 600;
}

.side-cart-footer .btn-outline-primary:hover {
  color: #fff !important;
  background: var(--primary, #ff6600) !important;
}

.side-cart-item {
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(26, 31, 44, 0.08);
}

.side-cart-item__img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  background: #f3f4f6;
}

.side-cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-cart-item__info {
  min-width: 0;
}

.side-cart-item__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  color: #111827 !important;
  line-height: 1.45 !important;
  text-decoration: none !important;
}

.side-cart-item__title:hover {
  color: var(--primary, #ff6600) !important;
}

.side-cart-item .price .text-primary,
.side-cart-item .price span.text-primary {
  color: var(--primary, #ff6600) !important;
  font-weight: 700 !important;
  font-size: 0.95rem;
}

.side-cart-item__remove {
  color: #6b7280 !important;
  flex-shrink: 0;
}

.side-cart-item__remove svg {
  stroke: #6b7280 !important;
}

.side-cart-item__remove:hover,
.side-cart-item__remove:hover svg {
  color: #ef4444 !important;
  stroke: #ef4444 !important;
}

.side-cart-empty span {
  color: #6b7280 !important;
}

.js-side-cart-toggle .badge {
  position: absolute;
  top: -2px;
  inset-inline-end: 2px;
}

body.side-cart-open {
  overflow: hidden;
}

/* WhatsApp float uses max z-index — hide it while cart drawer is open */
body.side-cart-open .whatsapp-float,
body.side-cart-open .course-mkt-sticky {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 991.98px) {
  .side-cart-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .side-cart-footer {
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }

  .side-cart-footer .btn {
    min-height: 46px;
    font-weight: 700;
  }
}

/* Keep SweetAlert above the side cart drawer */
.swal2-container {
  z-index: 20000 !important;
}
