/*
 * Çerez onayı bandı ve tercih penceresi.
 * Kök font boyutu şablonda 10px olduğundan ölçüler px ile verilir.
 * Marka renkleri yalnızca aşağıdaki değişken bloğunda değişir (Kargonsoft paleti, kargon.css ile aynı).
 */
.cerez-bandi,
.cerez-pencere {
  --co-primary-bg: #47B1E2;
  --co-primary-fg: #15191E;
  --co-primary-hover: hsl(199, 78%, 66%);
  --co-switch-on: #0C6697; /* logo mavisi beyaz zeminde 3:1'in altında; okunur mavi */
  --co-link: #0C6697;
  --co-btn-radius: 999px;

  --co-ink: #20252C;
  --co-text: #434B56;
  --co-muted: #616A75;
  --co-line: hsl(210, 18%, 90%);
  --co-soft: hsl(204, 40%, 98%);
  --co-surface: #ffffff;
  --co-shadow: 0 2px 6px hsla(214, 20%, 20%, 0.06), 0 24px 60px hsla(214, 25%, 6%, 0.22);

  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--co-text);
  -webkit-font-smoothing: antialiased;
}

.cerez-bandi *,
.cerez-pencere * { box-sizing: border-box; }

/* ---------- Bant ---------- */

.cerez-bandi {
  position: fixed;
  z-index: 9000;
  inset-inline: 12px;
  inset-block-end: 12px;
  max-width: 460px;
  padding: 22px 22px 20px;
  background: var(--co-surface);
  border: 1px solid var(--co-line);
  border-radius: 16px;
  box-shadow: var(--co-shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.33, 0.85, 0.4, 0.96);
}

.cerez-bandi.is-visible { opacity: 1; transform: none; }
.cerez-bandi[hidden] { display: none; }

@media (min-width: 576px) {
  .cerez-bandi { inset-inline: 24px auto; inset-block-end: 24px; }
}

.cerez-bandi__baslik {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--co-ink);
}

.cerez-bandi__ikon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--co-icon, var(--co-switch-on));
}

.cerez-bandi__metin {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
}

/* Şablon a/span öğelerini blok yapıyor; metin içi bağlantı satırda kalmalı. */
.cerez-bandi a,
.cerez-pencere a {
  display: inline;
  color: var(--co-link);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cerez-bandi a:hover,
.cerez-pencere a:hover { text-decoration-thickness: 2px; }

.cerez-bandi__eylemler {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cerez-bandi__eylemler .cerez-btn--metin { grid-column: 1 / -1; }

/* ---------- Butonlar ---------- */

.cerez-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--co-btn-radius);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cerez-btn:focus-visible,
.cerez-pencere__kapat:focus-visible,
.cerez-anahtar input:focus-visible + .cerez-anahtar__ray {
  outline: 3px solid var(--co-switch-on);
  outline-offset: 2px;
}

.cerez-btn--birincil {
  background: var(--co-primary-bg);
  color: var(--co-primary-fg);
}

.cerez-btn--birincil:hover { background: var(--co-primary-hover); }

/* Reddet, Kabul ile eşit ağırlıkta sunulur (KVKK Çerez Rehberi). */
.cerez-btn--ikincil {
  background: var(--co-surface);
  border-color: var(--co-ink);
  color: var(--co-ink);
}

.cerez-btn--ikincil:hover { background: var(--co-soft); }

.cerez-btn--metin {
  min-height: 36px;
  padding: 6px 8px;
  background: none;
  color: var(--co-ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cerez-btn--metin:hover { color: var(--co-link); }

/* ---------- Tercih penceresi ---------- */

.cerez-pencere {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: var(--co-surface);
  border: 0;
  border-radius: 18px;
  box-shadow: var(--co-shadow);
}

.cerez-pencere[open] { display: flex; flex-direction: column; }

.cerez-pencere::backdrop {
  background: hsla(230, 25%, 10%, 0.55);
  backdrop-filter: blur(2px);
}

.cerez-pencere__ust {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--co-line);
}

.cerez-pencere__baslik {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--co-ink);
}

.cerez-pencere__aciklama {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.cerez-pencere__kapat {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -6px -6px 0 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--co-muted);
  cursor: pointer;
}

.cerez-pencere__kapat:hover { background: var(--co-soft); color: var(--co-ink); }
.cerez-pencere__kapat svg { width: 20px; height: 20px; }

.cerez-pencere__govde {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 24px;
}

.cerez-kategori {
  padding: 16px 0;
  border-bottom: 1px solid var(--co-line);
}

.cerez-kategori:last-child { border-bottom: 0; }

.cerez-kategori__ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.cerez-kategori__baslik {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--co-ink);
}

.cerez-kategori__metin {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.cerez-kategori__rozet {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--co-soft);
  border: 1px solid var(--co-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--co-ink);
  white-space: nowrap;
}

/* Erişilebilir anahtar: gerçek checkbox (role="switch") görsel rayın üstünde durur. */
.cerez-anahtar {
  position: relative;
  flex: none;
  display: inline-flex;
  cursor: pointer;
}

.cerez-anahtar input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cerez-anahtar__ray {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: hsl(220, 10%, 72%);
  transition: background-color 0.2s ease;
}

.cerez-anahtar__ray::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.25);
  transition: transform 0.2s ease;
}

.cerez-anahtar input:checked + .cerez-anahtar__ray { background: var(--co-switch-on); }
.cerez-anahtar input:checked + .cerez-anahtar__ray::after { transform: translateX(18px); }

.cerez-pencere__alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--co-line);
  background: var(--co-soft);
}

.cerez-pencere__alt .cerez-btn { flex: 1 1 160px; }

@media (min-width: 576px) {
  .cerez-pencere__alt .cerez-btn { flex: 0 0 auto; }
}

/* Footer'daki "Çerez Tercihleri" bağlantısı bir button; diğer bağlantılarla aynı görünür. */
.cerez-footer-link {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Bant açıkken mobilde yukarı çık düğmesi bandın arkasında kalmasın. */
@media (max-width: 575px) {
  .cerez-bandi-acik .back-top-btn { opacity: 0; pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cerez-bandi,
  .cerez-anahtar__ray,
  .cerez-anahtar__ray::after { transition: none; }
}

/* ---------- Gizlilik sayfası çerez tablosu ---------- */

.cerez-tablo-kap {
  margin: 16px 0 24px;
  overflow-x: auto;
  border: 1px solid hsl(210, 18%, 90%);
  border-radius: 12px;
}

.cerez-tablo {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.cerez-tablo th,
.cerez-tablo td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid hsl(210, 18%, 90%);
}

.cerez-tablo thead th {
  background: hsl(204, 40%, 98%);
  font-weight: 700;
  white-space: nowrap;
}

.cerez-tablo tbody tr:last-child td { border-bottom: 0; }
.cerez-tablo code { font-size: 13px; white-space: nowrap; }

/* Bant/penceredeki bağlantıyla gelindiğinde başlık sabit header altında kalmasın. */
#cerezler { scroll-margin-top: 120px; }
