/* ============================================================
   Netleselim — ödeme akışı (odeme.html, odeme-sonuc.html)
   style.css'in token setini kullanır; yeni renk tanımlamaz.
   Mobil öncelikli: tek kolon + ekran altında sabit ödeme çubuğu.
   ============================================================ */

.odeme-page {
  background: var(--bg-soft);
  /* iPhone çentiği/home çubuğu: sabit çubuk içeriği kesmesin */
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Üst şerit ---------- */

.odeme-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.odeme-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.odeme-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* 44px dokunma hedefi */
  min-height: 44px;
  padding: 0 8px 0 0;
  margin-left: -8px;
  padding-left: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.odeme-back:hover { color: var(--text); }
.odeme-back svg { width: 20px; height: 20px; }

.odeme-logo .logo-mark { width: 28px; height: 28px; }
.odeme-logo .logo-text { font-size: 18px; }

.odeme-secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--good);
  white-space: nowrap;
}
.odeme-secure svg { width: 18px; height: 18px; }

/* ---------- Adım göstergesi ---------- */

.odeme-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 24px 0 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
}

.odeme-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.odeme-step + .odeme-step::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--border);
  margin-right: 8px;
}

.odeme-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.odeme-step.active { color: var(--text); }
.odeme-step.active > span { background: var(--accent); color: #161616; }
.odeme-step.done { color: var(--good); }
.odeme-step.done > span { background: var(--good); color: #ffffff; }

/* ---------- Izgara ---------- */

.odeme-main { padding-bottom: 48px; }

.odeme-grid {
  display: grid;
  /* Mobilde tek kolon; özet üstte kalır ki tutar hep görünür olsun */
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

/* ---------- Sipariş özeti ---------- */

.odeme-ozet { padding: 24px; }

.ozet-baslik {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.ozet-plan-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ozet-plan-ust strong { font-size: 22px; font-weight: 800; }

.ozet-alt { margin-top: 4px; font-size: 14px; color: var(--text-muted); }

.ozet-ozellikler {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.ozet-ozellikler li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}
.ozet-ozellikler svg {
  width: 16px; height: 16px;
  color: var(--accent-deep);
  flex-shrink: 0;
  transform: translateY(4px);
}

/* Plan/dönem değiştirici — geri gitmeye gerek kalmasın */

.ozet-degistir {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.ozet-secim-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.ozet-degistir .segmented { margin-bottom: 0; }
/* Dokunma hedefi: pastil butonlar mobilde 44px'e çıksın */
.ozet-degistir .seg-btn { min-height: 44px; }

/* Tutar dökümü */

.ozet-tutar {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 8px;
}

.ozet-satir {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ozet-liste { text-decoration: line-through; color: var(--text-faint); }
.ozet-satir-indirim { color: var(--good); font-weight: 600; }

.ozet-satir-toplam {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.ozet-satir-toplam strong { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }

.ozet-kdv { margin-top: 8px; font-size: 12px; color: var(--text-faint); }

/* Güvenceler — iade/iptal en güçlü dönüşüm kaldıracı, gizlemiyoruz */

.ozet-guvence {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--accent-wash);
  border-radius: var(--radius-sm);
}
.ozet-guvence li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ozet-guvence strong { color: var(--text); }
.ozet-guvence svg {
  width: 16px; height: 16px;
  color: var(--good);
  flex-shrink: 0;
  transform: translateY(3px);
}

/* ---------- Tek tık kutusu ---------- */

.tek-tik {
  display: grid;
  gap: 12px;
  padding: 20px;
  margin-bottom: 16px;
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

.tek-tik-baslik { font-size: 15px; font-weight: 700; }
.tek-tik-alt {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.tek-tik .btn svg { width: 20px; height: 20px; }
.tek-tik .btn-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  text-decoration: underline;
  min-height: 44px;
}

/* Tek tık gösterilirken form gizli tutulur ama DOM'da kalır
   (onay kutuları ve gizli alanlar hâlâ gerekli) */
.odeme-form.form-kapali { display: none; }

/* ---------- Form ---------- */

.odeme-form { display: grid; gap: 20px; padding: 24px; }

.form-baslik { font-size: 20px; font-weight: 700; }
.form-alt { margin-top: -12px; font-size: 14px; color: var(--text-muted); }

/* iOS'ta 16px altı font otomatik yakınlaştırma tetikler — 16px taban */
.odeme-form input { font-size: 16px; }

.field-hint {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.odeme-ek summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.odeme-ek[open] summary { margin-bottom: 16px; }
.odeme-ek > .form-field,
.odeme-ek > .form-row { margin-top: 16px; }

.odeme-hata {
  padding: 16px;
  background: rgba(214, 69, 69, 0.08);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--danger);
}

/* Gönder butonu: tutar butonun üstünde — "ne kadar ödüyorum" belirsiz kalmasın */

.odeme-submit {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  font-size: 17px;
}
.submit-tutar {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.submit-spinner { display: none; }
.odeme-submit.yukleniyor .submit-tutar { visibility: hidden; }
.odeme-submit.yukleniyor .submit-spinner {
  display: block;
  position: absolute;
  right: 20px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border: 2px solid rgba(22, 22, 22, 0.25);
  border-top-color: #161616;
  border-radius: 50%;
  animation: odeme-spin 0.7s linear infinite;
}
@keyframes odeme-spin { to { transform: rotate(360deg); } }

.odeme-submit:disabled { opacity: 0.75; cursor: progress; transform: none; }

/* Güven şeridi */

.odeme-guven {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.guven-3d {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--good);
}
.guven-3d svg { width: 16px; height: 16px; }

.guven-kart { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kart-logo {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.guven-iyzico { max-width: 380px; line-height: 1.5; }
.guven-iyzico strong { color: var(--text-muted); }

/* ---------- iyzico formu ---------- */

.iyzico-wrap { padding: 24px; }
.iyzico-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.iyzico-head h2 { font-size: 20px; font-weight: 700; }
.iyzico-head .btn-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
/* iyzico gömülü formu kendi genişliğini dayatabiliyor; taşmayı kes */
#iyzipay-checkout-form { max-width: 100%; overflow-x: auto; }
.iyzico-not { margin-top: 16px; font-size: 12px; color: var(--text-faint); line-height: 1.5; }

.odeme-yardim {
  margin-top: 32px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}
.odeme-yardim a { color: var(--accent-ink); text-decoration: underline; }

/* ---------- Mobil sabit ödeme çubuğu ---------- */

.odeme-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(28, 26, 22, 0.10);
}

.sticky-tutar { display: grid; line-height: 1.25; min-width: 0; }
.sticky-label {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sticky-tutar strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

.sticky-btn { flex-shrink: 0; min-height: 48px; padding: 8px 24px; }

/* ---------- Alt bilgi ---------- */

.odeme-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-faint);
}
.odeme-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.odeme-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.odeme-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}
.odeme-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Sonuç sayfası ---------- */

.sonuc-wrap {
  max-width: 560px;
  margin: 48px auto;
  padding: 40px 32px;
  text-align: center;
}

.sonuc-ikon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.sonuc-ikon svg { width: 40px; height: 40px; }
.sonuc-basarili .sonuc-ikon { background: rgba(30, 142, 87, 0.12); color: var(--good); }
.sonuc-hatali .sonuc-ikon { background: rgba(214, 69, 69, 0.10); color: var(--danger); }
.sonuc-bekliyor .sonuc-ikon { background: var(--accent-soft); color: var(--accent-deep); }

.sonuc-wrap h1 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 16px; }
.sonuc-wrap > p { color: var(--text-muted); font-size: 16px; }

.sonuc-detay {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 24px 0;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 14px;
}
.sonuc-detay li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-variant-numeric: tabular-nums;
}
.sonuc-detay span:first-child { color: var(--text-faint); }
.sonuc-detay span:last-child { font-weight: 600; overflow-wrap: anywhere; }

.sonuc-adimlar {
  list-style: none;
  display: grid;
  gap: 16px;
  margin: 24px 0;
  text-align: left;
}
.sonuc-adimlar li { display: flex; gap: 12px; font-size: 15px; color: var(--text-muted); }
.sonuc-adimlar b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #161616;
  font-size: 12px;
}

.sonuc-aksiyon { display: grid; gap: 12px; margin-top: 24px; }

/* ---------- Geniş ekran ---------- */

@media (min-width: 900px) {
  .odeme-grid {
    /* Masaüstünde form solda değil sağda: göz özetten tutara, sonra forma iner */
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 32px;
  }
  .odeme-ozet { position: sticky; top: 88px; }
  .odeme-page { padding-bottom: 0; }
  /* Sabit çubuk yalnızca mobilde gerekli */
  .odeme-sticky { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .submit-spinner { animation-duration: 2s; }
}
