/* ==========================================================================
   PAGE / CART
   Figma: "Cart" (empty + filled states)
   Per request: all spacing/sizing values below are literal pixels copied
   straight from the Figma frame — no --space-* tokens — so the layout
   matches pixel-for-pixel. Color/font tokens are still used where the
   Figma value matches an existing design token exactly.
   ========================================================================== */

/* --- Page title --- */
.cart-page-header {
  max-width: 1320px;
  margin: 0 auto 40px;
  text-align: right;
}

.cart-title {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 40px;
  line-height: 40px;
  letter-spacing: 0px;
  color: var(--color-text-heading);
  margin-bottom: 12px;
}

.cart-subtitle {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 24px;
  line-height: 28px;
  letter-spacing: 0px;
  color: var(--color-text-heading);
}

/* --- Two-column layout: items (right, wide) + summary (left, fixed) ---
   In RTL the first DOM child renders on the right, so .cart-items-col
   must come before .order-summary-card in the markup. */
.cart-layout {
  display: flex;
  direction: rtl;
  align-items: stretch; /* שונה מ-flex-start ל-stretch */
  gap: 24px;
  max-width: 1320px;
  margin: 0 auto;
}

.cart-items-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 868px;
}

/* --- Empty cart state --- */
.cart-empty-card {
  width: 100%;
  min-height: 240px;
  background: var(--color-white);
  border: 1px solid var(--color-section-border);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
}

.cart-empty-text {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: var(--color-text-heading);
}

/* --- Item card ---
   Figma "Digital Course Item": 868x240, radius 30, gap 32, padding 24,
   border-width 1. Height/width left flexible (fills column) so the
   card can shrink gracefully for the shorter "physical item" variant. */
.cart-item {
  position: relative;
  width: 100%;
  background: var(--color-white);
  border: 1px solid var(--color-section-border);
  border-radius: 30px;
  padding: 24px;
  display: flex;
  align-items: stretch;
  gap: 32px;
}

.cart-item-image {
  width: 192px;
  height: 192px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-icon-wave-bg);
}

.cart-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  justify-content: space-between;
}
.cart-item-top {display: flex;flex-direction: column;gap: 8px;margin-top: 10px;}

.cart-item-bottom {display: flex;justify-content: space-between;align-items: center;}

.cart-item-badge {
  display: inline-flex;
  width: max-content;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--color-badge-green-bg);
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 18px;
  line-height: 16px;
  letter-spacing: 0.3px;
  color: var(--color-text-heading);
}

.cart-item-title {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: 0px;
  color: var(--color-text-heading);
}

.cart-item-subtitle {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  letter-spacing: 0px;
  color: var(--color-text-slate);
}

.cart-item-footer {
  display: flex;
  direction: rtl;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  width: 100%;
}

.cart-item-price {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: 0px;
  color: #000080;
}

/* --- Top-right corner type tag ("דיגיטלי" / "פיזי") --- */
.cart-item-tag {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 4px 12px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 14px;
  line-height: 16px;
  letter-spacing: 0.3px;
}

.cart-item-tag--digital {
  background: var(--color-pink-soft-bg);
  color: var(--color-pink-accent);
}

.cart-item-tag--physical {
  background: var(--color-badge-green-bg);
  color: var(--color-text-heading);
}

/* --- Remove item (top-left close icon) --- */
.cart-item-remove {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-heading);
}

/* --- Quantity stepper (physical items) --- */
.qty-stepper {
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--color-border-icon);
  border-radius: 4px;
  padding: 8px 10px;
  width: max-content;
  background: #9EC6DA66;
}

.qty-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 18px;
  line-height: 1;
  color: #183B51;
}

.qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-value {
  min-width: 16px;
  text-align: center;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 16px;
  color: #183B51;
}

/* --- Coupon accordion (glassmorphism look) ---
   Figma: collapsed 869x78, radius 8, background --color-blue-soft-bg. */
.coupon-box {
  width: 100%;
  background: var(--color-blue-soft-bg);
  border-radius: 8px;
  padding: 24px 32px;
}

.coupon-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-heading);
}

.coupon-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 18px;
  line-height: 28px;
  color: var(--color-text-heading);
}

.coupon-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.coupon-box[data-open="true"] .coupon-chevron {
  transform: rotate(180deg);
}

.coupon-form {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  max-width: 448px;
  margin-top: 24px;
}

.coupon-box[data-open="true"] .coupon-form {
  display: flex;
  flex-wrap: wrap;
}

.coupon-input {
  width: 336px;
  max-width: 100%;
  height: 50px;
  border-radius: 8px;
  border: 1px solid var(--color-border-icon);
  background: var(--color-white);
  padding: 12px;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-heading);
  text-align: right;
  direction: rtl;
}

.coupon-input::placeholder {
  color: #454545;
}

.coupon-apply-btn {
  width: 96px;
  height: 50px;
  border-radius: 100px;
  border: none;
  padding: 13px 32px;
  background: var(--color-pink-accent);
  color: var(--color-white);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.coupon-message {
  display: none;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-heading);
}

.coupon-message.is-visible {
  display: flex;
}

.coupon-message--success svg { color: #67B8A8; }
.coupon-message--error svg { color: #C22DAF; }

/* --- Order summary sidebar --- */
.order-summary-card {
  width: 422px;
  height: auto;
  flex-shrink: 0;
  background: #FAF9F5;
  border-radius: 30px;
  padding: 32px;
  position: sticky;
  top: calc(var(--header-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-summary-card .summary-title {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: 0px;
  color: var(--color-text-heading);
  margin-bottom: 12px;
}

.summary-price-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0px;
  color: #183B51;
}

.summary-price-row .value {
  direction: ltr;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 128, 0.12);
}

.summary-total-row .label {
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 0px;
  color: #000080;
}

.summary-total-row .value {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 30px;
  line-height: 36px;
  letter-spacing: 0px;
  color: var(--color-text-heading);
}

.btn-checkout {
  width: 356px;
  max-width: 100%;
  height: 69.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  border-radius: 100px;
  padding: 21.2px 24px 20px;
  margin-top: 16px;
  background: var(--color-pink-accent);
  color: var(--color-white);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-btn);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

.summary-trust-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  color: var(--color-text-heading);
}

.summary-fineprint {
  margin-top: 12px;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 14px;
  line-height: 22.75px;
  letter-spacing: 0px;
  color: #183B51;
  text-align: center;
}

@media (max-width: 1023px) {
  .cart-layout {
    flex-direction: column;
  }

  .order-summary-card {
    width: 100%;
    position: static;
  }

  .cart-item {
    flex-wrap: wrap;
  }
}

@media (max-width: 639px) {
  .cart-item-image {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 900px) {
  .cart-page-header,
  .cart-layout {
    padding: 0 20px;
    box-sizing: border-box;
  }

  .cart-title {
    font-size: 30px;
    line-height: 36px;
  }

  .cart-subtitle {
    font-size: 18px;
    line-height: 24px;
  }

  .order-summary-card {
    position: static;
    padding: 24px;
  }

  .btn-checkout {
    width: 100%;
  }
}

@media (max-width: 599px) {
  .cart-item {
    padding: 16px;
    gap: 16px;
  }

  .cart-item-title {
    font-size: 20px;
    line-height: 26px;
  }

  .cart-item-price {
    font-size: 20px;
    line-height: 26px;
  }

  .cart-item-tag,
  .cart-item-remove {
    top: 16px;
  }

  .cart-item-tag {
    right: 12px;
  }

  .cart-item-remove {
    left: 16px;
  }

  .coupon-box {
    padding: 16px 20px;
  }

  .coupon-input {
    width: 100%;
  }

  .coupon-apply-btn {
    width: 100%;
  }
}
