/* Ödeme sayfası tasarımları. Yalnız body.opx (klasik dışı) iken yüklenir; mağaza renkleri --app-* değişkenlerinden gelir. */

body.opx {
  --opx-accent: var(--app-accent, #c2410c);
  --opx-ink: #1a1a1a;
  --opx-muted: #6b7280;
  --opx-line: #d9d9d9;
  --opx-soft: #f6f6f7;
  --opx-tint: color-mix(in srgb, var(--opx-accent) 7%, #fff);
}

/* ---- Sipariş özeti ---- */
.opx-summary {
  background: var(--opx-tint);
  border-bottom: 2px solid color-mix(in srgb, var(--opx-accent) 35%, #fff);
  margin: 0 0 8px;
  text-align: left;
}

html body.opx .opx-summary__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--opx-ink);
  font: 600 15px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
}

html body.opx .opx-summary__toggle:focus { outline: none; }
html body.opx .opx-summary__toggle:focus-visible { outline: 2px solid var(--opx-accent); outline-offset: -3px; }
.opx-summary.is-open { background: #fff; border: 2px solid var(--opx-accent); }

.opx-summary__label { display: flex; align-items: center; gap: 8px; color: var(--opx-accent); text-align: left; }
.opx-summary__chev { font-size: 12px; transition: transform 0.15s ease; }
.opx-summary.is-open .opx-summary__chev { transform: rotate(180deg); }
.opx-summary__toggle strong { font-size: 19px; font-weight: 800; white-space: nowrap; }
.opx-summary__body { padding: 4px 16px 14px; border-top: 1px solid var(--opx-line); }
.opx-summary__body[hidden] { display: none; }
.opx-summary__item { display: flex; gap: 14px; align-items: center; padding: 12px 0; }

.opx-summary__item img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--opx-line);
  border-radius: 10px;
  background: #fff;
}

.opx-summary__item > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--opx-ink); }
.opx-summary__item b { font-size: 15px; line-height: 1.35; }
.opx-summary__item small { font-size: 13px; color: var(--opx-muted); }
.opx-summary__item small:empty,
.opx-summary__item small[hidden] { display: none; }

.opx-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid var(--opx-line);
  font-size: 15px;
  font-weight: 700;
  color: var(--opx-ink);
}

.opx-summary__total strong { font-size: 22px; font-weight: 800; }

html body.opx.opx--compact .opui-cart-h2,
html body.opx.opx--compact .op-order-vitrin__hero { display: none !important; }

/* ---- Ortak form görünümü ---- */
html body.site-shell-app.opx .order-page-shell .order-form .order-form__title {
  margin: 0 0 4px;
  padding: 14px 0 2px;
  background: none;
  color: var(--opx-ink);
  text-shadow: none;
  text-align: left;
  font-size: 22px;
  font-weight: 800;
}

html body.site-shell-app.opx .order-form label:not(.opx-pay__item) {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}

html body.site-shell-app.opx .order-form .form-group { margin-bottom: 12px; }

html body.site-shell-app.opx .order-form .form-control {
  height: 50px;
  font-size: 16px;
  border: 1px solid var(--opx-line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--opx-ink);
  box-shadow: none;
}

html body.site-shell-app.opx .order-form textarea.form-control { height: auto; min-height: 76px; border-radius: 8px; }

html body.site-shell-app.opx .order-form .form-control:focus {
  border-color: var(--opx-accent);
  box-shadow: 0 0 0 1px var(--opx-accent);
  outline: none;
}

html body.site-shell-app.opx .order-form .form-control.field-warn { border-color: #ef4444 !important; }

html body.site-shell-app.opx .order-form #payment_method_id.form-control:not(.opx-sr) {
  font-size: 16px !important;
  border-radius: 8px !important;
}

html body.site-shell-app.opx .order-form .opui-variant-select {
  background-color: #fff !important;
  color: var(--opx-ink) !important;
  border: 1px solid var(--opx-line) !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  appearance: auto;
}

html body.site-shell-app.opx .order-form .opui-variant-select:focus {
  background-color: #fff !important;
  color: var(--opx-ink) !important;
  border-color: var(--opx-accent) !important;
  box-shadow: 0 0 0 1px var(--opx-accent) !important;
}

html body.opx .order-form .opui-variant-swatch { border-color: var(--opx-line); }

html body.site-shell-app.opx .order-form .kurumsal-fatura-details { border-radius: 8px; border-color: var(--opx-line); }
html body.site-shell-app.opx .order-form .kurumsal-fatura-details summary { background: var(--opx-soft) !important; font-size: 15px !important; }

html body.site-shell-app.opx .order-form .order-form__submit {
  margin-top: 16px;
  min-height: 58px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 19px;
  font-weight: 800;
}

/* ---- Bölüm başlıkları ---- */
html body.site-shell-app.opx .order-form .opx-head {
  margin: 22px 0 12px;
  padding: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--opx-ink);
  text-align: left;
  scroll-margin-top: calc(var(--app-header-clear, 70px) + 60px);
}

html body.site-shell-app.opx .order-form .order-form__section-title { display: none; }

/* ---- Ödeme kartları ---- */
.opx-pay { border: 1px solid var(--opx-line); border-radius: 10px; overflow: hidden; background: #fff; }
.opx-pay[hidden] { display: none; }

html body.site-shell-app.opx .order-form label.opx-pay__item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 15px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--opx-ink);
  cursor: pointer;
}

.opx-pay__item + .opx-pay__item { border-top: 1px solid var(--opx-line); }
html body.opx .order-form label.opx-pay__item.is-on { background: var(--opx-tint); box-shadow: inset 0 0 0 2px var(--opx-accent); }
.opx-pay__item input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--opx-accent); }
.opx-pay__name { flex: 1; min-width: 0; text-align: left; }
.opx-pay__item i { color: var(--opx-muted); font-size: 18px; }
.opx-pay__item.is-on i { color: var(--opx-accent); }
.opx-pay__item:focus-within { outline: 2px solid var(--opx-accent); outline-offset: -3px; }

.opx-pay-group { position: relative; }

html body.site-shell-app.opx .order-form #payment_method_id.opx-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.opx-pay-group:has(.field-warn) .opx-pay { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16); }

/* ---- Alta sabit düğme ---- */
.opx-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 9500;
  width: min(480px, 100%);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--opx-line);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.1);
}

.opx-bar[hidden] { display: none; }
.opx-bar__sum { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.opx-bar__sum small { font-size: 12px; color: var(--opx-muted); }
.opx-bar__sum strong { font-size: 19px; font-weight: 800; color: var(--opx-ink); white-space: nowrap; }

html body.opx .opx-bar__btn {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--opx-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

/* Yüzen öğeler sabit çubuğun üstünde kalsın; sayfa sonu çubuğun altında kalmasın. */
html body.opx.opx-bar-on { padding-bottom: 76px; }
html body.opx.opx-bar-on .social-buttons { bottom: 88px !important; }
html body.opx.opx-bar-on .cf-fab { bottom: 160px !important; }
html body.opx.opx-bar-on .scroll-to-top { bottom: 150px !important; }
html body.opx.opx-bar-on .fk-live-toast { bottom: 90px !important; }
html body.opx.side-menu-open .opx-bar { visibility: hidden; }

/* ======== Tasarım: Mağaza kasası ======== */
html body.opx--shop .order-page-shell .full-width-section.order-form { box-shadow: none; border-color: transparent; }

/* ======== Tasarım: Adım adım ======== */
html body.opx--steps { counter-reset: opx-step; background: var(--opx-soft); }

html body.opx--steps .order-page-shell .order-form .opx-head {
  counter-increment: opx-step;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px -16px 14px;
  padding: 18px 16px 0;
  border-top: 8px solid var(--opx-soft);
}

html body.opx--steps .order-form .opx-head::before {
  content: counter(opx-step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--opx-accent);
  color: #fff;
  font-size: 15px;
}

.opx-progress {
  display: flex;
  gap: 6px;
  position: sticky;
  top: var(--app-header-clear, 64px);
  z-index: 900; /* kayan kampanya şeritlerinin üstünde, header'ın altında */
  margin: 0 0 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--opx-line);
}

html body.opx .opx-progress button {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 10px 4px;
  border: 2px solid var(--opx-line);
  border-radius: 12px;
  background: #fff;
  color: var(--opx-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.opx-progress b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--opx-line);
  color: #374151;
  font-size: 12px;
}

/* Tamamlanan adım */
html body.opx .opx-progress button.is-done { color: #14532d; border-color: #16a34a; background: #f0fdf4; }
.opx-progress button.is-done b { background: #16a34a; color: transparent; position: relative; }
.opx-progress button.is-done b::after { content: "\2713"; position: absolute; color: #fff; font-size: 13px; }

/* Bulunulan adım: dolu vurgu rengi (tamamlanmış olsa da) */
html body.opx .opx-progress button.is-active {
  color: #fff;
  border-color: var(--opx-accent);
  background: var(--opx-accent);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--opx-accent) 35%, transparent);
}

.opx-progress button.is-active b { background: #fff; color: var(--opx-accent); }
.opx-progress button.is-active.is-done b { color: transparent; }
.opx-progress button.is-active.is-done b::after { color: var(--opx-accent); }

@media (prefers-reduced-motion: reduce) {
  .opx-summary__chev { transition: none; }
}

/* ======== Tasarım: Sade Çizgi ======== */
html body.site-shell-app.opx.opx--minimal .order-form .form-control,
html body.site-shell-app.opx.opx--minimal .order-form .opui-variant-select {
  border: 0 !important;
  border-bottom: 2px solid var(--opx-line) !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  padding-left: 2px !important;
}

html body.site-shell-app.opx.opx--minimal .order-form .form-control:focus,
html body.site-shell-app.opx.opx--minimal .order-form .opui-variant-select:focus {
  border-bottom-color: var(--opx-accent) !important;
  box-shadow: 0 1px 0 var(--opx-accent) !important;
}

html body.site-shell-app.opx.opx--minimal .order-form .form-control.field-warn { border-bottom-color: #ef4444 !important; background-color: #fef2f2 !important; }

html body.site-shell-app.opx.opx--minimal .order-form .opx-head {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--opx-line);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

html body.site-shell-app.opx.opx--minimal .order-page-shell .order-form .order-form__title { font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; }
html body.opx--minimal .opx-summary { background: #fff; border-bottom: 1px solid var(--opx-line); }
html body.opx--minimal .opx-pay { border-width: 1px 0; border-radius: 0; }
html body.site-shell-app.opx.opx--minimal .order-form .order-form__submit { border-radius: 0; letter-spacing: 0.14em; text-transform: uppercase; font-size: 17px; }
html body.opx.opx--minimal .opx-bar__btn { border-radius: 0; text-transform: uppercase; letter-spacing: 0.08em; }
html body.opx--minimal .order-page-shell .full-width-section.order-form { box-shadow: none; border-color: transparent; }

/* ======== Tasarım: Yumuşak ======== */
html body.site-shell-app.opx.opx--soft .order-form .form-control,
html body.site-shell-app.opx.opx--soft .order-form .opui-variant-select {
  border: 2px solid transparent !important;
  border-radius: 16px !important;
  background-color: #f1f2f6 !important;
}

html body.site-shell-app.opx.opx--soft .order-form .form-control:focus,
html body.site-shell-app.opx.opx--soft .order-form .opui-variant-select:focus {
  border-color: var(--opx-accent) !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--opx-accent) 16%, transparent) !important;
}

html body.site-shell-app.opx.opx--soft .order-form .form-control.field-warn { border-color: #ef4444 !important; background-color: #fef2f2 !important; }
html body.site-shell-app.opx.opx--soft .order-form .opx-head { padding-left: 12px; border-left: 5px solid var(--opx-accent); }
html body.opx--soft .opx-summary { margin: 8px 4px; border: 0; border-radius: 18px; }
@media (max-width: 360px) { html body.opx--soft .opx-summary__toggle { padding-left: 12px; padding-right: 12px; font-size: 14px; } }
html body.opx--soft .opx-summary.is-open { border: 2px solid var(--opx-accent); }
html body.opx--soft .opx-pay:not([hidden]) { display: grid; gap: 8px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
html body.opx--soft .opx-pay__item { border: 2px solid var(--opx-line); border-radius: 16px; }
html body.opx--soft .opx-pay__item + .opx-pay__item { border-top: 2px solid var(--opx-line); }
html body.opx--soft .order-form label.opx-pay__item.is-on { border-color: var(--opx-accent); box-shadow: none; }
html body.site-shell-app.opx.opx--soft .order-form .kurumsal-fatura-details { border-radius: 16px; }

html body.site-shell-app.opx.opx--soft .order-form .order-form__submit {
  border-radius: 999px;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--opx-accent) 34%, transparent);
}

html body.opx--soft .opx-bar { border-radius: 22px 22px 0 0; }
html body.opx.opx--soft .opx-bar__btn { border-radius: 999px; }

/* ======== Tasarım: Premium ======== */
body.opx.opx--premium {
  --opx-accent: #85682a;
  --opx-line: #ddd5c3;
  --opx-soft: #faf8f3;
  --opx-tint: #faf4e4;
}

html body.opx--premium .opx-summary { background: #121212; border-bottom: 3px solid #c9a24a; }
html body.opx--premium .opx-summary.is-open { border: 2px solid #c9a24a; background: #121212; }
html body.opx.opx--premium .opx-summary__toggle,
html body.opx--premium .opx-summary__item > div,
html body.opx--premium .opx-summary__total { color: #f5e6c4; }
html body.opx--premium .opx-summary__label { color: #d9b86a; }
html body.opx--premium .opx-summary__item small { color: #bcae8c; }
html body.opx--premium .opx-summary__body,
html body.opx--premium .opx-summary__total { border-color: rgba(201, 162, 74, 0.35); }

html body.site-shell-app.opx.opx--premium .order-form .form-control,
html body.site-shell-app.opx.opx--premium .order-form .opui-variant-select { border-radius: 4px !important; }

html body.site-shell-app.opx.opx--premium .order-form .opx-head,
html body.site-shell-app.opx.opx--premium .order-page-shell .order-form .order-form__title {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  letter-spacing: 0.03em;
}

html body.site-shell-app.opx.opx--premium .order-form .opx-head::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin-top: 7px;
  background: #c9a24a;
}

html body.opx--premium .opx-pay { border-radius: 4px; }

html body.site-shell-app.opx.opx--premium .order-form .order-form__submit,
html body.opx.opx--premium .opx-bar__btn {
  background: #121212;
  color: #ecd490;
  border: 1px solid #c9a24a;
  border-radius: 4px;
  letter-spacing: 0.08em;
}

html body.site-shell-app.opx.opx--premium .order-form .order-form__submit:hover { background: #26221a; }
