/* ═══════════════════════════════════════════════════════
   PYRANEXT — Step Pages  |  Mobile-First  |  v1
   Brand: #DF0A0A  |  Cairo (AR)  |  Plus Jakarta Sans (EN)
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #DF0A0A;
  --red-dark: #b50808;
  --bg:       #0a0a0a;
  --card:     #111111;
  --card2:    #161616;
  --border:   #222222;
  --border2:  #2e2e2e;
  --text:     #e5e5e5;
  --muted:    #888888;
  --muted2:   #555555;
  --yellow:   #f5c842;
  --green:    #22c55e;
}

html { font-size: 16px; scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }

body {
  font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  overflow-x: hidden;
}

/* (overflow-x managed below in html rule) */

[data-lang="en"] body,
[data-lang="en"] { direction: ltr; font-family: 'Plus Jakarta Sans', 'Cairo', sans-serif; }

/* ── Step Header ─────────────────────────────────── */
.step-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10,10,10,.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 0 1.25rem;
  height: 56px;
}

.step-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.step-logo img { height: 26px; }
.step-logo .logo-fallback {
  display: none;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
}

.step-lang-btn {
  background: #1a1a1a;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  padding: .35rem .75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.step-lang-btn:hover { border-color: var(--red); color: var(--red); }

/* ── Progress Bar ────────────────────────────────── */
.progress-wrap {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.25rem;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 360px;
  margin: 0 auto;
}

.ps-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  flex: 1;
  position: relative;
}

.ps-step::before {
  content: '';
  position: absolute;
  top: 14px;
  width: 100%;
  height: 2px;
  background: var(--border2);
  inset-inline-end: 50%;
}
.ps-step:first-child::before { display: none; }

.ps-step.done::before   { background: var(--red); }
.ps-step.active::before { background: var(--red); }

.ps-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted2);
  position: relative;
  z-index: 1;
  transition: all .25s;
}

.ps-step.done .ps-dot {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.ps-step.active .ps-dot {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(223,10,10,.2);
}

.ps-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted2);
  white-space: nowrap;
}
.ps-step.active .ps-label { color: var(--red); }
.ps-step.done .ps-label   { color: var(--muted); }

/* ── Page Body ───────────────────────────────────── */
.step-body {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.step-title {
  margin-bottom: 1.5rem;
}
.step-title h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: .35rem;
  word-break: break-word;
  overflow-wrap: break-word;
}
.step-title p {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

/* ── Template Grid ───────────────────────────────── */
.tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.tpl-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.tpl-card:hover { border-color: #444; }
.tpl-card.selected,
.tpl-card:has(input:checked) {
  border-color: var(--red);
  background: rgba(223,10,10,.07);
  box-shadow: 0 0 0 3px rgba(223,10,10,.15);
}

.tpl-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tpl-thumb {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  margin-bottom: .75rem;
  background-size: cover;
  background-position: center top;
  overflow: hidden;
  position: relative;
}
.tpl-thumb-custom {
  background: linear-gradient(135deg, #1a0a2e, #0d0d0d);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tpl-thumb-custom svg { width: 32px; height: 32px; opacity: .5; }

.tpl-name {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .25rem;
  line-height: 1.3;
}
.tpl-desc {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.4;
}

.tpl-check {
  position: absolute;
  top: .6rem;
  inset-inline-start: .6rem;
  width: 24px; height: 24px;
  background: var(--red);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.tpl-card.selected .tpl-check,
.tpl-card:has(input:checked) .tpl-check { display: flex; }
.tpl-check svg { width: 12px; height: 12px; }

/* Red tint overlay on selected thumbnail — visible even over white images */
.tpl-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  border-radius: 8px;
  transition: background .2s;
  pointer-events: none;
  z-index: 1;
}
.tpl-card.selected .tpl-thumb::after,
.tpl-card:has(input:checked) .tpl-thumb::after {
  background: rgba(223,10,10,.25);
  border: 2px solid rgba(223,10,10,.6);
}

/* ── Form Fields ─────────────────────────────────── */
.form-section {
  margin-bottom: 1.5rem;
}
.form-section-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .875rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.field { margin-bottom: 1rem; }

.field label {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  font-size: .83rem;
  font-weight: 600;
  color: #ccc;
  margin-bottom: .4rem;
  line-height: 1.35;
}
.field label .t-ar,
.field label .t-en,
.field label .inline-ar,
.field label .inline-en { line-height: inherit; }
.field label .t-ar { display: inline; }
.field label .t-en { display: none; }
[data-lang="en"] .field label .t-ar { display: none; }
[data-lang="en"] .field label .t-en { display: inline; }
.field label .req {
  color: var(--red);
  flex-shrink: 0;
  line-height: 1;
}
.field label .hint {
  display: inline-flex;
  align-items: baseline;
  font-weight: 400;
  color: var(--muted2);
  font-size: .75rem;
  margin-inline-start: .25rem;
}
.field label .hint .t-ar { display: inline; }
.field label .hint .t-en { display: none; }
[data-lang="en"] .field label .hint .t-ar { display: none; }
[data-lang="en"] .field label .hint .t-en { display: inline; }

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--card2);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
  padding: .75rem 1rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(223,10,10,.12);
}
.field textarea { resize: vertical; min-height: 90px; }

.field input.error,
.field textarea.error { border-color: var(--red) !important; }

.field-hint {
  font-size: .75rem;
  color: var(--muted2);
  margin-top: .3rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

/* ── Website Language Picker ─────────────────────── */
.wl-picker {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: .5rem;
}

.wl-option {
  display: flex;
  align-items: center;
  gap: .875rem;
  background: var(--card2);
  border: 2px solid var(--border2);
  border-radius: 12px;
  padding: .875rem 1rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.wl-option input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.wl-option:hover { border-color: #444; }
.wl-option.selected,
.wl-option:has(input:checked) {
  border-color: var(--red);
  background: rgba(223,10,10,.07);
}

.wl-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: #222;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .8rem;
  color: #999;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.wl-option.selected .wl-icon,
.wl-option:has(input:checked) .wl-icon {
  background: var(--red);
  color: #fff;
}

.wl-info { flex: 1; }
.wl-info strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: .15rem;
}
.wl-info small { font-size: .76rem; color: var(--muted); }
.wl-badge { color: var(--yellow) !important; font-weight: 700 !important; }

.wl-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #444;
  flex-shrink: 0;
  transition: all .2s;
  position: relative;
}
.wl-option.selected .wl-radio,
.wl-option:has(input:checked) .wl-radio {
  border-color: var(--red);
  background: var(--red);
}
.wl-option.selected .wl-radio::after,
.wl-option:has(input:checked) .wl-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
}

/* ── File Upload ─────────────────────────────────── */
.upload-box {
  border: 2px dashed var(--border2);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--card2);
  position: relative;
}
.upload-box:hover { border-color: #555; }
.upload-box.drag-over { border-color: var(--red); background: rgba(223,10,10,.05); }
.upload-box input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-placeholder svg { width: 28px; height: 28px; color: var(--muted2); margin-bottom: .5rem; }
.upload-placeholder p { font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
.upload-placeholder small { font-size: .72rem; color: var(--muted2); }

.upload-preview {
  display: none;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.upload-preview img {
  width: 52px; height: 52px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: #222;
}
.upload-preview .up-info { flex: 1; text-align: start; }
.upload-preview .up-name { font-size: .8rem; color: #ccc; font-weight: 600; }
.upload-preview .up-remove {
  font-size: .75rem; color: var(--muted); cursor: pointer;
  background: #222; border-radius: 5px; padding: .2rem .5rem;
  border: 1px solid var(--border2);
}
.upload-preview .up-remove:hover { color: var(--red); border-color: var(--red); }

/* ── Order Summary (Step 3) ──────────────────────── */
.order-summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.osc-header {
  background: rgba(223,10,10,.08);
  border-bottom: 1px solid rgba(223,10,10,.2);
  padding: .875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.osc-header svg { color: var(--red); flex-shrink: 0; }
.osc-header span { font-size: .85rem; font-weight: 700; color: #e5e5e5; }

.osc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.osc-row:last-child { border-bottom: none; }
.osc-row .osc-label { color: var(--muted); }
.osc-row .osc-val { font-weight: 700; color: #e5e5e5; }
.osc-row.total { background: rgba(223,10,10,.06); }
.osc-row.total .osc-label { color: #ccc; font-weight: 600; }
.osc-row.total .osc-val {
  font-size: 1.1rem;
  color: var(--red);
}

/* ── Payment Methods ─────────────────────────────── */
.payment-options {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.25rem;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card2);
  border: 2px solid var(--border2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.pay-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pay-option:hover { border-color: #444; }
.pay-option.selected,
.pay-option:has(input:checked) {
  border-color: var(--red);
  background: rgba(223,10,10,.07);
}

.pay-logo {
  width: 52px; height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .75rem;
}
.pay-logo-instapay { background: #fff; padding: 0; }
.pay-logo-geidea { background: #1a1a3e; color: #fff; }

.pay-info { flex: 1; }
.pay-info strong { display: block; font-size: .88rem; font-weight: 700; color: #e5e5e5; }
.pay-info small { font-size: .75rem; color: var(--muted); }

.pay-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #444; flex-shrink: 0;
  transition: all .2s; position: relative;
}
.pay-option.selected .pay-radio,
.pay-option:has(input:checked) .pay-radio {
  border-color: var(--red); background: var(--red);
}
.pay-option.selected .pay-radio::after,
.pay-option:has(input:checked) .pay-radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #fff;
}

/* Payment Panel */
.pay-panel {
  display: none;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: -.3rem;
  margin-bottom: 1rem;
}
.pay-panel.active { display: block; }

.instapay-pay-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  background: var(--red);
  color: #fff;
  border: 1px solid rgba(255,255,255,.08);
  padding: .9rem 1.1rem;
  border-radius: 10px;
  margin: .875rem 0;
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease;
}
.instapay-pay-link:hover { filter: brightness(1.08); transform: translateY(-1px); }
.instapay-pay-link:focus-visible { outline: 3px solid rgba(223,10,10,.28); outline-offset: 3px; }
.copy-btn:hover { background: var(--red-dark); }

.pay-steps { padding: 0; list-style: none; }
.pay-steps li {
  font-size: .83rem;
  color: var(--muted);
  padding: .3rem 0;
  padding-inline-start: 1.25rem;
  position: relative;
  line-height: 1.5;
}
.pay-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  inset-inline-start: 0;
  color: var(--red);
  font-weight: 700;
  font-size: .8rem;
}
.pay-steps { counter-reset: step; }

.geidea-soon {
  text-align: center;
  padding: 1rem;
}
.geidea-soon p { color: var(--muted); font-size: .85rem; margin-bottom: .5rem; }
.geidea-badge {
  display: inline-block;
  background: #1a1a1a;
  color: var(--yellow);
  border: 1px solid #333;
  border-radius: 6px;
  padding: .3rem .75rem;
  font-size: .75rem;
  font-weight: 700;
}

/* ── Legal Consent ───────────────────────────────── */
.legal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.legal-label {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  font-size: .83rem;
  color: #999;
  line-height: 1.65;
}
.legal-label input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.legal-check {
  width: 20px; height: 20px; min-width: 20px;
  border: 2px solid #444;
  border-radius: 5px;
  background: #1a1a1a;
  margin-top: 1px;
  transition: all .2s;
  position: relative; flex-shrink: 0;
}
.legal-label input:checked ~ .legal-check {
  background: var(--red); border-color: var(--red);
}
.legal-label input:checked ~ .legal-check::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.legal-label a { color: var(--red); text-decoration: underline; }

/* ── Footer Actions ──────────────────────────────── */
.step-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10,10,10,.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: .875rem 1.25rem;
  padding-bottom: calc(.875rem + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}
.footer-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: .75rem;
  align-items: center;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: #1a1a1a;
  border: 1.5px solid var(--border2);
  color: var(--muted);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s;
  flex-shrink: 0;
}
.btn-back:hover { border-color: #555; color: #ccc; }
.btn-back svg { width: 16px; height: 16px; }

.btn-next {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--red);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  padding: .875rem 1.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
}
.btn-next:hover { background: var(--red-dark); }
.btn-next svg { width: 18px; height: 18px; }
.btn-next:disabled { background: #333; color: #666; cursor: not-allowed; }

/* ── Toast ───────────────────────────────────────── */
#pn-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #DF0A0A;
  color: #fff;
  padding: .65rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: .85rem;
  font-family: inherit;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(223,10,10,.4);
  opacity: 0;
  transition: opacity .3s;
  white-space: nowrap;
  pointer-events: none;
}
#pn-toast.show { opacity: 1; }

/* ── Utility ─────────────────────────────────────── */
.t-ar { display: block; }
.t-en { display: none;  }
[data-lang="en"] .t-ar { display: none;  }
[data-lang="en"] .t-en { display: block; }

.inline-ar { display: inline; }
.inline-en { display: none;  }
[data-lang="en"] .inline-ar { display: none;  }
[data-lang="en"] .inline-en { display: inline; }

.market-intl { display: none !important; }
[data-market="intl"] .market-arab { display: none !important; }
[data-market="intl"] .market-intl { display: inline !important; }
[data-market="intl"] .market-intl.market-block { display: block !important; }

/* ── Responsive breakpoints ──────────────────────── */
@media (min-width: 640px) {
  .tpl-grid { grid-template-columns: 1fr 1fr 1fr; }
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* Desktop: wider template grid for step1 */
@media (min-width: 768px) {
  .step-body--wide {
    max-width: 960px;
  }
  .step-body--wide .tpl-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .step-body--wide .tpl-thumb {
    height: 130px;
  }
  .step-body--wide .tpl-card {
    padding: 1.1rem;
  }
  .step-body--wide .tpl-name {
    font-size: .9rem;
  }
  .step-body--wide .tpl-desc {
    font-size: .78rem;
  }
}

/* Small phones — prevent button text wrap, shrink heading */
@media (max-width: 460px) {
  .step-title h1 { font-size: 1.25rem; }
  .btn-next {
    font-size: .83rem;
    padding: .875rem .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 380px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .step-logo span { display: none; }
  .step-title h1 { font-size: 1.15rem; }
  .btn-next { font-size: .78rem; }
}

/* ── Floating WhatsApp Button ───────────────────── */
.wa-float {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37,211,102,.4);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  overflow: hidden;
}
[dir="rtl"] .wa-float { right: auto; left: 20px; }
.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37,211,102,.5);
}
.wa-float svg { width: 28px; height: 28px; fill: #fff; }
