/* Ana sayfa "Teklif iste" sihirbazı (js/teklif-sihirbazi.js): ilk ekrandaki düğme ve soruların açıldığı pencere.
   Belirteçler css/ana-sayfa.css içindeki --ah-* değerleridir; düğmeler css/style.css "Düğme sistemi"nden gelir.
   Görünüm ürün sayfalarındaki "Sizi tanıyalım" sihirbazıyla aynı dildedir (css/urun-fiyat.css, "Sihirbaz"). */

/* ---------- İlk ekran düğmesi ---------- */
.ah-hero-actions { justify-content: center; margin-top: 36px; }

/* ---------- Pencere ---------- */
html.tw-lock { overflow: hidden; }
.tw {
  box-sizing: border-box;
  width: min(680px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--ah-line, #e3e3de);
  border-radius: 28px;
  background: var(--ah-white, #ffffff);
  color: var(--ah-ink, #0b1120);
  font-family: var(--font-sans, inherit);
  overflow: hidden;
}
.tw::backdrop {
  background: rgba(11, 17, 32, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tw[open] { animation: tw-in 220ms var(--ah-ease, ease) both; }
@keyframes tw-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tw[open] { animation: none; } }

.tw-panel {
  position: relative;
  max-height: calc(100dvh - 50px);
  padding: 48px 40px 36px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tw-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ah-ink-2, #5d626c);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 160ms var(--ah-ease, ease), color 160ms var(--ah-ease, ease);
}
.tw-close:hover { background: var(--ah-paper, #f7f7f5); color: var(--ah-ink, #0b1120); }
.tw-close:focus-visible,
.tw-option:focus-visible { outline: 2px solid var(--ah-ink, #0b1120); outline-offset: 3px; }

/* ---------- Adımlar ---------- */
.tw-progress { display: flex; gap: 6px; margin: 0 0 28px; }
.tw-dot { flex: 0 0 36px; height: 2px; border-radius: 2px; background: var(--ah-line, #e3e3de); transition: background-color 160ms var(--ah-ease, ease); }
.tw-dot.is-done { background: var(--ah-ink, #0b1120); }
.tw-dot.is-active { background: var(--ah-accent, #fc6800); }

.tw-question {
  margin: 0 0 12px;
  padding-right: 36px;
  color: var(--ah-ink, #0b1120);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.tw-question:focus { outline: none; }
.tw-intro { margin: 0 0 28px; color: var(--ah-ink-2, #5d626c); font-size: 17px; line-height: 1.5; }
.tw-other-note {
  margin: -8px 0 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ah-peach, #fff0e5);
  color: var(--ah-ink, #0b1120);
  font-size: 15px;
  line-height: 1.5;
}

.tw-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tw-option {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px solid var(--ah-line, #e3e3de);
  border-radius: 14px;
  background: var(--ah-paper, #f7f7f5);
  color: var(--ah-ink, #0b1120);
  font: 500 17px/1.25 var(--font-sans, inherit);
  letter-spacing: -.015em;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms var(--ah-ease, ease), background-color 160ms var(--ah-ease, ease), transform 100ms var(--ah-ease, ease);
}
.tw-option:hover { border-color: var(--ah-ink, #0b1120); }
.tw-option:active { transform: scale(.985); }
.tw-option.is-selected { background: var(--ah-peach, #fff0e5); border-color: var(--ah-accent, #fc6800); }
/* Tek sütunlu sorularda (evet/hayır, 1-2-3 kişi) seçenekler kısa kalır. */
.tw-options:has(.tw-option:nth-child(-n+4):last-child) { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.tw-nav { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.tw-nav .tw-next, .tw-nav .tw-go { margin-left: auto; }
.tw-nav .tw-back { min-width: 112px; }

/* ---------- Sonuç ---------- */
.tw-summary {
  margin-top: 20px;
  padding: 28px;
  border: 1px solid var(--ah-line, #e3e3de);
  border-radius: 20px;
  background: var(--ah-paper, #f7f7f5);
}
.tw-summary-title { font-size: 17px; color: var(--ah-ink-2, #5d626c); letter-spacing: -.01em; margin-bottom: 0; }
.tw-label { margin: 0 0 4px; color: var(--ah-ink-2, #5d626c); font-size: 13px; line-height: 1.4; }
.tw-product { margin: 0 0 16px; color: var(--ah-ink, #0b1120); font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.tw-pkg { margin: 0 0 8px; color: var(--ah-ink, #0b1120); font-size: 40px; font-weight: 500; line-height: 1.1; letter-spacing: -.04em; }
.tw-facts { margin: 0 0 16px; color: var(--ah-ink-2, #5d626c); font-size: 17px; line-height: 1.5; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.tw-chip {
  padding: 8px 14px;
  border: 1px solid var(--ah-line, #e3e3de);
  border-radius: 999px;
  background: var(--ah-white, #ffffff);
  color: var(--ah-ink, #0b1120);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.tw-note { margin: 0; color: var(--ah-ink-2, #5d626c); font-size: 15px; line-height: 1.5; }
.tw-unmet { margin-bottom: 10px; color: var(--ah-ink, #0b1120); }
.tw-restart-wrap { margin: 12px 0 0; }

/* ---------- Dar ekran: pencere tam ekran olur ---------- */
@media (max-width: 640px) {
  .tw {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .tw-panel { max-height: 100dvh; height: 100%; padding: 64px 20px 28px; }
  .tw-question { font-size: 24px; }
  .tw-options { grid-template-columns: 1fr; }
  .tw-options-type { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tw-options-type .tw-option { padding: 12px 14px; font-size: 16px; }
  .tw-options:has(.tw-option:nth-child(-n+4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tw-summary { padding: 22px 18px; }
  .tw-pkg { font-size: 32px; }
  .tw-nav { flex-wrap: wrap-reverse; }
  .tw-nav .tw-next, .tw-nav .tw-go { flex: 1 1 100%; margin-left: 0; }
  .tw-nav .tw-back { flex: 1 1 100%; }
  .ah-hero-actions { margin-top: 28px; }
  .ah-hero-actions .ah-btn { flex: 0 1 auto; }
}
