/**
 * BK Çerez (Cookie Consent) Popup System
 * All classes prefixed with bk-cerez- to avoid conflicts.
 */

/* -------------------------------------------------------------------------
   Root container – sağ alt köşede sabit kutu
   ------------------------------------------------------------------------- */
.bk-cerez-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  z-index: 99999;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  box-sizing: border-box;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.bk-cerez-container *,
.bk-cerez-container *::before,
.bk-cerez-container *::after {
  box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   Popup kutusu – yuvarlatılmış köşe, gölge, kompakt
   ------------------------------------------------------------------------- */
.bk-cerez-popup {
  position: relative;
  pointer-events: auto;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 20px 22px;
  padding-top: 48px;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bk-cerez-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #555;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.bk-cerez-popup-close:hover,
.bk-cerez-popup-close:focus {
  background: #f0f0f0;
  color: #333;
  outline: none;
}

.bk-cerez-popup-close:focus-visible {
  outline: 2px solid #e01f26;
  outline-offset: 2px;
}

.bk-cerez-popup-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -------------------------------------------------------------------------
   Metin alanı
   ------------------------------------------------------------------------- */
.bk-cerez-text {
  margin: 0;
}

.bk-cerez-text p {
  margin: 0 0 0.6em 0;
  color: #555;
  font-size: 14px;
  line-height: 1.55;
}

.bk-cerez-text p:last-child {
  margin-bottom: 0;
}

.bk-cerez-link {
  font-weight: 700;
  color: #e01f26;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
}

.bk-cerez-link:hover,
.bk-cerez-link:focus {
  color: #b8181e;
  outline: 2px solid #e01f26;
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Butonlar – Kabul (teal) ve Reddet (gri)
   ------------------------------------------------------------------------- */
.bk-cerez-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.bk-cerez-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.bk-cerez-btn:focus {
  outline: 2px solid #e01f26;
  outline-offset: 2px;
}

.bk-cerez-btn-accept {
  background: #e01f26;
  color: #fff;
}

.bk-cerez-btn-accept:hover {
  background: #b8181e;
}

.bk-cerez-btn-reject {
  background: #f0f0f0;
  color: #333;
}

.bk-cerez-btn-reject:hover {
  background: #e0e0e0;
}

/* -------------------------------------------------------------------------
   Modal overlay
   ------------------------------------------------------------------------- */
.bk-cerez-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.bk-cerez-modal-overlay.bk-cerez-modal-open {
  opacity: 1;
  visibility: visible;
}

/* -------------------------------------------------------------------------
   Modal box
   ------------------------------------------------------------------------- */
.bk-cerez-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.bk-cerez-modal-overlay.bk-cerez-modal-open .bk-cerez-modal {
  transform: scale(1);
}

.bk-cerez-modal-header {
  flex: 0 0 auto;
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}

.bk-cerez-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 8px;
  line-height: 1.3;
}

.bk-cerez-modal-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: #666;
  border-radius: 50%;
  cursor: pointer;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.bk-cerez-modal-close:hover {
  background: rgba(224, 31, 38, 0.08);
  color: #e01f26;
}

.bk-cerez-modal-close:focus {
  outline: none;
}

.bk-cerez-modal-close:focus-visible {
  outline: 2px solid #e01f26;
  outline-offset: 2px;
}

.bk-cerez-modal-body {
  flex: 1 1 auto;
  padding: 16px 24px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bk-cerez-modal-body p {
  margin: 0 0 1em 0;
}

.bk-cerez-modal-body p:last-child {
  margin-bottom: 0;
}

.bk-cerez-modal-body h3 {
  margin: 1.25em 0 0.5em 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a1a;
}

.bk-cerez-modal-body h3:first-child {
  margin-top: 0;
}

.bk-cerez-modal-body h4 {
  margin: 1em 0 0.4em 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}

.bk-cerez-modal-body ul {
  margin: 0 0 1em 0;
  padding-left: 1.25em;
}

.bk-cerez-modal-body ul li {
  margin-bottom: 0.35em;
}

.bk-cerez-modal-body a {
  color: #e01f26;
  text-decoration: underline;
  word-break: break-all;
}

.bk-cerez-modal-body a:hover {
  color: #b8181e;
}

.bk-cerez-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75em 0 1em 0;
  font-size: 0.9rem;
}

.bk-cerez-table th,
.bk-cerez-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.bk-cerez-table th {
  background: #f5f5f5;
  font-weight: 600;
  color: #1a1a1a;
}

.bk-cerez-table tbody tr:nth-child(even) {
  background: #fafafa;
}

@media (max-width: 767px) {
  .bk-cerez-table {
    display: block;
    overflow-x: auto;
  }
}

/* -------------------------------------------------------------------------
   Responsive: mobil – sağ alt köşede kalır, küçük ekranda kenarlara yapışır
   ------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .bk-cerez-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .bk-cerez-popup {
    padding: 48px 18px 16px;
    max-width: 100%;
  }

  .bk-cerez-popup-close {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    font-size: 30px;
  }

  .bk-cerez-popup-inner {
    gap: 14px;
  }

  .bk-cerez-text p {
    font-size: 13px;
  }

  .bk-cerez-actions {
    flex-direction: row;
  }

  .bk-cerez-btn {
    flex: 1;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 13px;
  }

  .bk-cerez-modal {
    max-height: 90vh;
  }

  .bk-cerez-modal-header {
    padding: 16px 20px 14px;
    min-height: 44px;
    align-items: center;
  }

  .bk-cerez-modal-title {
    font-size: 1.1rem;
    padding-right: 12px;
  }

  .bk-cerez-modal-close {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    font-size: 1.75rem;
  }

  .bk-cerez-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* -------------------------------------------------------------------------
   Reduced motion (accessibility)
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bk-cerez-modal-overlay,
  .bk-cerez-modal {
    transition: none;
  }
}
