/* OkumaPro V8.3.4.1 · iOS Safari/PWA + tüm modal mouse/touch scroll kararlılık katmanı */
:root{
  --okumapro-safe-bottom:env(safe-area-inset-bottom,0px);
  --okumapro-safe-top:env(safe-area-inset-top,0px);
  --okumapro-visual-vh:100dvh;
  --okumapro-modal-z:2055;
  --okumapro-backdrop-z:2050;
}

html{min-height:100%;max-width:100%;overflow-x:hidden;overflow-x:clip}
body.okumapro-sayfa{min-height:100dvh;max-width:100%;overflow-x:hidden;overflow-x:clip}

/* Katman sırası: sayfa < mobil nav/asistan < backdrop < modal. */
.modal-backdrop{z-index:var(--okumapro-backdrop-z)!important}
.modal{z-index:var(--okumapro-modal-z)!important;pointer-events:none}
.modal.show,.modal.showing{pointer-events:auto!important}
.modal .modal-dialog,.modal .modal-content{pointer-events:auto!important}
.modal button,.modal a,.modal input,.modal textarea,.modal select,.modal [role="button"]{pointer-events:auto!important;touch-action:manipulation}
.offcanvas-backdrop{z-index:2040!important}
.offcanvas{z-index:2045!important}

body.okumapro-overlay-acik .mobil-alt-navigasyon,
body.okumapro-overlay-acik .v8-ai-fab,
body.okumapro-menu-acik .mobil-alt-navigasyon,
body.okumapro-menu-acik .v8-ai-fab{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transform:translateY(18px)!important;
}
body.okumapro-overlay-acik .v8-ai-panel{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Normal sayfada doğal mouse, trackpad ve touch davranışı. */
body.okumapro-sayfa:not(.modal-open):not(.offcanvas-open):not(.splash-active){
  overflow-y:auto!important;
  overscroll-behavior-y:auto!important;
  touch-action:auto!important;
  -webkit-overflow-scrolling:touch;
}
body.modal-open,body.offcanvas-open{overflow:hidden!important}
html.okumapro-ios-overlay-lock,body.okumapro-ios-overlay-lock{overflow:hidden!important}
body.okumapro-ios-overlay-lock{overscroll-behavior:none!important}

/* Bütün Bootstrap modallarında tek ve öngörülebilir flex düzeni. */
.modal{overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important}
.modal .modal-dialog{min-width:0;pointer-events:auto!important}
.modal .modal-content{
  pointer-events:auto;
  min-height:0;
  max-height:calc(var(--okumapro-visual-vh,100dvh) - 2rem);
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.modal .modal-header,
.modal .modal-footer{flex:0 0 auto!important}
.modal .modal-body{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch;
}
.modal .modal-dialog-scrollable .modal-content{overflow:hidden!important}
.modal .modal-dialog-scrollable .modal-body{overflow-y:auto!important}

/* .modal-body bulunmayan eski/custom modal: tüm içerik tek kaydırma alanına dönüşür. */
.modal .modal-content.okumapro-modal-content-scroll{
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch;
}

/* Alt aksiyon alanı, özellikle mobilde tarayıcı/PWA çubuğunun arkasında kalmasın. */
.modal .modal-footer{
  position:relative!important;
  z-index:12!important;
  background:inherit;
  box-shadow:0 -8px 22px rgba(15,23,42,.07);
}

/* Yan menü kendi içinde kayar; Güvenli Çıkış her zaman erişilebilir kalır. */
.uygulama-yan-menu{max-height:var(--okumapro-visual-vh,100dvh)!important;overflow:hidden!important;overscroll-behavior:contain}
.yan-menu-baglantilari{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain!important;
  touch-action:pan-y!important;
  -webkit-overflow-scrolling:touch;
  padding-bottom:18px!important;
}
.yan-menu-alt{
  flex:0 0 auto!important;
  position:relative!important;
  z-index:3!important;
  background:inherit;
  padding-bottom:max(16px,var(--okumapro-safe-bottom))!important;
  box-shadow:0 -12px 24px rgba(15,23,42,.08)
}
.yan-menu-cikis{min-height:48px!important;display:flex!important;align-items:center!important}
.menu-perdesi{pointer-events:none!important}
.menu-perdesi.acik{pointer-events:auto!important}

@media(max-width:991.98px){
  html{height:auto!important;overflow-y:auto!important;overscroll-behavior-y:auto!important;touch-action:auto!important;-webkit-overflow-scrolling:touch}
  body.okumapro-sayfa:not(.modal-open):not(.offcanvas-open):not(.splash-active){overscroll-behavior-y:auto!important}
  .uygulama-yan-menu{height:var(--okumapro-visual-vh,100dvh)!important}
  .mobil-alt-navigasyon{touch-action:manipulation!important;transition:opacity .18s ease,transform .18s ease,visibility .18s ease}
  /* Sabit barlarda yüksek maliyetli blur katmanını mobilde kaldır; opak zemin görünümü korur. */
  body.okumapro-sayfa .mobil-alt-navigasyon,
  body.okumapro-sayfa .uygulama-ust-cubuk{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  body.okumapro-sayfa .menu-perdesi.acik{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

  /* Mobil bottom-sheet: gerçek visualViewport yüksekliğini kullanır. */
  body.okumapro-sayfa .modal{
    padding:0!important;
    overflow:hidden!important;
  }
  body.okumapro-sayfa .modal-dialog:not([class*="modal-fullscreen"]){
    width:100%!important;
    max-width:none!important;
    min-height:0!important;
    height:var(--okumapro-visual-vh,100dvh)!important;
    max-height:var(--okumapro-visual-vh,100dvh)!important;
    margin:0!important;
    display:flex!important;
    align-items:flex-end!important;
    padding-top:max(8px,var(--okumapro-safe-top))!important;
    transform:none!important;
  }
  body.okumapro-sayfa .modal-dialog:not([class*="modal-fullscreen"]) .modal-content{
    width:100%!important;
    max-height:calc(var(--okumapro-visual-vh,100dvh) - max(8px,var(--okumapro-safe-top)))!important;
    height:auto!important;
    min-height:0!important;
    margin-top:auto!important;
    border-radius:26px 26px 0 0!important;
    padding-bottom:0!important;
    box-shadow:0 -20px 60px rgba(15,30,52,.25)!important;
    overflow:hidden!important;
  }
  body.okumapro-sayfa .modal-dialog:not([class*="modal-fullscreen"]) .modal-header{
    position:relative!important;
    top:auto!important;
    z-index:12!important;
    flex:0 0 auto!important;
    background:inherit;
    padding-top:max(18px,calc(10px + var(--okumapro-safe-top)))!important;
  }
  body.okumapro-sayfa .modal-dialog:not([class*="modal-fullscreen"]) .modal-body{
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    flex:1 1 auto!important;
    touch-action:pan-y!important;
    padding-bottom:22px!important;
  }
  body.okumapro-sayfa .modal-dialog:not([class*="modal-fullscreen"]) .modal-footer{
    position:relative!important;
    bottom:auto!important;
    z-index:12!important;
    flex:0 0 auto!important;
    background:inherit!important;
    padding:12px 16px max(14px,calc(10px + var(--okumapro-safe-bottom)))!important;
    margin:0!important;
  }
  body.okumapro-sayfa .modal-header .btn-close{
    min-width:44px!important;
    min-height:44px!important;
    border-radius:50%!important;
    flex:0 0 44px!important;
  }
  body.okumapro-sayfa .modal-content.okumapro-modal-content-scroll{
    overflow-y:auto!important;
    padding-bottom:max(18px,var(--okumapro-safe-bottom))!important;
  }

  /* Haftanın kitabı: gövde kayar, eylem butonları her zaman ekranda kalır. */
  body.okumapro-sayfa #bookDetailModal .modal-content{max-height:calc(var(--okumapro-visual-vh,100dvh) - max(8px,var(--okumapro-safe-top)))!important}
  body.okumapro-sayfa #bookDetailModal .modal-body{padding:14px 16px 18px!important}
  body.okumapro-sayfa #bookDetailModal .modal-footer{display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important;background:#fff!important}
  body.okumapro-sayfa #bookDetailModal .modal-footer>*{width:100%!important;margin:0!important;min-width:0}
  body.okumapro-sayfa #bookDetailModal .modal-footer .v7-btn{min-height:46px!important;font-size:.84rem!important;padding:.65rem .55rem!important;line-height:1.15!important}
}

@media(max-width:340px){
  body.okumapro-sayfa #bookDetailModal .modal-footer{grid-template-columns:1fr!important}
  body.okumapro-sayfa #bookDetailModal .modal-footer .v7-btn{min-height:44px!important}
}

@media(min-width:992px){
  .modal .modal-dialog-scrollable{max-height:calc(100dvh - 3.5rem)}
  .modal .modal-dialog-scrollable .modal-content{max-height:calc(100dvh - 3.5rem)}
  .modal .modal-content.okumapro-modal-content-scroll{max-height:calc(100dvh - 3.5rem)}
}

/* V8.3.4.1 · iOS Safari/PWA geri kaydırma, hit-test ve dokunma güvenliği */
html,body.okumapro-sayfa{overscroll-behavior-x:auto!important}
body.okumapro-sayfa:not(.modal-open):not(.offcanvas-open):not(.splash-active){
  touch-action:pan-x pan-y!important;
  -webkit-overflow-scrolling:touch!important;
}
@supports(-webkit-touch-callout:none){
  body.okumapro-sayfa:not(.modal-open):not(.offcanvas-open):not(.splash-active):not(.okumapro-ios-overlay-lock){
    position:static!important;
    height:auto!important;
    min-height:100%!important;
    overflow-y:auto!important;
  }
  .modal.show,.modal.showing{
    pointer-events:auto!important;
    -webkit-user-select:auto;
  }
  .modal.show .modal-dialog,.modal.show .modal-content{pointer-events:auto!important}
  .modal .modal-body,.modal .okumapro-modal-content-scroll,.yan-menu-baglantilari{
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }
  .modal .modal-header,.modal .modal-footer{touch-action:manipulation!important}
  .modal .btn-close,.modal button,.modal a,.modal input,.modal textarea,.modal select{
    pointer-events:auto!important;
    -webkit-tap-highlight-color:rgba(0,0,0,0);
  }
  #learningOnboardingModal{touch-action:none!important}
  #learningOnboardingModal .modal-dialog{height:var(--okumapro-visual-vh,100dvh)!important;pointer-events:auto!important}
  #learningOnboardingModal .modal-content{pointer-events:auto!important}
  #learningOnboardingModal .modal-body{touch-action:pan-y!important}
  #learningOnboardingModal .modal-footer{padding-bottom:max(18px,calc(10px + env(safe-area-inset-bottom,0px)))!important}
  #learningOnboardingModal .v7-btn{min-height:54px!important;pointer-events:auto!important;touch-action:manipulation!important}
}
