/* ═══════════════════════════════════════════════════════════
   Objectif21 — Cookie Consent CSS
   ═══════════════════════════════════════════════════════════ */

/* ── Bandeau principal ────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9990;
  background: #0F3D2E;
  color: #fff;
  padding: 18px 28px;
  display: none;
  align-items: center;
  gap: 24px;
  box-shadow: 0 -4px 32px rgba(0,0,0,.25);
  transform: translateY(100%);
  transition: transform .45s cubic-bezier(.22,1,.36,1);
  border-top: 2px solid rgba(200,169,81,.3);
}
#cookie-banner.cb-visible { transform: translateY(0); }

.cb-text { flex: 1; min-width: 0; }
.cb-title {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  margin: 0 0 4px;
}
.cb-desc {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  line-height: 1.6;
  margin: 0;
}
.cb-desc a { color: #C8A951; text-decoration: underline; }

.cb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* ── Boutons ──────────────────────────────────────────────── */
.ck-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  font-family: inherit;
  transition: opacity .15s, transform .15s;
  line-height: 1.2;
}
.ck-btn:hover  { opacity: .88; transform: translateY(-1px); }
.ck-btn:active { transform: translateY(0); }

.ck-btn-accept  { background: #C8A951; color: #0F3D2E; }
.ck-btn-refuse  { background: transparent; color: rgba(255,255,255,.7); border: 1.5px solid rgba(255,255,255,.2); }
.ck-btn-params  { background: transparent; color: rgba(255,255,255,.7); border: 1.5px solid rgba(255,255,255,.2); }
.ck-btn-save    { background: #0F3D2E; color: #fff; flex: 1; }
.ck-btn-refuse2 { background: transparent; color: #6b7280; border: 1.5px solid #e5e7eb; }
.ck-btn-accept2 { background: #C8A951; color: #0F3D2E; }

/* ── Overlay & Modal ──────────────────────────────────────── */
#cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9995;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity .3s;
}
#cookie-modal.cm-visible { opacity: 1; }

.cm-panel {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(50px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  overscroll-behavior: contain;
}
#cookie-modal.cm-visible .cm-panel { transform: translateY(0); }

/* En-tête modal */
.cm-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-radius: 20px 20px 0 0;
}
.cm-title {
  font-weight: 800;
  font-size: 17px;
  color: #0F3D2E;
  margin: 0;
}
.cm-close {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #6b7280;
  transition: background .15s;
  flex-shrink: 0;
}
.cm-close:hover { background: #f0f0f0; }

/* Corps modal */
.cm-body { padding: 16px 24px; }
.cm-intro {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.65;
  margin: 0 0 16px;
}
.cm-intro a { color: #0F3D2E; text-decoration: underline; }

/* ── Catégorie ────────────────────────────────────────────── */
.ck-cat {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .15s;
}
.ck-cat:has(.ck-toggle input:checked) { border-color: #0F3D2E; }

.ck-cat-row {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ck-cat-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ck-cat-info { flex: 1; min-width: 0; }
.ck-cat-name {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
  margin: 0 0 3px;
}
.ck-cat-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

/* Badge "Toujours actif" */
.ck-required-badge {
  font-size: 10px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Toggle switch ────────────────────────────────────────── */
.ck-toggle {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.ck-toggle input {
  opacity: 0; width: 0; height: 0;
  position: absolute;
}
.ck-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: #d1d5db;
  cursor: pointer;
  transition: background .2s;
}
.ck-toggle input:checked  + .ck-toggle-track { background: #0F3D2E; }
.ck-toggle input:disabled + .ck-toggle-track { background: #C8A951; cursor: not-allowed; }
.ck-toggle-track::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.ck-toggle input:checked + .ck-toggle-track::after { transform: translateX(20px); }

/* Pied modal */
.cm-foot {
  padding: 14px 24px 18px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 2;
}

/* ── Lien footer ──────────────────────────────────────────── */
.cookie-manage-link {
  color: rgba(255,255,255,.4);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s;
}
.cookie-manage-link:hover { color: rgba(255,255,255,.8); }

/* ── Toast confirmation ───────────────────────────────────── */
.ck-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: #0F3D2E;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 30px;
  z-index: 99999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(200,169,81,.3);
}
.ck-toast.ck-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  #cookie-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }
  .cb-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .cb-actions .ck-btn:first-child {
    grid-column: 1 / -1;
  }
  .cm-foot {
    flex-direction: column;
  }
  .ck-btn-save { order: -1; }
}

@media (max-width: 480px) {
  .cb-actions { grid-template-columns: 1fr; }
  .cb-actions .ck-btn:first-child { grid-column: auto; }
}
