/* --- Ortak --- */
.qv-cc-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: none; z-index: 1040;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

/* Banner: geniş ekranlarda merkezde; mobilde kenarlara oturur */
.qv-cc-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 16px;
  width: min(1200px, 96vw);
  background: #fff; color: #111; border: 1px solid #e5e5e5;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15);
  z-index: 1050; display: none;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden; /* içte kontrollü kaydırma için dışı sabit tut */
}

.qv-cc-banner, .qv-cc-banner * { box-sizing: border-box; }
.qv-cc-body { padding: 16px 18px; }
.qv-cc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qv-cc-actions .btn { border-radius: 10px; }
.qv-cc-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.qv-cc-text { font-size: .95rem; color: #555; margin-bottom: 12px; }
.qv-cc-link { text-decoration: underline; color: #111; }

/* Uzun metin/linkler taşmasın; yatay scroll asla çıkmasın */
.qv-cc-text, .qv-cc-body, .qv-cc-banner {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Modal kapsayıcı */
.qv-cc-modal {
  position: fixed; inset: 0; display: none; z-index: 1060;
  align-items: center; justify-content: center;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

/* Modal kart (masaüstü) */
.qv-cc-modal .card {
  width: min(720px, 94vw);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  max-height: 90vh;               /* sayfayı kaydırmadan içinde kalır */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.form-switch .form-check-input { cursor: pointer; }

/* -------- Mobil düzenler -------- */
@media (max-width: 576px) {
  /* Banner mobil: yanlarda 12px marj, güvenli alan, taşma yok */
  .qv-cc-banner {
    left: 0; right: 0; transform: none;
    width: auto;
    margin: 0 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 12px;
    /* Banner tamamı ekran yüksekliğini ASLA geçmez */
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
    overflow: auto;                      /* gerekirse sadece içeride kaydır */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .qv-cc-body { padding: 14px 14px; }
  .qv-cc-title { font-size: 1rem; }
  .qv-cc-text { font-size: .9rem; }

  .qv-cc-actions { flex-direction: column; }
  .qv-cc-actions .btn {
    width: 100%;
    padding: 10px 14px;
    min-height: 40px;
  }

  /* Modal mobil: alttan açılan “bottom sheet” gibi */
  .qv-cc-modal {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px)) 0;
  }
  .qv-cc-modal .card {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: 16px 16px 0 0;
    /* Ekran içinde kalır; sayfayı kaydırmaz */
    max-height: min(88vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}

/* 100dvh destekleyen tarayıcılar için daha doğru yükseklik */
@supports (height: 100dvh) {
  @media (max-width: 576px) {
    .qv-cc-banner {
      max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    }
    .qv-cc-modal .card {
      max-height: min(88dvh, 640px);
    }
  }
}

/* Dar ekran tipografi ufak ayarı */
@media (max-width: 360px) {
  .qv-cc-title { font-size: .95rem; }
  .qv-cc-text { font-size: .85rem; }
  .qv-cc-actions .btn { padding: 9px 12px; }
}

/* Büyük ekranlarda banner çok genişlemesin */
@media (min-width: 1200px) {
  .qv-cc-banner { width: 960px; }
}

/* Arka plan kaymasını engellemek için (opsiyonel):
   Modal açıkken body’ye .no-scroll ekleyin (JS’ten) */
body.no-scroll {
  overflow: hidden;
  touch-action: none;
}
