/* Checkout, payment and tracking pages (order flow). Loaded after site.css. */

.center { text-align: center; }
.strong-link { font-weight: 700; }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.is-checkout .brand__sub { display: none; }
@media (min-width: 900px) { .is-checkout .brand__logo { width: 56px; height: 56px; } }

/* --------------------------------------------------------------- steps */
.steps-bar { margin: 16px var(--page-pad) 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.steps-bar__step { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--c-muted); }
.steps-bar__line { height: 5px; border-radius: 3px; background: var(--c-track); }
.steps-bar__step.is-done { color: var(--c-green); }
.steps-bar__step.is-done .steps-bar__line { background: var(--c-green); }
.steps-bar__step.is-current { color: var(--c-maroon); font-weight: 800; }
.steps-bar__step.is-current .steps-bar__line { background: var(--c-maroon); }

.steps-head { display: none; }
@media (min-width: 900px) {
  .steps-head { margin: 0; padding: 0; list-style: none; display: flex; gap: 10px; flex-wrap: wrap; font-size: 15px; font-weight: 700; }
  .steps-head__step { display: flex; align-items: center; gap: 8px; color: var(--c-muted); }
  .steps-head__n { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #E0C9A8; display: flex; align-items: center; justify-content: center; font-size: 14px; }
  .steps-head__step.is-done { color: var(--c-green); }
  .steps-head__step.is-done .steps-head__n { background: var(--c-green); border-color: var(--c-green); color: var(--c-white); }
  .steps-head__step.is-current { color: var(--c-maroon); font-weight: 800; }
  .steps-head__step.is-current .steps-head__n { background: var(--c-maroon); border-color: var(--c-maroon); color: var(--c-white); }
  .steps-head__sep { width: 32px; height: 2px; background: var(--c-input-border); align-self: center; }
}

/* ------------------------------------------------------------ checkout */
.checkout { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; padding-bottom: 24px; }
.checkout__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.checkout__head h1 { font-size: 34px; }
.co-card { padding: 16px; border-radius: 20px; background: var(--c-white); border: 1px solid var(--c-border); display: flex; flex-direction: column; gap: 12px; }
.co-card__title { font-size: 19px; }
.co-grid { display: flex; flex-direction: column; gap: 12px; }
.field__hint { font-weight: 400; color: var(--c-brown-light); }
.input[aria-invalid="true"] { border-color: var(--c-red); }
.phone-row { display: flex; gap: 8px; }
[dir="ltr"] .phone-row { flex-direction: row-reverse; } /* +995 before the number in English too */
.phone-row .input { flex: 1; min-width: 0; }
.phone-row__cc { flex-shrink: 0; height: 48px; padding: 0 14px; border-radius: var(--r-input); border: 1px solid var(--c-input-border); background: #F7EBD8; display: flex; align-items: center; font-weight: 700; }
[dir="rtl"] input[type="email"].input, [dir="rtl"] input[type="tel"].input { text-align: right; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 44px; cursor: pointer; }
.check input { accent-color: var(--c-maroon); width: 22px; height: 22px; margin: 0; flex-shrink: 0; }

.co-addr { display: flex; flex-direction: column; gap: 12px; }
.co-addr__fields { display: flex; flex-direction: column; gap: 12px; }
.co-map-wrap { display: flex; flex-direction: column; gap: 12px; position: relative; }
.co-map {
  position: relative; height: 230px; border-radius: 16px; background: #EFE6D6; border: 1px solid var(--c-input-border); overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--c-brown-light); font-size: 13px; text-align: center; z-index: 0;
}
.co-map.leaflet-container { display: block; font-family: var(--font-body); }
.co-map__hint { margin-top: -4px; }
.co-pin-area { display: flex; flex-direction: column; gap: 12px; }
.co-pin-area[hidden] { display: none; }

/* Big "حدد مكاني" button: the easiest way, so it comes first and looks like the main action. */
.co-locate {
  min-height: 60px; width: 100%; padding: 8px 16px; border-radius: 16px; border: none; background: var(--c-maroon); color: var(--c-cream);
  display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; text-align: start;
  box-shadow: 0 4px 14px rgba(125, 36, 39, .25); font-family: inherit;
}
.co-locate:active { transform: translateY(1px); }
.co-locate:focus-visible { outline: 3px solid var(--c-saffron); outline-offset: 2px; }
.co-locate__icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 248, 238, .16); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.co-locate__text { display: flex; flex-direction: column; gap: 2px; }
.co-locate__text strong { font-size: 17px; font-weight: 800; }
.co-locate__text small { font-size: 12.5px; opacity: .85; }
.co-locate.is-busy { opacity: .75; cursor: progress; }
.co-locate.is-busy .co-locate__icon svg { animation: co-spin 1s linear infinite; }
@keyframes co-spin { to { transform: rotate(360deg); } }

/* Address search above the map */
.pm-search { position: relative; display: flex; flex-direction: column; gap: 6px; }
.pm-search__box { position: relative; }
.pm-search__icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--c-brown-light); display: flex; pointer-events: none; }
.pm-search__input { width: 100%; padding-inline-start: 42px; }
.pm-search__input::-webkit-search-cancel-button { cursor: pointer; }
.pm-search__list {
  position: absolute; top: 100%; inset-inline: 0; z-index: 1000; margin: 4px 0 0; padding: 6px; list-style: none;
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: 14px; box-shadow: 0 10px 28px rgba(58, 18, 18, .18);
  max-height: 300px; overflow-y: auto;
}
.pm-opt { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.pm-opt strong { font-size: 14.5px; font-weight: 700; }
.pm-opt small { font-size: 12px; color: var(--c-brown-light); }
.pm-opt:hover, .pm-opt.is-active { background: var(--c-selected-bg); }
.pm-note { padding: 10px 12px; font-size: 13px; color: var(--c-brown-light); }

/* «هبعت اللوكيشن على واتساب» */
.co-locwa {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; cursor: pointer;
  border: 1.5px dashed var(--c-input-border); background: var(--c-white);
}
.co-locwa input { accent-color: #1FA855; width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.co-locwa__icon { color: #1FA855; display: flex; flex-shrink: 0; }
.co-locwa__text { display: flex; flex-direction: column; gap: 2px; }
.co-locwa__text strong { font-size: 15px; font-weight: 800; }
.co-locwa__text small { font-size: 12.5px; color: var(--c-brown-light); line-height: 1.5; }
.co-locwa:has(input:checked) { border: 2px solid #1FA855; background: #EEF9F1; }
.co-locwa:has(input:focus-visible) { outline: 3px solid var(--c-saffron); outline-offset: 2px; }

/* After the order (payment + tracking pages): "send us your location on WhatsApp" */
.locwa-box {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-card); background: #EEF9F1; border: 2px solid #1FA855;
}
.locwa-box__icon { width: 40px; height: 40px; border-radius: 50%; background: #1FA855; color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.locwa-box__body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.locwa-box__title { margin: 0; font-size: 17px; font-weight: 800; }
.locwa-box__text { margin: 0; font-size: 14px; line-height: 1.6; }
.locwa-box .btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.co-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.co-3 .input { padding: 0 10px; min-width: 0; }

.seg2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg2__opt, .day, .slot { position: relative; cursor: pointer; }
.seg2__opt input, .day input, .slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg2__opt {
  min-height: 60px; border-radius: 14px; border: 1px solid var(--c-input-border); background: var(--c-white);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; text-align: center;
}
.seg2__title { font-weight: 800; font-size: 15px; }
.seg2__sub { font-size: 12px; color: var(--c-brown-light); }
.seg2__opt:has(input:checked) { border: 2px solid var(--c-maroon); background: var(--c-selected-bg); }
.seg2__opt.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: auto; }
.seg2__opt:has(input:focus-visible), .day:has(input:focus-visible), .slot:has(input:focus-visible) { outline: 3px solid var(--c-saffron); outline-offset: 2px; }
.sched { display: flex; flex-direction: column; gap: 12px; }
.days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.day {
  flex: 1 0 96px; min-height: 56px; border-radius: 14px; border: 1px solid var(--c-input-border); background: var(--c-white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.day__label { font-weight: 700; font-size: 14px; }
.day__date { font-size: 12px; color: var(--c-brown-light); }
.day:has(input:checked) { background: var(--c-maroon); border-color: var(--c-maroon); color: var(--c-cream); }
.day:has(input:checked) .day__label { font-weight: 800; }
.day:has(input:checked) .day__date { color: var(--c-cream); }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot span {
  height: 44px; border-radius: 12px; border: 1px solid var(--c-input-border); background: var(--c-white);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.slot:has(input:checked) span { border: 2px solid var(--c-maroon); background: var(--c-selected-bg); color: var(--c-maroon); font-weight: 800; }

.checkout__side { display: flex; flex-direction: column; gap: 10px; }
.co-totals { padding: 16px; border-radius: var(--r-card); background: var(--c-white); border: 1px solid var(--c-border); display: flex; flex-direction: column; gap: 10px; }
.co-totals .sum-row--total .price { font-size: 17px; }
.co-lines { display: flex; flex-direction: column; gap: 14px; }
.co-when { padding: 12px; border-radius: 14px; background: var(--c-cream); font-size: 14px; line-height: 1.6; }

@media (min-width: 900px) {
  .checkout { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 28px; padding-block: 32px 0; }
  .checkout__main { flex: 999 1 560px; gap: 20px; }
  .checkout__head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .co-card { padding: 24px; border-radius: var(--r-card-lg); gap: 16px; }
  .co-card__title { font-size: 22px; }
  .co-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .co-grid .input, .co-addr .input, .phone-row__cc { height: 50px; font-size: 16px; }
  .co-grid__wa { order: 10; grid-column: 1 / -1; }
  .check { font-size: 15px; }
  .co-addr { flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .co-map-wrap, .co-addr__fields { flex: 1 1 300px; }
  .co-map { height: auto; min-height: 280px; flex: 1; border-radius: 18px; font-size: 14px; }
  .co-3 { gap: 10px; }
  .seg2 { display: flex; gap: 12px; flex-wrap: wrap; }
  .seg2__opt { flex: 1 1 200px; min-height: 64px; border-radius: 16px; }
  .seg2__title { font-size: 16px; }
  .seg2__sub { font-size: 13px; }
  .days { flex-wrap: wrap; gap: 10px; }
  .day { flex: 1 1 110px; min-height: 60px; }
  .day__label { font-size: 15px; }
  .day__date { font-size: 13px; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .slot span { height: 46px; font-size: 14px; }
  .checkout__side {
    flex: 1 1 320px; max-width: 400px; position: sticky; top: 16px; padding: 24px; border-radius: var(--r-card-lg);
    background: var(--c-white); border: 1px solid var(--c-border); gap: 14px;
  }
  .co-totals { padding: 0; border: none; border-radius: 0; gap: 14px; }
  .co-totals .sum-row--total { font-size: 19px; }
  .co-totals .sum-row--total .price { font-size: 19px; }
}

/* ------------------------------------------------------------- payment */
.pay { gap: 14px; }
.pay .checkout__main { gap: 14px; }
.pay__title { font-size: 34px; }
.pay-hero { padding: 18px; border-radius: var(--r-card-lg); background: var(--c-maroon); color: var(--c-cream); display: flex; flex-direction: column; gap: 14px; }
.pay-hero__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-hero__item { display: flex; flex-direction: column; gap: 2px; }
.pay-hero__label { font-size: 13px; color: var(--c-on-maroon-soft); }
.pay-hero__value { font-weight: 800; font-size: 26px; }
.pay-hero__value--num { letter-spacing: 1px; }
.pay-hero__sep { height: 1px; background: rgba(251, 231, 211, .25); }
.pay-hero__copy {
  height: 44px; padding: 0 14px; border-radius: 22px; font-weight: 700; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.pay-hero__copy--ghost { border: 1.5px solid var(--c-on-maroon-soft); background: transparent; color: var(--c-cream); }
.pay-hero__copy--yellow { border: none; background: var(--c-saffron); color: var(--c-brown); font-weight: 800; }
.pay-note { padding: 12px 14px; border-radius: 16px; background: var(--c-cream-dark); border: 1px dashed var(--c-promo-border); font-size: 15px; line-height: 1.6; }
.pay-note strong:first-child { color: var(--c-maroon); }
.pay-sec { display: flex; flex-direction: column; gap: 10px; }
.pay-sec__title { font-family: var(--font-body); font-size: 17px; font-weight: 800; }

.banks { display: flex; flex-direction: column; gap: 10px; }
.bank { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-card); background: var(--c-white); border: 1px solid var(--c-input-border); cursor: pointer; }
.bank > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bank__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bank__name { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.bank__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-radio); flex-shrink: 0; }
.bank__instant { display: none !important; font-size: 13px; color: var(--c-green); font-weight: 700; }
.bank__show { font-size: 13px; color: var(--c-brown-light); }
.bank__body { display: none; flex-direction: column; gap: 12px; }
.bank__field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank__label { font-size: 13px; color: var(--c-brown-light); }
.bank__holder { font-weight: 700; font-size: 15px; }
.bank__iban { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--c-cream); }
.bank__iban-val { font-weight: 800; font-size: 15px; letter-spacing: .5px; text-align: end; word-break: break-all; }
[dir="rtl"] .bank__iban-val { text-align: right; }
.bank__copy {
  flex-shrink: 0; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 22px; border: 1px solid var(--c-input-border);
  background: var(--c-white); color: var(--c-maroon); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; cursor: pointer;
}
.bank:has(> input:checked) { border: 2px solid var(--c-maroon); }
.bank:has(> input:checked) .bank__radio { border: 6px solid var(--c-maroon); }
.bank:has(> input:checked) .bank__instant { display: inline !important; }
.bank:has(> input:checked) .bank__show { display: none !important; }
.bank:has(> input:checked) .bank__body { display: flex; }
.bank:has(> input:focus-visible) { outline: 3px solid var(--c-saffron); outline-offset: 2px; }

.drop {
  min-height: 150px; border-radius: var(--r-card); border: 2px dashed var(--c-dashed); background: var(--c-white);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--c-maroon); cursor: pointer; padding: 16px; text-align: center;
}
.drop.is-over { background: var(--c-selected-bg); border-color: var(--c-maroon); }
.drop.has-file { border-style: solid; border-color: var(--c-green); }
.drop__title { font-weight: 800; font-size: 16px; }
.drop__hint { font-size: 13px; color: var(--c-brown-light); word-break: break-all; }
#receipt:focus-visible + .drop, .drop:focus-within { outline: 3px solid var(--c-saffron); outline-offset: 2px; }
.pay-submit { display: flex; flex-direction: column; gap: 10px; }
.pay-submit .btn { width: 100%; }
.pay-submit__note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-brown-light); line-height: 1.5; }
.pay-submit__note .icon { flex-shrink: 0; }
/* Phase 6: "هدفع عن طريق واتساب" under the receipt button (not in the design; same components) */
.pay-wa { display: flex; flex-direction: column; gap: 8px; width: 100%; padding-top: 6px; }
.pay-wa__or { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--c-brown-light); }
.pay-wa__or::before, .pay-wa__or::after { content: ""; flex: 1; border-top: 1px solid var(--c-border); }
.pay-wa__text { margin: 0; font-size: 14px; color: var(--c-brown-light); line-height: 1.6; }
/* checkout: payment method */
.co-pay { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.co-pay__opts { display: flex; flex-direction: column; gap: 8px; }
.co-pay__opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--c-input-border); border-radius: var(--r-input); background: var(--c-input-bg, #FFFDF9); cursor: pointer; min-height: 48px; }
.co-pay__opt:has(input:checked) { border-color: var(--c-maroon); box-shadow: 0 0 0 1px var(--c-maroon) inset; background: #FFF4F0; }
.co-pay__opt input { accent-color: var(--c-maroon); width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; }
.co-pay__opt span { display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: 15px; }
.co-pay__opt small { font-weight: 400; font-size: 13px; color: var(--c-brown-light); line-height: 1.5; }
.pay-sum { padding: 16px; border-radius: var(--r-card); background: var(--c-white); border: 1px solid var(--c-border); font-size: 15px; }
.pay-sum__title { font-family: var(--font-body); font-weight: 800; font-size: 15px; }

@media (min-width: 900px) {
  .pay .checkout__main { gap: 20px; }
  .pay-hero { padding: 24px 28px; border-radius: var(--r-block); flex-direction: row; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
  .pay-hero__row { display: contents; }
  .pay-hero__label { font-size: 14px; }
  .pay-hero__item { gap: 4px; }
  .pay-hero__value { font-size: 34px; }
  .pay-hero__btns { display: flex !important; gap: 10px; flex-wrap: wrap; }
  .pay-hero__copy { height: 48px; padding: 0 18px; font-size: 15px; font-weight: 800; }
  .pay-note { padding: 14px 18px; font-size: 16px; }
  .pay-sec { gap: 12px; }
  .pay-sec__title { font-size: 19px; }
  .banks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
  .bank { padding: 20px; border-radius: 20px; gap: 14px; }
  .bank__name { font-size: 19px; }
  .bank__body { display: flex; gap: 14px; }
  .bank__holder { font-size: 16px; }
  .bank__iban { padding: 12px 14px; border-radius: 14px; }
  .bank__iban-val { font-size: 16px; }
  .bank__copy { padding: 0 14px; }
  .drop { min-height: 170px; border-radius: 20px; }
  .drop__title { font-size: 17px; }
  .drop__hint { font-size: 14px; }
  .pay-submit { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
  .pay-submit .btn { width: auto; padding: 0 40px; }
  .pay-wa { max-width: 520px; }
  .pay-wa .btn { width: 100%; }
  .pay-submit__note { font-size: 14px; }
  .pay-submit__note .icon { display: none; }
  .pay-sum { padding: 24px; border-radius: var(--r-card-lg); gap: 12px; }
  .pay-sum__title { font-family: var(--font-head); font-weight: 700; font-size: 22px; }
  .pay-sum .sum-row--total { font-size: 18px; }
}
