/* YARDIMCI KUTUSU — arama + sohbet.
   stil.css'e KONMADI: bayrakla kapatılabilsin ve kapalıyken hiçbir
   ziyaretçiye inmesin (CLAUDE.md: ölü kural her ziyaretçiye iniyor).
   Yükleyen bileşen src/components/Sohbet.astro. */

/* ── AÇMA DÜĞMESİ ────────────────────────────────────────────────────────
   Jenerik sohbet balonu ikonu kaldırıldı (2026-11-08): yerine sitenin kendi
   işareti, rozetlerdeki turuncu nokta. Zemin ürünün KENDİ gradyanı
   (--urun / --urun-koyu, Temel.astro'nun bastığı değişkenler), yani düğme
   bulunduğu sayfanın ürününe ait görünüyor.
   Gölge iki katmanlı: yakın ve sıkı olan oturtuyor, uzak ve yumuşak olan
   kaldırıyor. Üstteki iç çizgi ışığın geldiği kenarı tarif ediyor. */
.yd-ac {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 19px 12px 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 14.5px/1 Poppins, inherit; letter-spacing: -.01em; color: #fff;
  background: linear-gradient(145deg, var(--urun, #073a80), var(--urun-koyu, #052c65));
  box-shadow:
    0 1px 2px rgba(6, 22, 48, .22),
    0 10px 28px -8px rgba(6, 22, 48, .55),
    inset 0 1px 0 rgba(255, 255, 255, .16);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s ease;
}
.yd-ac:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(6, 22, 48, .22),
    0 16px 34px -10px rgba(6, 22, 48, .6),
    inset 0 1px 0 rgba(255, 255, 255, .2);
}
.yd-ac:active { transform: translateY(0) }
.yd-ac:focus-visible { outline: 2px solid var(--turuncu, #e96a33); outline-offset: 3px }

/* Marka işareti: `.rozet i` ile aynı nokta. Halka, koyu zeminde noktanın
   kaybolmasını engelliyor. */
.yd-nokta {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--turuncu, #e96a33);
  box-shadow: 0 0 0 3px rgba(233, 106, 51, .22);
}

/* ── DAVET KARTI ─────────────────────────────────────────────────────────
   Kullanıcının paylaştığı widget formatı: renkli başlık + avatar + durum,
   altında beyaz mesaj balonu. Başlık ürünün gradyanını taşıyor. */
.yd-davet {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: min(336px, calc(100vw - 32px));
  border-radius: 16px; overflow: hidden; background: #fff;
  box-shadow: 0 2px 6px rgba(6, 22, 48, .14), 0 22px 48px -14px rgba(6, 22, 48, .45);
}
.yd-davet-bas {
  display: flex; align-items: center; gap: 11px; padding: 15px 44px 15px 16px;
  background: linear-gradient(145deg, var(--urun, #073a80), var(--urun-koyu, #052c65));
  color: #fff;
}
.yd-davet-bas b { display: block; font: 650 14.5px/1.25 Poppins, inherit; letter-spacing: -.01em }
.yd-av {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  font: 700 16px/1 Poppins, inherit;
}
/* Durum satırı: beyaz değil, zeminin kendi tonundan açılmış — düz gri ya da
   tam beyaz ikinci satır başlıkla aynı ağırlığa çıkıyor. */
.yd-durum { display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font: 500 11.5px/1 Poppins, inherit; color: rgba(255, 255, 255, .74) }
.yd-durum i { width: 6px; height: 6px; border-radius: 50%; background: var(--turuncu, #e96a33) }

.yd-davet-kapat {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 16px; line-height: 1;
}
.yd-davet-kapat:hover { background: rgba(255, 255, 255, .28) }
/* DOKUNMA ALANI GÖRÜNENDEN BÜYÜK. Daire 26 px ve öyle kalmalı — başlığın
   içinde 44 px'lik bir disk ağır durur. Görünmez bir yayılma parmağa 44 px
   veriyor; ölçümde 26 px çıkıp eşiğin altında kalmıştı (2026-11-08). */
.yd-davet-kapat::after { content: ''; position: absolute; inset: -9px; border-radius: 50% }

.yd-davet-govde {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 15px 16px 16px; border: 0; background: #fff; font: inherit;
}
.yd-davet-govde:hover { background: #fafbfe }
.yd-davet-mesaj { display: block; font: 400 13.5px/1.6 Poppins, inherit; color: #2c3a4f }
.yd-davet-cta { display: block; margin-top: 10px; font: 650 13.5px/1 Poppins, inherit;
  color: var(--urun, #073a80) }

/* Tek yetkili giriş hareketi: aşağıdan yükselip yerine oturuyor. Sayfadaki
   başka hiçbir şey hareket etmiyor, o yüzden göz buraya geliyor. */
@media (prefers-reduced-motion: no-preference) {
  .yd-davet { animation: yd-davet-gir .34s cubic-bezier(.16, 1, .3, 1) }
  @keyframes yd-davet-gir { from { opacity: 0; transform: translateY(14px) scale(.97) } }
}

.yd-kutu[hidden], .yd-ac[hidden] { display: none }

.yd-kutu {
  position: fixed; right: 18px; bottom: 18px; z-index: 61;
  width: min(392px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 36px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #dfe5ef; border-radius: 16px;
  box-shadow: 0 18px 54px rgba(5, 25, 60, .25);
}

.yd-bas {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 12px; border-bottom: 1px solid #eef1f6;
}
.yd-bas h2 { margin: 0; font-size: 15.5px; font-weight: 700; color: #0d1b2f }
.yd-bas p { margin: 3px 0 0; font-size: 12.5px; color: #5b6778; line-height: 1.45 }
.yd-kapat {
  margin-left: auto; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: #f2f5fa; color: #4a5667;
  font-size: 17px; line-height: 1; cursor: pointer;
}
.yd-kapat:hover { background: #e7ecf5 }
.yd-kapat { position: relative }
.yd-kapat::after { content: ''; position: absolute; inset: -8px; border-radius: 10px }

.yd-govde { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px; min-height: 90px }

.yd-ust { font: 600 11px/1 inherit; letter-spacing: .07em; text-transform: uppercase;
  color: #7b8699; margin: 2px 0 8px }

.yd-liste { list-style: none; margin: 0 0 4px; padding: 0 }
.yd-liste li + li { margin-top: 2px }
.yd-liste a { display: block; padding: 8px 9px; border-radius: 9px; text-decoration: none; color: inherit }
.yd-liste a:hover, .yd-liste a:focus-visible { background: #f3f6fb }
.yd-liste b { display: block; font-size: 13.5px; font-weight: 600; color: #11284a; line-height: 1.35 }
.yd-liste small { display: block; margin-top: 2px; font-size: 11.5px; color: #70788a }

.yd-bos { margin: 6px 0; font-size: 13px; color: #6b7585 }

/* Konuşma baloncukları */
.yd-mesaj { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55 }
.yd-mesaj.yd-soru { white-space: pre-wrap }
.yd-mesaj.yd-soru {
  margin-left: auto; max-width: 84%; width: fit-content;
  padding: 8px 11px; border-radius: 12px 12px 3px 12px;
  background: var(--urun, #052c65); color: #fff;
}
.yd-mesaj.yd-cevap { color: #16263d }
/* Cevabın içindeki markdown: yalnız kalın ve madde tanınıyor (sohbet.js).
   Model `**Basic:** $19` ve `- madde` yazıyor; `pre-wrap` ile basıldığında
   yıldızlar ziyaretçiye görünüyordu. */
.yd-md-p { margin: 0 0 7px }
.yd-md-p:last-child { margin-bottom: 0 }
.yd-md { margin: 0 0 8px; padding-left: 17px }
.yd-md li { margin: 2px 0 }
.yd-mesaj.yd-cevap b { font-weight: 650; color: #0d1b2f }

.yd-kaynak { margin: -4px 0 12px; padding: 0; list-style: none; font-size: 12px }
.yd-kaynak li { display: inline-block; margin: 3px 6px 0 0 }
.yd-kaynak a { color: #2a5bb5; text-decoration: none; border-bottom: 1px solid #c9d8f2 }
.yd-kaynak a:hover { border-bottom-color: #2a5bb5 }

.yd-alt { border-top: 1px solid #eef1f6; padding: 10px 12px 11px }
.yd-form { display: flex; gap: 7px; align-items: center }
.yd-form input {
  flex: 1 1 auto; min-width: 0; padding: 9px 11px; font: inherit; font-size: 13.5px;
  border: 1px solid #d7dfeb; border-radius: 10px; background: #fbfcfe; color: #16263d;
}
.yd-form input:focus { outline: 2px solid var(--urun, #052c65); outline-offset: 1px; background: #fff }
.yd-form button {
  flex: none; padding: 9px 15px; border: 0; border-radius: 10px; cursor: pointer;
  font: 600 13.5px/1 inherit; color: #fff; background: var(--urun, #052c65);
}
.yd-form button:disabled { opacity: .45; cursor: default }
.yd-uyari { margin: 8px 2px 0; font-size: 11px; color: #8a93a4; line-height: 1.4 }

@media (prefers-reduced-motion: no-preference) {
  .yd-kutu { animation: yd-gir .16s ease-out }
  @keyframes yd-gir { from { opacity: 0; transform: translateY(8px) } }
}

/* TELEFON: kutu alttan tam genişlik. Masaüstündeki köşe kartı 390 px'te
   ekranın neredeyse tamamını kaplıyor ama kenar boşlukları yüzünden
   kırpılmış duruyor — dar ekranda kart değil sayfa gibi davranmalı. */
@media (max-width: 560px) {
  .yd-kutu {
    right: 0; left: 0; bottom: 0; width: auto;
    max-height: 82vh; border-radius: 16px 16px 0 0; border-bottom: 0;
  }
  /* 44 px dokunma hedefi (ölçüldü 2026-11-08): dolgu 11 → 14 px.
     Yazı boyutu aynı kalıyor. */
  .yd-ac { right: 12px; bottom: 12px; padding: 14px 18px 14px 15px; font-size: 14px }
  .yd-davet { right: 12px; left: 12px; bottom: 12px; width: auto }
}

/* ── DOĞRULAMA KUTUSU ──────────────────────────────────────────────────────
   Uç 10 sorudan sonra 428 dönüyor ve burada reCAPTCHA kutucuğu çiziliyor
   (2026-11-08, kullanıcı kararı: "10 soru sonra doğrulama istesin").

   ÖLÇÜSÜ SABİT VE 304 px: reCAPTCHA kutucuğu kendi iframe'ini o genişlikte
   çiziyor ve yardımcı kutusu telefonda daha dar olabiliyor. Ölçekleme
   (`transform: scale`) denenmedi — Google'ın kutucuğunu küçültmek
   tıklanabilirliği bozuyor ve dokunma hedefi kuralıyla çelişirdi. Onun
   yerine kendi çerçevemiz yana kaydırıyor; "panel görseli küçültülmez,
   kaydırılır" kalıbının aynısı (CLAUDE.md, "Telefon görünümü"). */
.yd-captcha {
  margin: 2px 0 10px;
  max-width: 100%;
  overflow-x: auto;
  /* Kaydırma çubuğu kutunun içinde kapansın, sayfayı kaydırmasın. */
  overscroll-behavior-x: contain;
}
.yd-captcha > div { min-width: 304px }
