/* ═══════════════════════════════════════════════════════════════════════
   BloisConsent — RGPD / CNIL / Google Consent Mode v2
   UI Stilleri  |  Version 1.0.0  |  guideblois.fr
   ─────────────────────────────────────────────────────────────────────
   Kapsam   : #blois-consent-banner, #blois-consent-modal, overlay
   Bağımlılık: Sıfır (vanilla CSS, çerçeve gerektirmez)
═══════════════════════════════════════════════════════════════════════ */

/* ── Temel sıfırlama (sadece consent elementlerine) ─────────────────── */
#blois-consent-banner *,
#blois-consent-modal *,
.blois-modal-overlay {
  box-sizing: border-box;
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. BANNER — sayfanın alt kısmında sabit çerez bildirim çubuğu
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#blois-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: #ffffff;
  border-top: 3px solid #4e54c8;
  box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.13);
  /* Başlangıç: görünmez — aşağı kaydırılmış */
  transform: translateY(110%);
  transition: transform 0.42s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform;
}

/* Görünür hale gelince yukarı kayar */
#blois-consent-banner.blois-consent-visible {
  transform: translateY(0);
}

/* Mobilde banner gizlenir — alt nav çubuğuyla çakışır;
   çerez yönetimi footer'daki "Gestion des cookies" linki üzerinden erişilebilir */
@media (max-width: 991px) {
  #blois-consent-banner {
    display: none !important;
  }
}

.blois-consent-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Metin alanı */
.blois-consent-banner-text {
  flex: 1;
  min-width: 240px;
}

.blois-consent-title {
  margin: 0 0 5px;
  font-size: 14.5px;
  font-weight: 700;
  color: #2d3436;
  line-height: 1.3;
}

.blois-consent-desc {
  margin: 0;
  font-size: 13px;
  color: #636e72;
  line-height: 1.55;
}

.blois-consent-link {
  color: #4e54c8 !important;
  text-decoration: underline !important;
  font-size: 12px;
}

/* Buton grubu */
.blois-consent-banner-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Küçük ekranlarda dikey düzen */
@media (max-width: 600px) {
  .blois-consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 12px;
  }
  .blois-consent-banner-actions {
    flex-direction: column;
  }
  .blois-consent-banner-actions .blois-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   2. BUTONLAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.blois-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, transform 0.15s ease,
              box-shadow 0.2s ease;
  white-space: nowrap;
  text-decoration: none !important;
  line-height: 1.4;
  letter-spacing: 0.01em;
  background: none;
}

.blois-btn:focus-visible {
  outline: 3px solid #4e54c8;
  outline-offset: 3px;
}

/* Birincil — gradyan mor */
.blois-btn-primary {
  background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%);
  color: #fff !important;
  border-color: transparent;
}
.blois-btn-primary:hover {
  background: linear-gradient(135deg, #3d43b4 0%, #7b80ea 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(78, 84, 200, 0.38);
}
.blois-btn-primary:active { transform: translateY(0); }

/* İkincil — açık mor arka plan */
.blois-btn-secondary {
  background: #eef0ff;
  color: #4e54c8 !important;
  border-color: #d0d4ff;
}
.blois-btn-secondary:hover {
  background: #dde0ff;
  transform: translateY(-1px);
}

/* Çerçeveli — nötr */
.blois-btn-outline {
  background: transparent;
  color: #636e72 !important;
  border-color: #dfe6e9;
}
.blois-btn-outline:hover {
  background: #f5f6fa;
  color: #2d3436 !important;
  border-color: #b2bec3;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. MODAL OVERLAY — arka plan bulanıklığı
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.blois-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 99999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.blois-modal-overlay.blois-overlay-visible {
  visibility: visible;
  opacity: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   4. MODAL — tercihler penceresi
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#blois-consent-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  z-index: 100000;
  width: 94%;
  max-width: 600px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

#blois-consent-modal.blois-modal-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Modal üst bilgi ─────────────────────────────────────────────── */
.blois-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid #eef0ff;
  background: linear-gradient(135deg, #f8f9ff 0%, #eef0ff 100%);
  flex-shrink: 0;
}

.blois-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #2d3436;
}

.blois-modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 17px;
  color: #636e72;
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.blois-modal-close-btn:hover {
  background: #ffe5e5;
  color: #d63031;
}
.blois-modal-close-btn:focus-visible {
  outline: 3px solid #4e54c8;
  outline-offset: 2px;
}

/* ── Modal gövde ─────────────────────────────────────────────────── */
.blois-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
}

/* Uyarı notu */
.blois-modal-intro {
  font-size: 13px;
  color: #636e72;
  margin: 0 0 16px;
  line-height: 1.6;
  padding: 11px 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #4e54c8;
}

/* ── Çerez kategorileri ─────────────────────────────────────────── */
.blois-cookie-cat {
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fafbff;
  transition: box-shadow 0.2s;
}
.blois-cookie-cat:last-child { margin-bottom: 0; }
.blois-cookie-cat:hover { box-shadow: 0 2px 10px rgba(78, 84, 200, 0.08); }

.blois-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  gap: 8px;
}

.blois-cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.blois-cat-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #2d3436;
}

.blois-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.blois-badge-required {
  background: #d1f2eb;
  color: #00897b;
}

.blois-cat-desc {
  font-size: 12.5px;
  color: #636e72;
  margin: 0 0 9px;
  line-height: 1.55;
}

/* Çerez etiketleri */
.blois-cookie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.blois-tag {
  display: inline-block;
  padding: 2px 9px;
  background: #eef0ff;
  color: #4e54c8;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #d1d4ff;
}

/* ── Toggle / Geçiş anahtarı ────────────────────────────────────── */
.blois-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.blois-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.blois-toggle-track {
  position: absolute;
  inset: 0;
  background: #dfe6e9;
  border-radius: 34px;
  cursor: pointer;
  transition: background 0.28s;
}
.blois-toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.28s;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
}

.blois-toggle input:checked + .blois-toggle-track {
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
}
.blois-toggle input:checked + .blois-toggle-track::before {
  transform: translateX(20px);
}
.blois-toggle input:focus-visible + .blois-toggle-track {
  outline: 3px solid #4e54c8;
  outline-offset: 3px;
}

/* Devre dışı toggle (zorunlu çerezler) */
.blois-toggle-disabled .blois-toggle-track {
  cursor: not-allowed;
  background: #00b894;
  opacity: 0.72;
}
.blois-toggle-disabled .blois-toggle-track::before {
  transform: translateX(20px);
}

/* ── Modal alt bilgi ─────────────────────────────────────────────── */
.blois-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #eef0ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  background: #fafbff;
  flex-wrap: wrap;
}

.blois-modal-footer-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Sayfa kilidi ───────────────────────────────────────────────── */
body.blois-locked {
  overflow: hidden !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. MOBİL — küçük ekran modal (alt drawer) ve buton düzeni
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 520px) {
  #blois-consent-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    /* Mobilde farklı animasyon: alttan yukarı kayar */
    transform: translateY(100%);
    transition: opacity 0.28s ease, transform 0.32s ease, visibility 0.28s ease;
  }
  #blois-consent-modal.blois-modal-visible {
    transform: translateY(0);
  }
  .blois-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .blois-modal-footer-left {
    width: 100%;
    justify-content: center;
  }
  .blois-modal-footer > .blois-btn-primary {
    width: 100%;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. ERİŞİLEBİLİRLİK — azaltılmış hareket tercihi
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (prefers-reduced-motion: reduce) {
  #blois-consent-banner,
  #blois-consent-modal,
  .blois-modal-overlay,
  .blois-toggle-track,
  .blois-toggle-track::before,
  .blois-btn {
    transition: none !important;
    animation: none !important;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. FOOTER LİNK STİLİ
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
a[data-blois-cookie-mgr] {
  cursor: pointer;
}
a[data-blois-cookie-mgr]:hover {
  text-decoration: underline;
}
