/* ==========================================================================
   Tek sayfa hızlı ödeme (checkout/express.twig)
   Yalnız ödeme sayfasında yüklenir. Renkler halis-tema.css token'larından
   gelir (--hs-brand vb.), böylece ginut / halisfindik kendi rengini alır.
   ========================================================================== */

#checkout-express {
  --cx-brand:   var(--hs-brand, #5b832e);
  --cx-brand-h: var(--hs-brand-hover, #4d6f27);
  --cx-btn:     var(--hs-brand-btn, var(--cx-brand));   /* beyaz yazılı yüzey; turuncu temada koyu ton */
  --cx-soft:    var(--hs-brand-soft, #f1f4ed);
  --cx-ring:    var(--hs-brand-ring, rgba(91,131,46,.28));
  --cx-text:    #1b2733;
  --cx-muted:   #5f6b7a;
  --cx-border:  #dfe3e8;
  --cx-border-s:#c6cdd5;
  --cx-bg:      #f5f6f8;
  --cx-danger:  #c0392b;
  --cx-radius:  12px;

  color: var(--cx-text);
  max-width: 980px;
  padding-top: .5rem;
  padding-bottom: 2rem;
}

/* Dikkat dağıtmayan ödeme: arama, menü, üst şerit ve mini sepet gizli. */
body:has(#checkout-express) #top,
body:has(#checkout-express) #menu,
body:has(#checkout-express) header .col-md-5,
body:has(#checkout-express) #cart { display: none !important; }
body:has(#checkout-express) header { padding: .75rem 0 0; }
body:has(#checkout-express) header #logo img { max-height: 56px; width: auto; }

/* ---------- Üst çubuk ---------- */
.cx-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .75rem;
  font-size: .85rem;
}
.cx-bar svg { width: 16px; height: 16px; }
.cx-back { display: inline-flex; align-items: center; gap: .25rem; color: var(--cx-muted); text-decoration: none; }
.cx-back:hover { color: var(--cx-text); }
.cx-secure { display: inline-flex; align-items: center; gap: .35rem; color: var(--cx-brand-h); font-weight: 600; }

/* ---------- Yerleşim ---------- */
.cx-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; align-items: start; }
.cx-main { min-width: 0; }
.cx-side { min-width: 0; }

/* Mobil: özet üstte (katlı), form, güven notları en altta. */
@media (max-width: 991.98px) {
  .cx-side { display: contents; }
  .cx-summary { order: 1; }
  .cx-main { order: 2; }
  .cx-trust { order: 3; margin-top: 0; }
}

@media (min-width: 992px) {
  .cx-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; }
  .cx-main { order: 1; }
  .cx-side { order: 2; position: sticky; top: 1rem; }
}

.cx-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: .75rem; }
.cx-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.cx-login { color: var(--cx-muted); font-size: .82rem; margin: 0; }
.cx-login a { color: var(--cx-brand-h); font-weight: 600; }

/* ---------- Bölümler ---------- */
.cx-section {
  background: #fff;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
  padding: 1rem 1rem .35rem;
  margin-bottom: .75rem;
}
.cx-h {
  display: flex; align-items: center; gap: .6rem;
  font-size: .95rem; font-weight: 700; letter-spacing: -.01em;
  margin: 0 0 .75rem;
}
.cx-step {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--cx-btn); color: #fff;
  font-size: .7rem; font-weight: 700;
}
.cx-hint { color: var(--cx-muted); font-size: .8rem; margin: -.25rem 0 0; }

.cx-row { display: grid; grid-template-columns: 1fr; gap: 0 .75rem; }
.cx-row[hidden] { display: none; }
@media (min-width: 576px) { .cx-row { grid-template-columns: 1fr 1fr; } }
.cx-cardrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.cx-cardrow .cx-f-num { grid-column: 1 / -1; }
@media (min-width: 576px) {
  .cx-cardrow { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .8fr); }
  .cx-cardrow .cx-f-num { grid-column: auto; }
}

/* ---------- Alanlar ---------- */
.cx-field { margin-bottom: .65rem; min-width: 0; }
.cx-field[hidden] { display: none; }
.cx-field label { display: block; font-size: .76rem; font-weight: 600; margin-bottom: .2rem; color: var(--cx-text); }

#checkout-express input[type=text],
#checkout-express input[type=email],
#checkout-express input[type=tel],
#checkout-express select,
#checkout-express textarea {
  display: block; width: 100%;
  min-height: 40px;
  padding: .45rem .7rem;
  font-size: 16px;            /* iOS odakta yakınlaştırmasın */
  line-height: 1.3;
  color: var(--cx-text);
  background: #fff;
  border: 1px solid var(--cx-border-s);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
#checkout-express select {
  padding-right: 2.25rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%235f6b7a'%3E%3Cpath d='M5.2 7.2a.75.75 0 0 1 1.06 0L10 10.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.2 8.28a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E") no-repeat right .7rem center / 18px;
}
#checkout-express textarea { resize: vertical; min-height: 58px; }
@media (min-width: 992px) {
  #checkout-express input[type=text], #checkout-express input[type=email], #checkout-express input[type=tel],
  #checkout-express select, #checkout-express textarea { font-size: 15px; }
}
#checkout-express input::placeholder,
#checkout-express textarea::placeholder { color: #9aa4b0; }
#checkout-express input:focus,
#checkout-express select:focus,
#checkout-express textarea:focus {
  outline: none;
  border-color: var(--cx-brand);
  box-shadow: 0 0 0 3px var(--cx-ring);
}
#checkout-express .is-invalid { border-color: var(--cx-danger) !important; }
#checkout-express .is-invalid:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.2); }

.cx-error { display: none; color: var(--cx-danger); font-size: .8rem; margin-top: .3rem; }
.cx-error.is-on { display: block; }

.cx-check {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .85rem; cursor: pointer; margin: 0;
}
.cx-check input {
  flex: none; width: 18px; height: 18px; margin-top: 1px;
  accent-color: var(--cx-brand);
}

/* ---------- Kargo ---------- */
.cx-ship {
  display: flex; align-items: center; gap: .65rem;
  padding: .85rem 1rem;
  border: 1.5px solid var(--cx-brand);
  background: var(--cx-soft);
  border-radius: 10px;
}
.cx-ship svg { width: 20px; height: 20px; color: var(--cx-brand); flex: none; }
.cx-ship-name { flex: 1; font-size: .92rem; }
.cx-ship-price { font-size: .95rem; }

/* ---------- Ödeme ---------- */
.cx-methods { display: grid; gap: .6rem; }
.cx-method {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .8rem;
  border: 1.5px solid var(--cx-border-s);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600; font-size: .9rem;
}
.cx-method input { width: 18px; height: 18px; accent-color: var(--cx-brand); flex: none; }
.cx-method:has(input:checked) { border-color: var(--cx-brand); background: var(--cx-soft); }
.cx-method-name { flex: 1; }
/* Tek yöntem varken radyo gereksiz; başlık gibi görünür. */
.cx-methods.is-single .cx-method input { display: none; }

.cx-brands { display: inline-flex; gap: .3rem; }
.cx-brands img { width: 36px; height: 24px; }
.cx-brand {
  font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .04em;
  padding: .2rem .35rem; border-radius: 4px;
  background: #fff; border: 1px solid var(--cx-border); color: var(--cx-muted);
}

.cx-card { padding: .75rem 0 0; }
.cx-card[hidden] { display: none; }
.cx-cardnum { position: relative; }
.cx-cardnum input { padding-right: 4.5rem !important; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.cx-brand {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity .15s;
}
.cx-brand.is-visa, .cx-brand.is-mc, .cx-brand.is-troy, .cx-brand.is-amex { opacity: 1; }
.cx-brand.is-visa { color: #1a1f71; border-color: #c9cbe3; }
.cx-brand.is-mc   { color: #c2410c; border-color: #f2c7b0; }
.cx-brand.is-troy { color: #0b7a75; border-color: #b6dedb; }
.cx-test {
  font-size: .8rem; color: #8a5a00; background: #fff6e0;
  border: 1px solid #f3dca4; border-radius: 8px;
  padding: .3rem .6rem; margin: 0 0 .65rem;
}
.cx-empty { color: var(--cx-danger); margin: 0; }
#cx-external { margin-top: 1rem; }

/* ---------- Not / sözleşme / öde ---------- */
.cx-note { margin: 0 0 .6rem; }
.cx-note summary {
  cursor: pointer; color: var(--cx-brand-h); font-weight: 600; font-size: .9rem;
  list-style: none; display: inline-flex; align-items: center; gap: .35rem;
}
.cx-note summary::-webkit-details-marker { display: none; }
.cx-note summary::before { content: '+'; font-size: 1.1rem; line-height: 1; }
.cx-note[open] summary::before { content: '−'; }
.cx-note textarea { margin-top: .6rem; }

.cx-agree { padding: .6rem .8rem; border: 1px solid var(--cx-border); border-radius: 8px; background: #fff; margin-bottom: .25rem; }
.cx-agree.is-invalid { border-color: var(--cx-danger); background: #fdf3f2; }
.cx-agree a { color: var(--cx-brand-h); font-weight: 600; }
#error-agree { margin: 0 0 .5rem; }

.cx-pay {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; min-height: 50px; margin-top: .6rem;
  border: 0; border-radius: 10px;
  background: var(--cx-btn); color: #fff;
  font-size: 1.02rem; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 6px 16px -6px var(--cx-ring);
  transition: background .15s, transform .1s;
}
.cx-pay svg { width: 18px; height: 18px; }
.cx-pay:hover:not(:disabled) { background: var(--cx-brand-h); }
.cx-pay:active:not(:disabled) { transform: scale(.99); }
.cx-pay:disabled { opacity: .6; cursor: not-allowed; }
.cx-pay.is-busy { opacity: .85; cursor: progress; }
.cx-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: cx-spin .7s linear infinite;
}
@keyframes cx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cx-spinner { animation-duration: 2s; } }

.cx-3d { text-align: center; color: var(--cx-muted); font-size: .75rem; margin: .45rem 0 0; }
.cx-classic { text-align: center; font-size: .72rem; margin: .6rem 0 0; }
.cx-classic a { color: var(--cx-muted); }

.cx-alert {
  background: #fdf3f2; border: 1px solid #f1c4bf; color: #8e2a1f;
  border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem;
}

/* ---------- Özet ---------- */
.cx-summary {
  background: #fff;
  border: 1px solid var(--cx-border);
  border-radius: var(--cx-radius);
}
.cx-summary > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; cursor: pointer; list-style: none;
}
.cx-summary > summary::-webkit-details-marker { display: none; }
.cx-summary-label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--cx-brand-h); }
.cx-summary-label svg { width: 18px; height: 18px; }
.cx-chev { transition: transform .2s; }
.cx-summary[open] .cx-chev { transform: rotate(180deg); }
.cx-summary-total { font-size: 1.1rem; }
@media (min-width: 992px) {
  .cx-summary > summary { pointer-events: none; }
  .cx-chev, .cx-summary-total { display: none; }
  .cx-summary-label { color: var(--cx-text); font-size: 1.05rem; }
}
.cx-summary-body { padding: 0 1rem 1rem; }

.cx-lines { list-style: none; margin: 0; padding: 0; }
.cx-line { display: grid; grid-template-columns: 44px 1fr auto; gap: .65rem; align-items: center; padding: .4rem 0; }
.cx-line-img { position: relative; width: 44px; height: 44px; }
.cx-line-img img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--cx-border); }
.cx-line-qty {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--cx-muted); color: #fff; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center;
}
.cx-line-name { font-size: .82rem; line-height: 1.3; min-width: 0; }
.cx-line-name a { color: inherit; text-decoration: none; }
.cx-line-name small { display: block; color: var(--cx-muted); }
.cx-line-total { font-size: .9rem; font-weight: 600; white-space: nowrap; }

.cx-totals { margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid var(--cx-border); }
.cx-total { display: flex; justify-content: space-between; font-size: .82rem; color: var(--cx-muted); padding: .12rem 0; }
.cx-total dt { font-weight: 400; }
.cx-total dd { margin: 0; color: var(--cx-text); }
.cx-total.is-grand { margin-top: .4rem; padding-top: .5rem; border-top: 1px solid var(--cx-border); font-size: 1rem; color: var(--cx-text); }
.cx-total.is-grand dt, .cx-total.is-grand dd { font-weight: 700; }

.cx-freeship { margin-top: .6rem; font-size: .78rem; color: var(--cx-brand-h); }
.cx-freeship-bar { display: block; height: 6px; margin-top: .4rem; background: #e7ebe1; border-radius: 3px; overflow: hidden; }
.cx-freeship-bar i { display: block; height: 100%; background: var(--cx-brand); border-radius: 3px; }

.cx-trust { list-style: none; margin: .75rem 0 0; padding: 0 .25rem; display: grid; gap: .4rem; }
.cx-trust li { display: flex; gap: .5rem; font-size: .75rem; color: var(--cx-muted); }
.cx-trust svg { width: 16px; height: 16px; flex: none; color: var(--cx-brand); margin-top: 1px; }

/* ---------- Mobil yapışkan öde çubuğu ---------- */
.cx-sticky { display: none; }
@media (max-width: 991.98px) {
  .cx-sticky {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; align-items: center; gap: 1rem;
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--cx-border);
    box-shadow: 0 -6px 20px rgba(16,24,40,.08);
    transform: translateY(110%); transition: transform .2s ease;
  }
  .cx-sticky.is-on { transform: none; }
  .cx-sticky-total { display: flex; flex-direction: column; line-height: 1.15; }
  .cx-sticky-total small { color: var(--cx-muted); font-size: .72rem; }
  .cx-sticky-total strong { font-size: 1.1rem; }
  .cx-pay-sm { margin: 0; min-height: 48px; flex: 1; font-size: 1rem; }
  #checkout-express { padding-bottom: 6rem; }
  .cx-section { padding: .85rem .85rem .25rem; }
  .cx-title { font-size: 1.2rem; }
}


/* ---------- Sıkı yerleşim yardımcıları ---------- */
.cx-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: .1rem 0 .65rem; }
.cx-options[hidden], .cx-link[hidden] { display: none; }
.cx-link { background: none; border: 0; padding: 0; color: var(--cx-brand-h); font-size: .8rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cx-shipline { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0; font-size: .82rem; color: var(--cx-muted); }
.cx-shipline svg { width: 16px; height: 16px; color: var(--cx-brand); flex: none; }
.cx-shipline span { flex: 1; }
.cx-shipline strong { color: var(--cx-text); }
/* Tek ödeme yöntemi: seçim kutusu yerine başlık altında ince bir satır. */
.cx-methods.is-single .cx-method,
.cx-methods.is-single .cx-method:has(input:checked) { padding: 0; border: 0; background: none; font-size: .85rem; color: var(--cx-muted); }
.cx-methods.is-single .cx-card { padding-top: .55rem; }

/* Mobilde ad + soyad yan yana; e-posta ve telefon tam satır. */
.cx-row.cx-contact { grid-template-columns: 1fr 1fr; }
@media (max-width: 575.98px) { .cx-contact .cx-wide { grid-column: 1 / -1; } }
