/* =========================================================
   Noor Shop - Checkout Page
   ========================================================= */
.ns-checkout {
  padding: 56px 0 88px;
  background:
    radial-gradient(700px 220px at 0% 0%, rgba(136, 147, 70, 0.07), transparent 55%),
    #f7f9f8;
}

.ns-checkout__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.ns-checkout__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ns-checkout__panel {
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(7, 28, 31, 0.08);
  box-shadow: 0 10px 28px rgba(7, 28, 31, 0.04);
}

.ns-checkout__panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.ns-checkout__panel-head h2,
.ns-checkout__summary h2 {
  margin: 0;
  color: var(--ns-ink, #071c1f);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.ns-checkout__toggle,
.ns-checkout__link {
  color: #2a4a11 !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(42, 74, 17, 0.25);
}

.ns-checkout__toggle:hover,
.ns-checkout__link:hover {
  color: #1e360c !important;
  border-bottom-color: #1e360c;
}

.ns-checkout__hint {
  margin: 0 0 16px;
  color: var(--ns-muted, #5a6b6e);
  font-size: 14px;
  line-height: 1.6;
}

.ns-checkout__hint strong {
  color: var(--ns-ink, #071c1f);
}

.ns-checkout__block {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(7, 28, 31, 0.08);
}

.ns-checkout__block:first-of-type {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.ns-checkout__block h3 {
  margin: 0 0 14px;
  color: var(--ns-ink, #071c1f);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.ns-checkout__fields {
  display: grid;
  gap: 14px;
}

.ns-checkout__fields--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ns-checkout__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ns-checkout__field--full {
  grid-column: 1 / -1;
}

.ns-checkout__field label {
  margin: 0;
  color: var(--ns-ink, #071c1f);
  font-size: 13px;
  font-weight: 700;
}

.ns-checkout__field input,
.ns-checkout__field select,
.ns-checkout__field textarea {
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(7, 28, 31, 0.12);
  border-radius: 12px;
  background-color: #f8faf9;
  background-image: none;
  box-shadow: none;
  outline: none;
  color: var(--ns-ink, #071c1f);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Native governorate select — excluded from NiceSelect, match #city exactly */
.ns-checkout__field select#governorate_id {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  /* LTR: arrow on the right */
  padding-right: 42px;
  padding-left: 14px;
  background-color: #f8faf9;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ns-ink, #071c1f) 50%),
    linear-gradient(135deg, var(--ns-ink, #071c1f) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* RTL: arrow vertically centered on the left */
html[dir="rtl"] .ns-checkout__field select#governorate_id,
html[lang="ar"] .ns-checkout__field select#governorate_id {
  padding-right: 14px;
  padding-left: 42px;
  background-position:
    14px 50%,
    20px 50%;
}

.ns-checkout__field textarea {
  height: auto;
  min-height: 120px;
  resize: vertical;
}

.ns-checkout__field input:focus,
.ns-checkout__field select#governorate_id:focus,
.ns-checkout__field textarea:focus {
  background-color: #fff;
  border-color: rgba(136, 147, 70, 0.55);
  box-shadow: 0 0 0 3px rgba(136, 147, 70, 0.15);
}

.ns-checkout__field select#governorate_id:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ns-ink, #071c1f) 50%),
    linear-gradient(135deg, var(--ns-ink, #071c1f) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
}

html[dir="rtl"] .ns-checkout__field select#governorate_id:focus,
html[lang="ar"] .ns-checkout__field select#governorate_id:focus {
  background-position:
    14px 50%,
    20px 50%;
}

/* If NiceSelect still wraps this field, neutralize the outer wrapper completely */
.ns-checkout__field .nice-select {
  float: none !important;
  display: flex !important;
  align-items: center;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 12px 14px 12px 42px !important;
  border: 1px solid rgba(7, 28, 31, 0.12) !important;
  border-radius: 12px !important;
  background: #f8faf9 !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--ns-ink, #071c1f) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  box-sizing: border-box !important;
  text-align: right !important;
}

.ns-checkout__field .nice-select:hover,
.ns-checkout__field .nice-select:active,
.ns-checkout__field .nice-select.open,
.ns-checkout__field .nice-select:focus {
  border-color: rgba(136, 147, 70, 0.55) !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(136, 147, 70, 0.15) !important;
}

.ns-checkout__field .nice-select::before,
.ns-checkout__field .nice-select::after {
  border: none !important;
  box-shadow: none !important;
}

/* RTL: NiceSelect caret on the left, vertically centered */
.ns-checkout__field .nice-select::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 18px !important;
  right: auto !important;
  width: 7px !important;
  height: 7px !important;
  margin-top: -5px !important;
  border-bottom: 2px solid var(--ns-ink, #071c1f) !important;
  border-right: 2px solid var(--ns-ink, #071c1f) !important;
  transform: rotate(45deg) !important;
  pointer-events: none !important;
}

html[dir="ltr"] .ns-checkout__field .nice-select {
  padding: 12px 42px 12px 14px !important;
  text-align: left !important;
}

html[dir="ltr"] .ns-checkout__field .nice-select::after {
  left: auto !important;
  right: 18px !important;
}

.ns-checkout__field .nice-select .current {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ns-ink, #071c1f);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

.ns-checkout__field .nice-select .list {
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(7, 28, 31, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(7, 28, 31, 0.08);
  background: #fff;
}

.ns-checkout__error {
  color: #a32626;
  font-size: 12px;
  font-weight: 600;
}

.ns-checkout__help {
  color: var(--ns-muted, #5a6b6e);
  font-size: 12px;
  line-height: 1.45;
}

.ns-checkout__login-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 16px;
}

.ns-checkout__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ns-muted, #5a6b6e);
  font-size: 13px;
  cursor: pointer;
}

.ns-checkout__remember input {
  accent-color: #2a4a11;
}

.ns-checkout__secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(42, 74, 17, 0.22);
  border-radius: 999px;
  background: rgba(42, 74, 17, 0.08);
  color: #2a4a11;
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ns-checkout__secondary-btn:hover {
  background: rgba(42, 74, 17, 0.14);
  border-color: rgba(42, 74, 17, 0.35);
  transform: translateY(-1px);
}

.ns-checkout__secondary-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.ns-checkout__coupon-head {
  margin-bottom: 16px;
}

.ns-checkout__coupon-head h2 {
  margin: 0 0 6px;
  color: var(--ns-ink, #071c1f);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.ns-checkout__coupon-head .ns-checkout__hint {
  margin: 0;
}

.ns-checkout__coupon-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 520px;
  border: 1px solid rgba(7, 28, 31, 0.12);
  border-radius: 12px;
  background: #f8faf9;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ns-checkout__coupon-row:focus-within {
  background: #fff;
  border-color: rgba(136, 147, 70, 0.55);
  box-shadow: 0 0 0 3px rgba(136, 147, 70, 0.15);
}

.ns-checkout__coupon-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ns-ink, #071c1f);
  font-size: 15px;
  line-height: 1.45;
  outline: none;
}

.ns-checkout__coupon-apply {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-inline-start: 1px solid rgba(7, 28, 31, 0.1);
  background: linear-gradient(135deg, #2a4a11 0%, #889346 100%);
  color: #fff;
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.ns-checkout__coupon-apply:hover {
  filter: brightness(1.06);
  color: #fff;
}

.ns-checkout__coupon-apply:disabled {
  opacity: 0.75;
  cursor: wait;
  filter: none;
}

.coupon-message {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.coupon-message.success {
  display: block;
  background: rgba(42, 74, 17, 0.08);
  color: #2a4a11;
  border: 1px solid rgba(42, 74, 17, 0.18);
}

.coupon-message.error {
  display: block;
  background: rgba(163, 38, 38, 0.08);
  color: #a32626;
  border: 1px solid rgba(163, 38, 38, 0.18);
}

.coupon-applied {
  display: none;
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(42, 74, 17, 0.06);
  border: 1px solid rgba(42, 74, 17, 0.18);
}

.coupon-applied.show {
  display: block;
}

.applied-coupon-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.applied-coupon-code {
  color: #2a4a11;
  font-weight: 700;
}

.remove-coupon {
  border: 0;
  background: transparent;
  color: #a32626;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.coupon-discount {
  color: #2a4a11;
  font-size: 13px;
  font-weight: 600;
}

.ns-checkout__aside {
  position: sticky;
  top: 100px;
}

.ns-checkout__summary {
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(7, 28, 31, 0.08);
  box-shadow: 0 12px 32px rgba(7, 28, 31, 0.06);
}

.ns-checkout__summary h2 {
  margin-bottom: 18px;
}

.ns-checkout__items {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow: auto;
}

.ns-checkout__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(7, 28, 31, 0.06);
}

.ns-checkout__item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ns-checkout__item-name {
  color: var(--ns-ink, #071c1f);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.ns-checkout__item-variant {
  color: var(--ns-muted, #5a6b6e);
  font-weight: 500;
}

.ns-checkout__item-qty {
  color: var(--ns-muted, #5a6b6e);
  font-size: 12px;
  font-weight: 600;
}

.ns-checkout__item-price {
  color: var(--ns-ink, #071c1f);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.ns-checkout__empty-line {
  padding: 18px 0;
  text-align: center;
  color: var(--ns-muted, #5a6b6e);
  font-size: 14px;
}

.ns-checkout__totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  margin-bottom: 18px;
}

.ns-checkout__total-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: var(--ns-ink, #071c1f);
  font-size: 14px;
}

.ns-checkout__total-row--discount strong {
  color: #2a4a11 !important;
}

.ns-checkout__total-row--grand {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(7, 28, 31, 0.08);
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.ns-checkout__place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a4a11 0%, #889346 100%);
  color: #fff;
  font-family: var(--ltn__heading-font, 'Rajdhani', sans-serif);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(42, 74, 17, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.ns-checkout__place:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(42, 74, 17, 0.28);
  filter: brightness(1.04);
  color: #fff;
}

.ns-checkout__place:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.ns-checkout__privacy {
  margin: 14px 0 0;
  color: var(--ns-muted, #5a6b6e);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.ns-checkout__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  color: #2a4a11 !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}

.ns-checkout__back:hover {
  color: #1e360c !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 991px) {
  .ns-checkout__layout {
    grid-template-columns: 1fr;
  }

  .ns-checkout__main {
    order: 1;
  }

  .ns-checkout__aside {
    position: static;
    order: 2;
  }
}

@media (max-width: 767px) {
  .ns-checkout {
    padding: 40px 0 64px;
  }

  .ns-checkout__fields--2 {
    grid-template-columns: 1fr;
  }

  .ns-checkout__coupon-row {
    max-width: none;
  }

  .ns-checkout__panel,
  .ns-checkout__summary {
    padding: 18px;
  }
}
