/* ==========================================================================
   Checkout flow — cart, address, invoice, order-tracking
   Scoped under .checkout-shell
   ========================================================================== */

.checkout-shell {
  --home-danger: #EF4444;
  --home-danger-soft: #FEF2F2;
}

.checkout-shell .wrapper.default {
  background-color: var(--home-bg);
}

.checkout-page {
  background-color: var(--home-bg);
  padding: 20px 0 32px;
  direction: rtl;
  min-height: 50vh;
}

.checkout-page .container {
  max-width: var(--home-container);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */

.checkout-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.checkout-steps-bar li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.checkout-steps-bar .step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--home-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.checkout-steps-bar .step-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--home-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--home-text-muted);
  background: var(--home-surface);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.checkout-steps-bar .step-item.is-active .step-index,
.checkout-steps-bar .step-item.is-done .step-index {
  border-color: var(--home-accent);
  color: #fff;
  background: var(--home-accent);
}

.checkout-steps-bar .step-item.is-active span.step-label,
.checkout-steps-bar .step-item.is-done span.step-label {
  color: var(--home-text);
}

.checkout-steps-bar .step-divider {
  width: 32px;
  height: 2px;
  background: var(--home-border);
  border-radius: 2px;
}

.checkout-steps-bar .step-item.is-done + .step-divider {
  background: var(--home-accent);
}

@media (max-width: 576px) {
  .checkout-steps-bar {
    gap: 2px;
    margin-bottom: 16px;
  }

  .checkout-steps-bar .step-item {
    gap: 5px;
    font-size: 0.75rem;
  }

  .checkout-steps-bar .step-index {
    width: 22px;
    height: 22px;
    font-size: 0.6875rem;
  }

  .checkout-steps-bar .step-divider {
    width: 16px;
  }
}

.checkout-cart-loading {
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-cart-loading img {
  width: 44px;
}

/* --------------------------------------------------------------------------
   Two-column layout (content + summary sidebar)
   -------------------------------------------------------------------------- */

.checkout-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 992px) {
  .checkout-layout {
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 24px;
  }

  .checkout-layout .checkout-main {
    flex: 1;
    min-width: 0;
  }

  .checkout-layout .checkout-aside-col {
    flex: 0 0 320px;
    max-width: 320px;
    position: sticky;
    top: 88px;
    align-self: flex-start;
  }
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.checkout-card {
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
  box-shadow: var(--home-shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.checkout-card .checkout-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--home-border);
}

.checkout-card .checkout-card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--home-text);
}

.checkout-card .checkout-card-header-title i {
  color: var(--home-accent);
  font-size: 18px;
}

.checkout-card .checkout-card-body {
  padding: 20px;
}

@media (max-width: 576px) {
  .checkout-card .checkout-card-header {
    padding: 14px 16px;
  }

  .checkout-card .checkout-card-body {
    padding: 16px;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.checkout-shell .btn-checkout-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: var(--home-radius-sm);
  background: var(--home-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.checkout-shell .btn-checkout-primary:hover {
  background: var(--home-accent-hover);
}

.checkout-shell .btn-checkout-primary:disabled {
  background: var(--home-border);
  color: var(--home-text-muted);
  cursor: not-allowed;
}

.checkout-shell .btn-checkout-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--home-accent);
  border-radius: var(--home-radius-sm);
  background: var(--home-surface);
  color: var(--home-accent);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.checkout-shell .btn-checkout-outline:hover {
  background: var(--home-accent-soft);
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.checkout-empty {
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
  box-shadow: var(--home-shadow-sm);
  padding: 56px 24px;
  text-align: center;
  max-width: 480px;
  margin: 40px auto;
}

.checkout-empty .checkout-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--home-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.checkout-empty .checkout-empty-icon i {
  font-size: 32px;
  color: var(--home-accent);
}

.checkout-empty .checkout-empty-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--home-text);
  margin-bottom: 20px;
}

.checkout-empty .btn-checkout-primary {
  width: auto;
  padding: 12px 28px;
  text-decoration: none;
}

.checkout-empty .checkout-empty-hint {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--home-text-muted);
}

.checkout-empty .checkout-empty-hint a {
  color: var(--home-accent);
  font-weight: 700;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Cart item list
   -------------------------------------------------------------------------- */

.checkout-item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-item-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
  background: var(--home-surface);
}

.checkout-item-card .item-img {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--home-radius-sm);
  border: 1px solid var(--home-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-item-card .item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checkout-item-card .item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 30px;
}

.checkout-item-card .item-name {
  color: var(--home-text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.checkout-item-card .item-unavailable {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--home-danger);
  background: var(--home-danger-soft);
  padding: 2px 10px;
  border-radius: var(--home-radius-md);
}

.checkout-item-card .item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.checkout-item-card .item-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.checkout-item-card .item-price .old-price {
  color: var(--home-text-muted);
  font-size: 0.75rem;
  text-decoration: line-through;
}

.checkout-item-card .item-price .final-price {
  color: var(--home-text);
  font-size: 0.9375rem;
  font-weight: 700;
}

.checkout-item-card .item-price .final-price-unit {
  color: var(--home-text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.checkout-item-card .item-discount-badge {
  background: var(--home-danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--home-radius-md);
}

.checkout-item-card .item-remove {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #F3F4F6;
  color: var(--home-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.checkout-item-card .item-remove:hover {
  background: var(--home-danger-soft);
  color: var(--home-danger);
}

/* Quantity stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
  padding: 4px 10px;
  background: var(--home-bg);
}

.qty-stepper button {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--home-accent);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
}

.qty-stepper button:hover {
  background: var(--home-accent-soft);
}

.qty-stepper .qty-value {
  min-width: 34px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--home-text);
}

@media (max-width: 480px) {
  .checkout-item-card {
    align-items: flex-start;
  }

  .checkout-item-card .item-img {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }
}

/* --------------------------------------------------------------------------
   Coupon form
   -------------------------------------------------------------------------- */

.checkout-coupon {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--home-border);
}

.checkout-coupon-form {
  display: flex;
  gap: 8px;
}

.checkout-coupon-form input {
  flex: 1;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  background: var(--home-surface);
  color: var(--home-text);
}

.checkout-coupon-form input:focus {
  outline: none;
  border-color: var(--home-accent);
  box-shadow: 0 0 0 3px rgba(71, 187, 156, 0.12);
}

.checkout-coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--home-accent-soft);
  border-radius: var(--home-radius-sm);
  font-size: 0.875rem;
}

.checkout-coupon-applied .coupon-label {
  font-weight: 700;
  color: var(--home-accent);
}

.checkout-coupon-form .btn-checkout-outline,
.checkout-coupon-applied .btn-checkout-outline {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Selector cards (address / carrier / gateway)
   -------------------------------------------------------------------------- */

.selector-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.selector-card {
  position: relative;
  display: block;
  border: 1px solid var(--home-border);
  /*border-radius: var(--home-radius-md);*/
  background: var(--home-surface);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.selector-card:hover {
  border-color: var(--home-accent);
}

.selector-card input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.selector-card .selector-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
}

.selector-card .selector-radio-dot {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--home-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.selector-card .selector-radio-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--home-accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}

.selector-card input:checked ~ .selector-card-inner .selector-radio-dot,
.selector-card.is-checked .selector-radio-dot {
  border-color: var(--home-accent);
}

.selector-card input:checked ~ .selector-card-inner .selector-radio-dot::after,
.selector-card.is-checked .selector-radio-dot::after {
  opacity: 1;
  transform: scale(1);
}

.selector-card input:checked ~ .selector-card-inner,
.selector-card.is-checked .selector-card-inner {
  background: var(--home-accent-soft);
}

.selector-card.is-checked,
.selector-card:has(input:checked) {
  border-color: var(--home-accent);
  box-shadow: 0 0 0 3px rgba(71, 187, 156, 0.12);
}

.selector-card .selector-card-body {
  flex: 1;
  min-width: 0;
}

.selector-card .selector-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--home-text);
}

.selector-card .selector-card-sub {
  font-size: 0.75rem;
  color: var(--home-text-muted);
  margin-top: 2px;
}

.selector-card .selector-card-action {
  flex: 0 0 auto;
}

.selector-card .selector-card-action .btn-checkout-outline {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.selector-card .selector-card-img {
  flex: 0 0 56px;
  width: 56px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selector-card .selector-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.selector-card.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.selector-card--address,
.selector-card--carrier {
  border-radius: var(--home-radius-md);
  overflow: hidden;
}

.selector-card--address .selector-card-inner,
.selector-card--carrier .selector-card-inner {
  align-items: flex-start;
  padding: 14px 16px;
  gap: 12px;
}

.selector-card--carrier .selector-card-inner {
  align-items: center;
}

.selector-card--address .selector-card-icon,
.selector-card--carrier .selector-card-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--home-bg);
  color: var(--home-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.selector-card--address .selector-card-icon i,
.selector-card--carrier .selector-card-icon i {
  font-size: 16px;
}

.selector-card--address .selector-card-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 4px;
}

.selector-card--address .selector-card-title,
.selector-card--carrier .selector-card-title {
  font-size: 0.9375rem;
}

.selector-card--address .selector-card-recipient {
  font-size: 0.75rem;
  color: var(--home-text-muted);
}

.selector-card--address .selector-card-sub--address {
  color: var(--home-text);
  font-size: 0.8125rem;
  line-height: 1.75;
  margin-top: 0;
}

.selector-card--address .selector-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.selector-card--address .selector-card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--home-bg);
  color: var(--home-text-muted);
  font-size: 0.6875rem;
}

.selector-card--address .selector-card-edit {
  border: none;
  background: transparent;
  color: var(--home-accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 0;
  cursor: pointer;
  white-space: nowrap;
}

.selector-card--address .selector-card-edit:hover,
.selector-card--address .selector-card-edit:focus-visible {
  color: var(--home-accent-hover);
}

.selector-card--address .selector-card-edit:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
}

.selector-card--carrier .selector-card-sub {
  line-height: 1.7;
  margin-top: 4px;
}

.selector-card--address.is-checked,
.selector-card--address:has(input:checked),
.selector-card--carrier.is-checked,
.selector-card--carrier:has(input:checked) {
  box-shadow: none;
  border-inline-start-width: 3px;
}

.selector-card--address.is-checked .selector-card-inner,
.selector-card--address:has(input:checked) .selector-card-inner,
.selector-card--carrier.is-checked .selector-card-inner,
.selector-card--carrier:has(input:checked) .selector-card-inner {
  background: transparent;
}

.selector-card--address.is-checked .selector-card-icon,
.selector-card--address:has(input:checked) .selector-card-icon,
.selector-card--carrier.is-checked .selector-card-icon,
.selector-card--carrier:has(input:checked) .selector-card-icon {
  background: var(--home-accent-soft);
  color: var(--home-accent);
}

.selector-card--address:focus-within,
.selector-card--carrier:focus-within {
  outline: 2px solid var(--home-accent);
  outline-offset: 2px;
}

@media (max-width: 576px) {
  .selector-card--address .selector-card-inner,
  .selector-card--carrier .selector-card-inner {
    padding: 12px;
    gap: 10px;
  }

  .selector-card--address .selector-card-icon,
  .selector-card--carrier .selector-card-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}

/* Section title inside cards */
.checkout-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--home-text-muted);
  margin-bottom: 10px;
}

.checkout-section-title i {
  color: var(--home-accent);
  font-size: 16px;
}

.checkout-section {
  margin-bottom: 20px;
}

.checkout-section:last-child {
  margin-bottom: 0;
}

.checkout-address-empty {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-address-empty-hint {
  margin: 0;
  text-align: right;
  padding: 12px 14px;
  background: var(--home-accent-soft);
  border-radius: var(--home-radius-sm);
  color: var(--home-text);
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Order summary sidebar
   -------------------------------------------------------------------------- */

.checkout-summary-card {
  position: relative;
  background: var(--home-surface);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
  box-shadow: var(--home-shadow-sm);
  padding: 20px;
}

.checkout-summary-card .summary-status-banner {
  background: var(--home-danger);
  color: #fff;
  font-size: 0.75rem;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--home-radius-sm);
  margin: -20px -20px 16px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.checkout-shell .summary-rows {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-shell .summary-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--home-text-muted);
}

.checkout-shell .summary-rows li span:last-child {
  color: var(--home-text);
  font-weight: 600;
  text-align: left;
}

.checkout-shell .summary-divider {
  height: 1px;
  background: var(--home-border);
  margin: 12px 0;
}

.checkout-shell .summary-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.checkout-shell .summary-total-label {
  font-size: 0.875rem;
  color: var(--home-text-muted);
}

.checkout-shell .summary-total-value {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--home-text);
}

.checkout-shell .summary-total-value small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--home-text-muted);
}

.checkout-summary-card .wiki-holder {
  position: relative;
  display: inline-flex;
  cursor: help;
}

.checkout-summary-card .wiki-sign {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--home-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-right: 4px;
}

.checkout-summary-card .wiki-sign::before {
  content: '؟';
}

.checkout-summary-card .wiki-container {
  display: none;
  position: absolute;
  bottom: 22px;
  right: 0;
  width: 220px;
  background: var(--home-text);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--home-radius-sm);
  font-size: 0.75rem;
  line-height: 1.6;
  z-index: 10;
}

.checkout-summary-card .wiki-holder:hover .wiki-container {
  display: block;
}

.checkout-summary-card .min-order-progress {
  margin: 12px 0 0;
}

.checkout-summary-card .min-order-progress__track {
  height: 8px;
  background: var(--home-bg);
  border-radius: 999px;
  overflow: hidden;
}

.checkout-summary-card .min-order-progress__bar {
  height: 100%;
  background: var(--home-accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.checkout-summary-card .min-order-progress p {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--home-text-muted);
}

.checkout-summary-card .checkout-unavailable-lock {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--home-radius-sm);
  background: #FEF2F2;
  color: #B91C1C;
  font-size: 0.8125rem;
}

.checkout-summary-card .selenium-next-step-shipping {
  display: block;
  text-decoration: none;
}

.checkout-summary-card .btn-checkout-primary:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
}

.checkout-item-card .item-unavailable-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.checkout-item-card .item-unavailable-remove {
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid #FECACA;
  background: #fff;
  color: #B91C1C;
  border-radius: var(--home-radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  touch-action: manipulation;
}

.checkout-item-card .item-unavailable-remove:focus-visible {
  outline: 2px solid #DC2626;
  outline-offset: 2px;
}

.checkout-sticky-cta {
  display: none;
}

.checkout-address-inline {
  margin-top: 8px;
}

.selector-card .selector-card-sub--address {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.invoice-pay-trust {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.invoice-pay-trust li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--home-text-muted);
}

.invoice-pay-trust i {
  color: var(--home-accent);
  margin-top: 3px;
}

.checkout-related-toggle {
  display: none;
}

/* Mobile: items first, sticky cart CTA above footer nav */
@media (max-width: 991px) {
  .checkout-layout .checkout-aside-col {
    order: 2;
  }

  .checkout-page {
    padding-bottom: calc(84px + 56px + env(safe-area-inset-bottom, 0px));
  }

  .checkout-summary-card--sticky .checkout-cta-desktop,
  .checkout-page .checkout-cta-desktop {
    display: none;
  }

  .checkout-sticky-cta {
    position: fixed;
    right: 0;
    left: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--home-surface);
    border-top: 1px solid var(--home-border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  .checkout-sticky-cta__meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
  }

  .checkout-sticky-cta__meta strong {
    font-size: 1.125rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .checkout-sticky-cta__meta span {
    font-size: 0.75rem;
    color: var(--home-text-muted);
  }

  .checkout-sticky-cta .btn-checkout-primary {
    width: auto;
    min-width: 168px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  .checkout-related-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    margin: 0 0 12px;
    padding: 0 16px;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-md);
    background: var(--home-surface);
    color: inherit;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }

  .checkout-related-toggle > span:last-child {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--home-accent);
  }

  .checkout-related-toggle:focus-visible {
    outline: 2px solid var(--home-accent);
    outline-offset: 2px;
  }

  .checkout-related:not(.is-open) .checkout-related-body {
    display: none;
  }

  .invoice-pay-sticky {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-summary-card .min-order-progress__bar {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Products compact strip
   -------------------------------------------------------------------------- */

.checkout-shell .checkout-related {
  margin-top: 8px;
}

.checkout-shell .checkout-related-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--home-text);
  margin: 24px 0 12px;
}

.checkout-shell .checkout-related-title--desktop {
  display: block;
}

@media (max-width: 991px) {
  .checkout-shell .checkout-related-title--desktop {
    display: none;
  }

  .checkout-shell .checkout-related-toggle .checkout-related-title {
    margin: 0;
  }
}

.checkout-shell .checkout-related .product-box-container {
  padding: 0;
}

.checkout-shell .checkout-related-body > [class*='col-'] {
  margin-bottom: 12px;
}

.checkout-shell .checkout-related .product-box {
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-sm);
  background: var(--home-surface);
  transition: transform 0.2s, box-shadow 0.2s;
}

.checkout-shell .checkout-related .product-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--home-shadow-sm);
}

.checkout-shell .checkout-related .product-box-title {
  margin-bottom: 12px;
}

.checkout-shell .checkout-related .item {
  position: relative;
}

.checkout-shell .checkout-related .item .discount {
  width: 45px;
  height: 30px;
  background-color: var(--home-danger);
  color: #fff;
  top: 20px;
  left: 15px;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  border-radius: 40px;
  z-index: 1;
  font-size: 14px;
}

.checkout-shell .checkout-related .item .price del {
  color: var(--home-text-muted);
  font-size: 13px;
  display: block;
  text-decoration: line-through;
}

.checkout-shell .checkout-related .item ins {
  color: var(--home-danger);
  font-size: 14px;
  text-decoration: none;
  display: block;
}

/* --------------------------------------------------------------------------
   Order tracking
   -------------------------------------------------------------------------- */

.order-tracker {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 24px 0;
  flex-wrap: wrap;
}

.order-tracker li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 84px;
  position: relative;
}

.order-tracker .tracker-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--home-border);
  background: var(--home-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--home-text-muted);
  font-size: 18px;
  z-index: 1;
}

.order-tracker li.is-done .tracker-icon {
  border-color: var(--home-accent);
  background: var(--home-accent);
  color: #fff;
}

.order-tracker .tracker-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--home-text-muted);
  text-align: center;
}

.order-tracker li.is-done .tracker-label {
  color: var(--home-text);
}

.order-tracker .tracker-connector {
  align-self: flex-start;
  margin-top: 21px;
  width: 40px;
  height: 2px;
  background: var(--home-border);
}

.order-tracker .tracker-connector.is-done {
  background: var(--home-accent);
}

@media (max-width: 576px) {
  .order-tracker .tracker-connector {
    width: 16px;
  }

  .order-tracker li {
    min-width: 60px;
  }
}

.order-status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 14px 18px;
  border-radius: var(--home-radius-sm);
  background: var(--home-accent-soft);
  color: var(--home-text);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.order-status-banner.is-rejected {
  background: var(--home-danger-soft);
  color: var(--home-danger);
}

.order-status-banner.is-delivered {
  background: var(--home-accent-soft);
  color: var(--home-accent-hover);
}

.order-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 576px) {
  .order-info-grid {
    grid-template-columns: 1fr;
  }
}

.order-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-info-item .info-title {
  font-size: 0.75rem;
  color: var(--home-text-muted);
}

.order-info-item .info-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--home-text);
}

.order-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.order-detail-table th,
.order-detail-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--home-border);
}

.order-detail-table thead th {
  background: var(--home-bg);
  color: var(--home-text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.order-detail-table tbody tr:hover {
  background: var(--home-bg);
}

@media (max-width: 575px) {
  .order-detail-table--stack,
  .order-detail-table--stack tbody {
    display: block;
  }

  .order-detail-table--stack thead {
    display: none;
  }

  .order-detail-table--stack tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-sm);
  }

  .order-detail-table--stack tbody tr:hover {
    background: none;
  }

  .order-detail-table--stack td {
    padding: 0;
    border: 0;
    text-align: right;
    color: var(--home-text);
  }

  .order-detail-table--stack td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--home-text-muted);
  }

  .order-detail-table--stack .cell-index,
  .order-detail-table--stack td:empty {
    display: none;
  }

  .order-detail-table--stack .cell-name {
    grid-column: 1 / -1;
    font-weight: 700;
    line-height: 1.7;
  }

  .order-detail-table--stack .cell-final {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px dashed var(--home-border);
    font-weight: 700;
  }
}

/* --------------------------------------------------------------------------
   Payment gateway cards (invoice)
   -------------------------------------------------------------------------- */

.gateway-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.gateway-installment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.gateway-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  min-height: 96px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
  background: var(--home-surface);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gateway-card input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gateway-card img {
  height: 36px;
  object-fit: contain;
}

.gateway-card .gateway-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--home-text);
}

.gateway-card:has(input:checked),
.gateway-card.is-checked {
  border-color: var(--home-accent);
  box-shadow: 0 0 0 3px rgba(71, 187, 156, 0.12);
  background: var(--home-accent-soft);
}

.gateway-card.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gateway-card--installment {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  text-align: right;
  padding: 14px 16px;
  min-height: 76px;
  gap: 0;
}

.gateway-card--installment.is-checked,
.gateway-card--installment:has(input:checked) {
  border-color: var(--home-accent);
}

.gateway-card--snapp.is-checked,
.gateway-card--snapp:has(input:checked) {
  border-color: rgba(0, 142, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 142, 250, 0.1);
  background: rgba(0, 142, 250, 0.04);
}

.gateway-card--torob.is-checked,
.gateway-card--torob:has(input:checked) {
  border-color: rgba(0, 168, 89, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 168, 89, 0.1);
  background: rgba(0, 168, 89, 0.04);
}

.gateway-installment-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.gateway-installment-info__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.gateway-installment-info__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.gateway-installment-info__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.gateway-installment-info__title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--home-text);
  line-height: 1.5;
}

.gateway-installment-info__description {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.gateway-installment-info--snapp .gateway-installment-info__description {
  color: #0078d4;
}

.gateway-installment-info--torob .gateway-installment-info__description {
  color: #00965e;
}

.gateway-eligibility-note {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--home-danger);
  background: var(--home-danger-soft);
  padding: 8px 12px;
  border-radius: var(--home-radius-sm);
}

.checkout-terms-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--home-text-muted);
  margin: 16px 0;
}

.checkout-terms-check a {
  color: var(--home-accent);
  font-weight: 700;
  text-decoration: none;
}

.checkout-terms-check input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--home-accent);
  cursor: pointer;
}

.checkout-credit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--home-text);
  margin-bottom: 4px;
}

.checkout-credit-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--home-accent);
  cursor: pointer;
}

.checkout-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--home-text-muted);
  padding: 8px 0;
}

.checkout-price-row .price-value {
  color: var(--home-text);
  font-weight: 700;
}

.invoice-amount-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 8px;
  padding: 16px 18px;
  background: var(--home-bg);
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-md);
}

.invoice-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.invoice-amount-row__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--home-text-muted);
}

.invoice-amount-row__value {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--home-text);
  white-space: nowrap;
}

.invoice-amount-row__value small {
  margin-inline-start: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--home-text-muted);
}

.invoice-amount-row--bank {
  padding-top: 12px;
  border-top: 1px dashed var(--home-border);
}

.invoice-amount-row--bank .invoice-amount-row__label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--home-text);
}

.invoice-amount-row--bank .invoice-amount-row__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--home-accent);
}

.invoice-amount-stack .checkout-credit-row {
  margin: 0;
  padding: 8px 0 0;
  font-size: 0.8125rem;
}

@media (max-width: 576px) {
  .invoice-amount-stack {
    gap: 10px;
    padding: 12px 14px;
  }

  .invoice-amount-row__label {
    font-size: 0.75rem;
  }

  .invoice-amount-row__value {
    font-size: 1rem;
  }

  .invoice-amount-row--bank .invoice-amount-row__label {
    font-size: 0.8125rem;
  }

  .invoice-amount-row--bank .invoice-amount-row__value {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Loading overlay
   -------------------------------------------------------------------------- */

.checkout-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

.checkout-loading-overlay img {
  width: 40px;
}

.checkout-card,
.checkout-summary-card,
.selector-list {
  position: relative;
}

/* --------------------------------------------------------------------------
   Coupon code
   -------------------------------------------------------------------------- */

.checkout-coupon {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--home-border);
}

.checkout-coupon-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.checkout-coupon-form input {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--home-text);
  background: var(--home-surface);
}

.checkout-coupon-form input:focus {
  outline: none;
  border-color: var(--home-accent);
  box-shadow: 0 0 0 3px rgba(71, 187, 156, 0.12);
}

.checkout-coupon-form .btn-checkout-outline {
  flex: 0 0 auto;
  white-space: nowrap;
}

.checkout-coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--home-accent-soft);
  border: 1px solid var(--home-accent);
  border-radius: var(--home-radius-sm);
  font-size: 0.875rem;
  color: var(--home-text);
}

.checkout-coupon-applied .coupon-label {
  font-weight: 700;
  color: var(--home-accent-hover);
}

/* --------------------------------------------------------------------------
   Compact product grid (productsCompact)
   -------------------------------------------------------------------------- */

.checkout-shell .checkout-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 576px) {
  .checkout-shell .checkout-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .checkout-shell .checkout-related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.checkout-shell .checkout-product-compact {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius-sm);
  background: var(--home-surface);
  padding: 12px;
  height: 100%;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}

.checkout-shell .checkout-product-compact:hover {
  box-shadow: var(--home-shadow-sm);
  transform: translateY(-2px);
}

.checkout-shell .checkout-product-compact .compact-discount {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--home-danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--home-radius-md);
  z-index: 1;
}

.checkout-shell .checkout-product-compact .compact-img {
  display: block;
  width: 100%;
  height: 100px;
  margin-bottom: 10px;
}

.checkout-shell .checkout-product-compact .compact-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checkout-shell .checkout-product-compact .compact-title {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--home-text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.checkout-shell .checkout-product-compact .compact-price {
  text-align: center;
}

.checkout-shell .checkout-product-compact .compact-price del {
  display: block;
  color: var(--home-text-muted);
  font-size: 0.75rem;
  text-decoration: line-through;
  margin-bottom: 2px;
}

.checkout-shell .checkout-product-compact .compact-price ins {
  display: block;
  color: var(--home-accent);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}
