/* v3-kitap — 09.11.2026 (25 öğrenci ajanı denetimi özellikleri). EN SON yüklenir; ana dosyalara dokunmaz. */

/* ── Kitaplar kartı: tıklanabilir + klavye odağı görünür ── */
#fullUrunGrid .v3-func-card[data-urun-id] { cursor: pointer; }
#fullUrunGrid .v3-func-card[data-urun-id]:focus { outline: none; }
#fullUrunGrid .v3-func-card[data-urun-id]:focus-visible {
  outline: 3px solid #7c3aed !important;
  outline-offset: 3px;
  border-color: #c4b5fd !important;
}

/* ── Arka plan kilidi (pencere açıkken sayfa kaymasın) ── */
html.v3k-kilit, html.v3k-kilit body { overflow: hidden !important; }

/* ── Örtü + pencere ── */
.v3k-ortu {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0);
  transition: background-color .2s ease;
  overscroll-behavior: contain;
}
.v3k-ortu[hidden] { display: none !important; }
.v3k-ortu.acik { background: rgba(15, 23, 42, .58); }

.v3k-pencere {
  position: relative;
  width: min(880px, 100%);
  max-height: min(88vh, 820px);
  display: flex; flex-direction: column;
  background: #ffffff;
  color: #0f172a;
  border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06);
  overflow: hidden;
  opacity: 0; transform: translateY(12px) scale(.985);
  transition: opacity .2s ease, transform .24s cubic-bezier(.16, 1, .3, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: left;
}
.v3k-ortu.acik .v3k-pencere { opacity: 1; transform: none; }
.v3k-pencere:focus { outline: none; }

.v3k-ust {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 22px;
  border-bottom: 1px solid #eef2f7;
  background: #ffffff;
}
.v3k-ust-etiket {
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6d28d9;
}
.v3k-kapat {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0 !important; border-radius: 14px !important;
  background: #f8fafc !important; color: #334155 !important;
  cursor: pointer; padding: 0 !important; margin: 0;
  transition: background-color .15s ease, color .15s ease;
}
.v3k-kapat:hover { background: #f1f5f9 !important; color: #0f172a !important; }
.v3k-kapat:focus-visible, .v3k-btn:focus-visible, .v3k-devam:focus-visible {
  outline: 3px solid #7c3aed !important; outline-offset: 2px;
}

.v3k-govde {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px 26px 26px;
}

/* Özet: kapak + bilgiler */
.v3k-ozet {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start;
}
.v3k-kapak {
  height: 330px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #eef2f7;
  border-radius: 18px;
  overflow: hidden;
}
.v3k-kapak img {
  max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 14px 22px rgba(15, 23, 42, .18));
}
.v3k-kapak .cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 18px; border-radius: 12px;
  color: #ffffff; background: linear-gradient(145deg, #6b2cbf, #4b168c 70%, #32204b);
}
.v3k-kapak .cover-fallback span { font-size: 16px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }

.v3k-bilgi { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.v3k-rozetler { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.v3k-rozet {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; line-height: 1.2;
  padding: 6px 10px; border-radius: 999px;
  background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0;
  max-width: 100%; overflow-wrap: anywhere;
}
.v3k-rozet.sinav { background: #f3e8ff; color: #5b21b6; border-color: #e9d5ff; }
.v3k-rozet.tur { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.v3k-rozet.yil { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.v3k-baslik {
  margin: 0 !important;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
  font-size: clamp(19px, 2.2vw, 24px) !important; line-height: 1.3 !important; font-weight: 800 !important;
  letter-spacing: -.01em; color: #0f172a !important;
  overflow-wrap: anywhere; text-wrap: pretty;
}

.v3k-kunye { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.v3k-kunye > div {
  min-width: 0; padding: 10px 12px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px;
}
.v3k-kunye dt { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.v3k-kunye dd { margin: 0; font-size: 14px; font-weight: 700; color: #0f172a; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.v3k-fiyat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.v3k-fiyat-satis { font-size: 26px; font-weight: 800; color: #047857; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.v3k-fiyat-liste { font-size: 15px; color: #64748b; font-variant-numeric: tabular-nums; }
.v3k-fiyat-oran {
  font-size: 12.5px; font-weight: 800; color: #065f46;
  background: #d1fae5; border-radius: 999px; padding: 4px 10px;
}

.v3k-stok { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.v3k-stok.var { color: #047857; }
.v3k-stok.yok { color: #b45309; }
.v3k-stok-nokta { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: 0 0 9px; }

.v3k-eylemler { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.v3k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 11px 20px;
  border-radius: 14px !important;
  font-size: 14.5px; font-weight: 800; line-height: 1.2; text-decoration: none !important;
  cursor: pointer; border: 1px solid transparent;
  transition: filter .15s ease, background-color .15s ease, transform .15s ease;
}
.v3k-btn:active { transform: translateY(1px); }
.v3k-btn.birincil { background: linear-gradient(135deg, #059669, #047857) !important; color: #ffffff !important; }
.v3k-btn.birincil:hover { filter: brightness(1.06); }
.v3k-btn.ikincil { background: #f5f3ff !important; color: #5b21b6 !important; border-color: #ddd6fe !important; }
.v3k-btn.ikincil:hover { background: #ede9fe !important; }

/* Açıklama */
.v3k-aciklama { margin-top: 24px; padding-top: 20px; border-top: 1px solid #eef2f7; }
.v3k-aciklama h3 {
  margin: 0 0 10px !important;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
  font-size: 16px !important; font-weight: 800 !important; color: #0f172a !important;
}
.v3k-aciklama-metin {
  margin: 0; font-size: 14.5px; line-height: 1.7; color: #334155;
  max-width: 72ch; overflow-wrap: anywhere;
}
.v3k-aciklama-metin.kisa {
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.v3k-devam {
  margin-top: 8px; min-height: 44px; padding: 8px 14px !important;
  background: transparent !important; border: 1px solid #ddd6fe !important; border-radius: 12px !important;
  color: #5b21b6 !important; font-size: 14px; font-weight: 800; cursor: pointer;
}
.v3k-devam[hidden] { display: none !important; }
.v3k-devam:hover { background: #f5f3ff !important; }
.v3k-not { margin: 10px 0 0; font-size: 12.5px; color: #64748b; }

/* Yükleniyor / hata */
.v3k-yukleniyor { display: flex; align-items: center; gap: 12px; padding: 28px 0 8px; color: #475569; font-size: 14px; font-weight: 600; }
.v3k-donen {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid #e9d5ff; border-top-color: #7c3aed;
  animation: v3kDon .8s linear infinite;
}
@keyframes v3kDon { to { transform: rotate(360deg); } }
.v3k-hata { padding: 22px 0 4px; color: #b91c1c; font-size: 14px; font-weight: 600; }
.v3k-hata p { margin: 0 0 12px; }

.v3k-gizli {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ── Tablet ── */
@media (max-width: 860px) {
  .v3k-ozet { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  .v3k-kapak { height: 270px; }
}

/* ── Mobil: tam genişlikte alt sayfa (bottom sheet) ── */
@media (max-width: 640px) {
  .v3k-ortu { align-items: flex-end; padding: 0; }
  .v3k-pencere {
    width: 100%;
    max-height: calc(100vh - 10px);
    max-height: calc(100dvh - 10px);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    transition: opacity .2s ease, transform .3s cubic-bezier(.32, .72, 0, 1);
  }
  .v3k-ortu.acik .v3k-pencere { transform: none; }
  .v3k-ust { padding: 8px 8px 8px 18px; }
  .v3k-govde { padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .v3k-ozet { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .v3k-kapak { height: 240px; }
  .v3k-kunye { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .v3k-fiyat-satis { font-size: 24px; }
  .v3k-eylemler { flex-direction: column; }
  .v3k-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .v3k-ortu, .v3k-pencere { transition: none !important; }
  .v3k-donen { animation-duration: 2s; }
}
