/* Tora Politikalar – Cookie Banner & Modal
   Prefix: tpol-cb- (banner)  tpol-modal- (popup)
   These names are unique — will not conflict with any other plugin. */

/* ═══════════════════════════════════════════════
   BANNER
═══════════════════════════════════════════════ */
#tpol-cb-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: #fff;
  border-top: 3px solid var(--tpol-primary);
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#tpol-cb-banner.tpol-cb-visible {
  transform: translateY(0);
}

.tpol-cb-inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 48px 20px 24px;
}

/* Content */
.tpol-cb-content {
  flex: 1;
  min-width: 0;
}
.tpol-cb-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.3;
}
.tpol-cb-text {
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
  margin: 0 0 8px;
}
.tpol-cb-links {
  font-size: 13px;
  color: #374151;
  margin: 0;
  line-height: 1.6;
}
.tpol-cb-link {
  color: var(--tpol-primary);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
.tpol-cb-link:hover {
  color: var(--tpol-primary-d);
}

/* Buttons column */
.tpol-cb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 200px;
}
.tpol-cb-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: 2px solid var(--tpol-primary);
  border-radius: 6px;
  background: #fff;
  color: var(--tpol-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: background .15s, color .15s;
  line-height: 1.3;
  white-space: nowrap;
}
.tpol-cb-btn:hover {
  background: var(--tpol-primary);
  color: #fff;
}
.tpol-cb-btn-accept {
  background: var(--tpol-primary);
  color: #fff;
}
.tpol-cb-btn-accept:hover {
  background: var(--tpol-primary-d);
  border-color: var(--tpol-primary-d);
}

/* Close X */
#tpol-cb-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 20px;
  line-height: 1;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
#tpol-cb-close:hover {
  color: #374151;
  background: #f3f4f6;
}

/* "Seçilenleri Kabul Et" active state */
.tpol-cb-btn-sel-active {
  background: var(--tpol-primary) !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════
   PREFERENCES PANEL
═══════════════════════════════════════════════ */
#tpol-cb-prefs {
  max-height: 0;
  overflow: hidden;
  transition: max-height .32s cubic-bezier(.4,0,.2,1);
  border-top: 0 solid #e5e7eb;
}
#tpol-cb-prefs.tpol-cb-prefs-open {
  max-height: 320px;
  border-top-width: 1px;
}

.tpol-cb-prefs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 20px;
}

.tpol-cb-prefs-title {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 12px;
}

/* ── Accordion items ── */
.tpol-cb-acc-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
  background: #f9fafb;
}
.tpol-cb-acc-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.tpol-cb-acc-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  text-align: left;
  flex: 1;
  min-width: 0;
  font-family: inherit;
}
.tpol-cb-acc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 400;
  color: #6b7280;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
  line-height: 1;
}
.tpol-cb-acc-icon::before { content: '+'; }
.tpol-cb-acc-open .tpol-cb-acc-icon::before { content: '\2212'; } /* − */
.tpol-cb-acc-open .tpol-cb-acc-icon {
  border-color: var(--tpol-primary, #000000);
  color: var(--tpol-primary, #000000);
}
.tpol-cb-always-badge {
  font-size: 12px;
  font-weight: 600;
  color: #057a55;
  background: #def7ec;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tpol-cb-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s cubic-bezier(.4,0,.2,1), padding .2s;
  padding: 0 14px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.6;
}
.tpol-cb-acc-body p { margin: 0 0 6px; }
.tpol-cb-acc-open .tpol-cb-acc-body {
  max-height: 200px;
  padding: 0 14px 12px;
}
.tpol-cb-acc-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--tpol-primary, #000000);
  text-decoration: none;
  font-weight: 500;
}
.tpol-cb-acc-link:hover { text-decoration: underline; }

/* Preference toggle — unique class names */
.tpol-cb-ptoggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.tpol-cb-ptoggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tpol-cb-ptoggle-track {
  display: block;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  transition: background .2s;
  position: relative;
}
.tpol-cb-ptoggle input:checked + .tpol-cb-ptoggle-track {
  background: var(--tpol-primary);
}
.tpol-cb-ptoggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left .2s;
}
.tpol-cb-ptoggle input:checked + .tpol-cb-ptoggle-track .tpol-cb-ptoggle-thumb {
  left: 23px;
}

/* Preferences footer buttons */
.tpol-cb-prefs-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.tpol-cb-prefs-back {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .12s, color .12s;
}
.tpol-cb-prefs-back:hover {
  border-color: #9ca3af;
  color: #374151;
}
.tpol-cb-prefs-save {
  padding: 8px 20px;
  background: var(--tpol-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.tpol-cb-prefs-save:hover {
  background: var(--tpol-primary-d);
}

/* Mobile banner */
@media (max-width: 680px) {
  .tpol-cb-inner {
    flex-direction: column;
    padding: 16px 40px 16px 16px;
    gap: 14px;
  }
  .tpol-cb-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px;
  }
  .tpol-cb-btn {
    font-size: 11px;
    padding: 8px 10px;
    flex: 1 1 calc(50% - 4px);
  }
  /* "Tümünü Reddet" tek başına alt satıra */
  .tpol-cb-btn-reject {
    flex: 1 1 100%;
  }
  .tpol-cb-prefs-inner {
    padding: 14px 16px 16px;
  }
  .tpol-cb-pref-row {
    padding: 10px 12px;
  }
  .tpol-cb-prefs-footer {
    flex-direction: row;
    justify-content: space-between;
  }
  .tpol-cb-prefs-save {
    flex: 1;
  }
}

/* ═══════════════════════════════════════════════
   MODAL OVERLAY
═══════════════════════════════════════════════ */
#tpol-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#tpol-modal-overlay.tpol-modal-open {
  opacity: 1;
  visibility: visible;
}

/* ═══════════════════════════════════════════════
   MODAL BOX
═══════════════════════════════════════════════ */
.tpol-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: scale(.96) translateY(10px);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
#tpol-modal-overlay.tpol-modal-open .tpol-modal-box {
  transform: scale(1) translateY(0);
}

/* Modal header */
.tpol-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #f9fafb;
}
.tpol-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  flex: 1;
  padding-right: 12px;
}
.tpol-modal-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #e5e7eb;
  color: #374151;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.tpol-modal-close-btn:hover {
  background: var(--tpol-primary);
  color: #fff;
}

/* Modal body – scrollable */
.tpol-modal-body {
  overflow-y: auto;
  padding: 24px 28px 32px;
  flex: 1;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════
   POLICY CONTENT INSIDE MODAL
   (mirrors tpol-public.css so banner works on all pages)
═══════════════════════════════════════════════ */
.tpol-modal-body .tpol-policy-wrap {
  max-width: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #1f2937;
}
.tpol-modal-body .tpol-policy-main-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}
.tpol-modal-body .tpol-policy-subtitle {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}
.tpol-modal-body .tpol-policy-law-note {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 20px;
}
.tpol-modal-body .tpol-policy-wrap h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--tpol-primary);
  margin: 26px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--tpol-primary-l);
}
.tpol-modal-body .tpol-policy-wrap h3 {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.tpol-modal-body .tpol-policy-wrap p {
  margin: 0 0 10px;
}
.tpol-modal-body .tpol-policy-wrap ul,
.tpol-modal-body .tpol-policy-wrap ol {
  margin: 6px 0 12px 20px;
  padding: 0;
}
.tpol-modal-body .tpol-policy-wrap ul li,
.tpol-modal-body .tpol-policy-wrap ol li {
  margin-bottom: 4px;
}
.tpol-modal-body .tpol-policy-wrap a {
  color: var(--tpol-primary);
  text-decoration: none;
}
.tpol-modal-body .tpol-policy-wrap a:hover {
  text-decoration: underline;
}
.tpol-modal-body .tpol-contact-box {
  background: var(--tpol-primary-bg);
  border: 1px solid var(--tpol-primary-l);
  border-left: 4px solid var(--tpol-primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
}
.tpol-modal-body .tpol-contact-box p {
  margin: 0 0 3px;
}
.tpol-modal-body .tpol-contact-box p:last-child { margin: 0; }
.tpol-modal-body .tpol-vs-label {
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #6b7280 !important;
  font-weight: 600;
  margin-bottom: 4px !important;
}
.tpol-modal-body .tpol-divider {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 24px 0;
}
.tpol-modal-body .tpol-table-wrap {
  overflow-x: auto;
  margin: 10px 0 16px;
}
.tpol-modal-body .tpol-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 400px;
}
.tpol-modal-body .tpol-table th {
  background: var(--tpol-primary);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
}
.tpol-modal-body .tpol-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  color: #374151;
}
.tpol-modal-body .tpol-table tr:nth-child(even) td { background: #f9fafb; }
.tpol-modal-body .tpol-table tr:last-child td { border-bottom: none; }
.tpol-modal-body .tpol-table th:first-child,
.tpol-modal-body .tpol-table td:first-child {
  border-right: 1px solid #e5e7eb;
}

/* ═══════════════════════════════════════════════
   MOBILE MODAL — BOTTOM SHEET
═══════════════════════════════════════════════ */
@media (max-width: 640px) {
  #tpol-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .tpol-modal-box {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    transform: translateY(100%);
  }
  #tpol-modal-overlay.tpol-modal-open .tpol-modal-box {
    transform: translateY(0);
  }
  .tpol-modal-hdr {
    padding: 14px 16px 12px;
  }
  .tpol-modal-body {
    padding: 16px 16px 32px;
  }
}
