/* Cerez onay arayuzu (alt banner + tercih modali).
   Renkler/fontlar yalnizca site.css / theme.css icindeki CSS degiskenlerinden gelir; sabit renk yok.
   Kullanilan degiskenler: --color-primary, --color-primary-dark, --color-secondary, --color-bg-alt,
   --color-surface, --color-text, --color-text-muted, --color-on-primary, --color-border,
   --font-heading, --font-body, --radius, --shadow, --bar-h (opsiyonel). */

.cc-root { font-family: var(--font-body); color: var(--color-text); }
.cc-root [hidden] { display: none !important; }
.cc-root *, .cc-root *::before, .cc-root *::after { box-sizing: border-box; }

/* ---------- Alt banner ---------- */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
  background: var(--color-surface); color: var(--color-text);
  border-top: 3px solid var(--color-primary);
  box-shadow: 0 -8px 28px color-mix(in srgb, var(--color-secondary) 18%, transparent);
  padding: 1rem 0;
  max-height: 85vh; overflow-y: auto;
}
.cc-banner-inner {
  width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
}
.cc-text { flex: 1 1 340px; min-width: 0; overflow-wrap: anywhere; }
.cc-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; margin: 0 0 .25rem; color: var(--color-secondary); }
.cc-desc { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--color-text); }
.cc-links { margin: .4rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; }
.cc-links a, .cc-modal .cc-links a { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.cc-links a:hover { color: var(--color-primary); }

.cc-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; }

/* Dugmeler: Kabul et ve Reddet esit gorsel agirlikta */
.cc-btn {
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.25; text-align: center;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius);
  border: 2px solid var(--color-primary); cursor: pointer;
  background: var(--color-surface); color: var(--color-primary-dark);
  max-width: 100%; overflow-wrap: anywhere;
  transition: background .15s, color .15s, border-color .15s;
}
.cc-btn:hover { background: var(--color-bg-alt); }
.cc-btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.cc-btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.cc-btn-ghost { border-color: var(--color-border); background: var(--color-bg-alt); color: var(--color-text); }
.cc-btn-ghost:hover { border-color: var(--color-primary); }

.cc-root a:focus-visible, .cc-root button:focus-visible, .cc-root input:focus-visible,
.cc-modal:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* ---------- Modal ---------- */
.cc-backdrop {
  position: fixed; inset: 0; z-index: 1060;
  background: color-mix(in srgb, var(--color-secondary) 60%, transparent);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.cc-modal {
  background: var(--color-surface); color: var(--color-text);
  width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.cc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem .6rem; }
.cc-modal-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; margin: 0; color: var(--color-secondary); overflow-wrap: anywhere; }
.cc-close {
  flex: none; width: 44px; height: 44px; margin: -.4rem -.5rem 0 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--color-text); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.cc-close:hover { background: var(--color-bg-alt); }
.cc-modal-body { padding: 0 1.25rem 1rem; overflow-y: auto; flex: 1 1 auto; }
.cc-modal-body > p { margin: 0 0 .9rem; font-size: .9rem; line-height: 1.5; }

.cc-cat { border: 1px solid var(--color-border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .7rem; background: var(--color-surface); }
.cc-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cc-cat-name { font-weight: 600; color: var(--color-secondary); overflow-wrap: anywhere; }
.cc-cat-desc { margin: .35rem 0 0; font-size: .85rem; line-height: 1.45; color: var(--color-text-muted); overflow-wrap: anywhere; }
.cc-always { font-size: .8rem; font-weight: 600; color: var(--color-primary-dark); white-space: nowrap; }

/* Anahtar (switch): gercek checkbox, gorsel olarak gizli degil, odaklanabilir */
.cc-switch { position: relative; flex: none; width: 48px; height: 28px; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cc-slider { position: absolute; inset: 0; border-radius: 28px; background: var(--color-text-muted); border: 2px solid var(--color-text-muted); transition: background .15s, border-color .15s; }
.cc-slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-surface); transition: transform .15s; }
.cc-switch input:checked + .cc-slider { background: var(--color-primary); border-color: var(--color-primary); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider { outline: 3px solid var(--color-primary); outline-offset: 2px; }

.cc-modal-foot { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .9rem 1.25rem 1.1rem; border-top: 1px solid var(--color-border); background: var(--color-bg-alt); }
.cc-modal .cc-links { margin: 0 0 .9rem; }

body.cc-lock { overflow: hidden; }

/* Footer'daki "Cerez tercihleri" baglantisi (footer koyu zeminde; renk miras alinir) */
.cc-footer-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; margin-inline-start: .5rem; }
.cc-footer-link:hover { opacity: .85; }
.cc-footer-link:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }

/* ---------- Mobil ---------- */
@media (max-width: 991.98px) {
  /* sabit mobil CTA cubugunun uzerinde dur */
  .cc-banner { bottom: var(--bar-h, 0px); max-height: calc(100vh - var(--bar-h, 0px) - 1rem); }
}
@media (max-width: 575.98px) {
  .cc-banner-inner { gap: .75rem; }
  .cc-actions { flex-direction: column; width: 100%; }
  .cc-actions .cc-btn { width: 100%; }
  .cc-modal-foot { flex-direction: column; }
  .cc-modal-foot .cc-btn { width: 100%; }
  .cc-backdrop { padding: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn, .cc-slider, .cc-slider::before { transition: none; }
}
