/* Theme cart modal — centered, Al-Hilal reference style */

:root {
  --ssc-navy: #001e7c;
  --ssc-navy-soft: #0033a5;
  --ssc-ink: #001852;
  --ssc-muted: #6b7891;
  --ssc-line: #dce3ec;
  --ssc-z: 12000;
}

.theme-side-cart {
  position: fixed;
  inset: 0;
  z-index: var(--ssc-z);
  pointer-events: none;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.theme-side-cart.is-open {
  pointer-events: auto;
  visibility: visible;
}

.theme-side-cart[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.theme-side-cart.is-open[hidden] {
  visibility: visible;
  pointer-events: auto;
}

.theme-side-cart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 13, 41, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
  cursor: pointer;
}

.theme-side-cart.is-open .theme-side-cart__backdrop {
  opacity: 1;
}

.theme-side-cart__panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 540px);
  max-height: min(86vh, 720px);
  margin: 0;
  padding: 44px 34px 34px;
  background: #fff;
  color: var(--ssc-ink);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 100px rgba(0, 13, 41, 0.2);
  border: 0;
  border-radius: 0;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.theme-side-cart.is-open .theme-side-cart__panel {
  transform: none;
  opacity: 1;
}

.theme-side-cart__close {
  position: absolute;
  top: 10px;
  inset-inline-end: 13px;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ssc-ink);
  font: 30px/1 Arial, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.theme-side-cart__close:hover,
.theme-side-cart__close:focus-visible {
  opacity: 0.65;
  outline: none;
  background: transparent;
}

.theme-side-cart__header {
  display: block;
  padding: 0;
  margin: 0 0 8px;
  flex-shrink: 0;
}

.theme-side-cart__title {
  margin: 0 0 24px;
  color: var(--ssc-ink);
  /* Reference .cart-title */
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.02em;
  font-family: var(--font-body);
}

.theme-side-cart__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  /* Push thin scrollbar toward the outer (left in RTL) edge */
  padding-inline-start: 10px;
  margin-inline-start: -10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 35, 64, 0.35) transparent;
}

/* Thin scrollbar, no up/down arrows — desktop + mobile (WebKit) */
.theme-side-cart__body::-webkit-scrollbar {
  width: 4px;
}

.theme-side-cart__body::-webkit-scrollbar-track {
  background: transparent;
}

.theme-side-cart__body::-webkit-scrollbar-thumb {
  background: rgba(11, 35, 64, 0.35);
  border-radius: 4px;
}

.theme-side-cart__body::-webkit-scrollbar-thumb:hover {
  background: rgba(11, 35, 64, 0.5);
}

.theme-side-cart__body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.theme-side-cart__body::-webkit-scrollbar-button:start:decrement,
.theme-side-cart__body::-webkit-scrollbar-button:end:increment,
.theme-side-cart__body::-webkit-scrollbar-button:vertical:start:increment,
.theme-side-cart__body::-webkit-scrollbar-button:vertical:end:decrement {
  display: none;
  width: 0;
  height: 0;
}

.theme-side-cart__empty {
  margin: 0 0 8px;
  color: var(--ssc-ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 2.1;
}

.theme-side-cart__empty[hidden],
.theme-side-cart__totals[hidden] {
  display: none !important;
}

.theme-side-cart__items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.theme-side-cart__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
}

/* Separator only between products (never under a single item) */
.theme-side-cart__item:not(:last-child) {
  border-bottom: 1px solid var(--ssc-line);
}

.theme-side-cart__item-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.theme-side-cart__item-info,
.theme-side-cart__item-media {
  display: none !important;
}

.theme-side-cart__item-meta {
  flex: 1 1 auto;
  min-width: 0;
  text-align: start;
  font-size: 12px;
  line-height: 2;
}

.theme-side-cart__item-name {
  margin: 0;
  color: var(--ssc-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 2;
  text-decoration: none;
  display: block;
}

a.theme-side-cart__item-name:hover {
  color: var(--ssc-navy);
}

.theme-side-cart__item-price {
  margin: 0;
  color: var(--ssc-muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 2;
}

.theme-side-cart__item-sum {
  margin: 0;
  color: var(--ssc-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 2;
}

.theme-side-cart__item-rule {
  display: none;
}

/* Qty stepper removed — keep reference-style text remove only */
.theme-side-cart__item-controls,
.theme-side-cart__qty {
  display: none !important;
}

.theme-side-cart__remove {
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ssc-muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 2;
  text-decoration: underline;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.theme-side-cart__remove:hover,
.theme-side-cart__remove:focus-visible {
  opacity: 0.75;
  outline: none;
  background: transparent;
  color: var(--ssc-ink);
}

.theme-side-cart__remove svg {
  display: none;
}

.theme-side-cart__footer {
  flex-shrink: 0;
  padding: 0;
  margin-top: 8px;
  border-top: 0;
  background: #fff;
}

.theme-side-cart__totals {
  padding: 20px 0;
  border-top: 1px solid var(--ssc-line);
}

.theme-cart-min-order--side {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(0, 24, 82, 0.12);
  border-radius: 10px;
  background: rgba(0, 40, 240, 0.05);
}

.theme-cart-min-order--side[hidden] {
  display: none !important;
}

.theme-cart-min-order--side .theme-cart-min-order__text {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ssc-ink, #001852);
  font-weight: 500;
}

.theme-cart-min-order--side .theme-cart-min-order__text strong {
  font-weight: 700;
}

.theme-side-cart__row--total {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 12px;
}

.theme-side-cart__total-label {
  color: var(--ssc-ink);
  font-size: 12px;
  font-weight: 700;
}

.theme-side-cart__total-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px 8px;
  text-align: end;
  flex-direction: column;
}

.theme-side-cart__total-value {
  color: var(--ssc-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.theme-side-cart__tax {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ssc-muted, #6b7280);
  white-space: nowrap;
}

.theme-side-cart__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin-top: 8px;
}

/* Removed «عربة التسوق» — cart icon goes to cart page */
.theme-side-cart__bag {
  display: none !important;
}

.theme-side-cart__cta,
.theme-side-cart__continue {
  flex: 1 1 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 52px;
  padding: 13px 20px;
  border-radius: 16px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease;
  box-sizing: border-box;
  font-family: var(--font-body) !important;
}

.theme-side-cart__cta {
  background: #0028f0 !important;
  border-color: #0028f0 !important;
  color: #fff !important;
}

.theme-side-cart__cta:hover,
.theme-side-cart__cta:focus-visible {
  background: #0021d6 !important;
  border-color: #0021d6 !important;
  color: #fff !important;
  outline: none;
  filter: none;
}

.theme-side-cart__continue {
  background: #fff !important;
  border-color: #0028f0 !important;
  color: #0028f0 !important;
  border-radius: 16px !important;
}

.theme-side-cart__continue:hover,
.theme-side-cart__continue:focus-visible {
  background: #e5edf2 !important;
  outline: none;
}

.theme-side-cart__cta-arrow {
  font: 18px/1 Arial, sans-serif;
}

body.theme-side-cart-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .theme-side-cart {
    padding: 12px;
  }

  .theme-side-cart__panel {
    width: min(96vw, 540px);
    padding: 40px 24px 28px;
    max-height: 90vh;
  }

  .theme-side-cart__title {
    font-size: 22px;
    margin-bottom: 18px;
  }

  .theme-side-cart__actions {
    flex-direction: column;
  }

  .theme-side-cart__cta,
  .theme-side-cart__continue {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-side-cart__backdrop,
  .theme-side-cart__panel {
    transition: none;
  }
}
