/* ─────────────────────────────────────────────────────────────────────────────
   Cookie Consent — Le Labo d'Andrea
   Styles pour la bannière, le modal de préférences et le bouton footer.
   Aucune dépendance. Utilise les variables CSS de style.css.
───────────────────────────────────────────────────────────────────────────── */

/* ── Bannière ─────────────────────────────────────────────────────────────── */
#lda-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 0 16px 16px;
  transform: translateY(110%);
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
#lda-cookie-banner.ccb-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.ccb-inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(192, 132, 252, .2);
  border-radius: 20px;
  box-shadow: 0 -2px 32px rgba(192, 132, 252, .12), 0 8px 40px rgba(0, 0, 0, .08);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  overflow: hidden;
}

/* Barre gradient en haut */
.ccb-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff79a1, #c084fc);
  border-radius: 0;
}

.ccb-content { flex: 1; min-width: 0; }

.ccb-title {
  font-weight: 700;
  font-size: .9375rem;
  color: var(--text, #1a0533);
  margin: 0 0 4px;
}

.ccb-text {
  font-size: .8125rem;
  color: var(--text-muted, #7c6f8e);
  line-height: 1.55;
  margin: 0;
}

.ccb-link {
  color: var(--purple-dark, #a855f7);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ccb-link:hover { color: var(--pink, #ff79a1); }

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

/* Boutons partagés bannière + modal */
.ccb-btn {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .8125rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 99px;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
  line-height: 1;
}

.ccb-btn--ghost {
  background: transparent;
  color: var(--text-muted, #7c6f8e);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding-inline: 6px;
}
.ccb-btn--ghost:hover { color: var(--text, #1a0533); }

.ccb-btn--outline {
  background: transparent;
  color: var(--text, #1a0533);
  border: 1.5px solid var(--border-solid, #ede4f8);
}
.ccb-btn--outline:hover {
  border-color: var(--purple, #c084fc);
  color: var(--purple-dark, #a855f7);
  background: var(--purple-light, #f5f0ff);
}

.ccb-btn--primary {
  background: linear-gradient(135deg, #ff79a1, #c084fc);
  color: #fff;
  box-shadow: 0 4px 14px rgba(192, 132, 252, .35);
}
.ccb-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192, 132, 252, .45);
}
.ccb-btn--primary:active { transform: translateY(0); }

/* ── Modal préférences ────────────────────────────────────────────────────── */
#lda-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
#lda-cookie-modal.ccp-visible {
  opacity: 1;
  pointer-events: auto;
}

.ccp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 5, 51, .5);
  backdrop-filter: blur(5px);
}

.ccp-panel {
  position: relative;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(26, 5, 51, .22);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(24px) scale(.98);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
#lda-cookie-modal.ccp-visible .ccp-panel {
  transform: translateY(0) scale(1);
}

/* Scrollbar dans le panel */
.ccp-panel::-webkit-scrollbar { width: 4px; }
.ccp-panel::-webkit-scrollbar-track { background: transparent; }
.ccp-panel::-webkit-scrollbar-thumb { background: var(--border-solid, #ede4f8); border-radius: 99px; }

.ccp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(192, 132, 252, .15);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.ccp-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #1a0533);
  margin: 0;
}

.ccp-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--purple-light, #f5f0ff);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted, #7c6f8e);
  font-size: .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.ccp-close:hover { background: var(--purple, #c084fc); color: #fff; }

.ccp-body { padding: 4px 0; }

.ccp-category {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(192, 132, 252, .1);
}
.ccp-category:last-child { border-bottom: none; }

.ccp-cat-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.ccp-cat-info { flex: 1; min-width: 0; }

.ccp-cat-name {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text, #1a0533);
  margin: 0 0 4px;
}
.ccp-cat-desc {
  font-size: .8125rem;
  color: var(--text-muted, #7c6f8e);
  line-height: 1.55;
  margin: 0;
}

/* Toggle switch */
.ccp-toggle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-top: 2px;
}
.ccp-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ccp-slider {
  width: 44px;
  height: 24px;
  background: var(--border-solid, #e2d8f7);
  border-radius: 99px;
  position: relative;
  transition: background .2s;
  display: block;
}
.ccp-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .2s cubic-bezier(.22, 1, .36, 1);
}
.ccp-toggle input:checked + .ccp-slider {
  background: linear-gradient(135deg, #ff79a1, #c084fc);
}
.ccp-toggle input:checked + .ccp-slider::after {
  transform: translateX(20px);
}
.ccp-toggle:focus-within .ccp-slider {
  outline: 2px solid var(--purple, #c084fc);
  outline-offset: 2px;
}

/* Badge "Toujours actif" pour les essentiels */
.ccp-toggle--locked { cursor: default; }
.ccp-always-on {
  font-size: .6875rem;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  border-radius: 99px;
  padding: 3px 10px;
  white-space: nowrap;
}
/* Slider désactivé pour les essentiels */
.ccp-slider--locked {
  width: 44px;
  height: 24px;
  background: linear-gradient(135deg, #ff79a1, #c084fc);
  border-radius: 99px;
  position: relative;
  opacity: .6;
}
.ccp-slider--locked::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}

.ccp-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(192, 132, 252, .15);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: #fff;
}

/* ── Bouton footer "🍪 Gérer" ─────────────────────────────────────────────── */
.footer-cookie-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .8125rem;
  color: var(--text-muted, #7c6f8e);
  padding: 0;
  transition: color .2s;
  text-decoration: none;
}
.footer-cookie-btn:hover { color: var(--purple-dark, #a855f7); }

/* ── Page cookies.html ────────────────────────────────────────────────────── */
.cookies-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin: 16px 0 24px;
}
.cookies-table th,
.cookies-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-solid, #ede4f8);
}
.cookies-table th {
  font-weight: 600;
  color: var(--text, #1a0533);
  background: var(--purple-light, #f5f0ff);
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cookies-table td { color: var(--text-muted, #7c6f8e); }
.cookies-table td:first-child { font-family: monospace; color: var(--text, #1a0533); font-size: .8125rem; }
.cookies-table tr:last-child td { border-bottom: none; }

.cookie-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 99px;
  padding: 3px 10px;
}
.cookie-badge--essential { background: #d1fae5; color: #059669; }
.cookie-badge--analytics { background: rgba(192, 132, 252, .12); color: var(--purple-dark, #a855f7); }
.cookie-badge--marketing { background: rgba(255, 121, 161, .12); color: var(--pink-dark, #e85d8a); }
.cookie-badge--none { background: var(--bg-section, #f5f5f5); color: var(--text-soft, #b0a8c0); }

.manage-cookies-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff79a1, #c084fc);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 12px 28px;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(192, 132, 252, .35);
  transition: all .2s;
  margin-top: 8px;
}
.manage-cookies-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192, 132, 252, .45);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ccb-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px 16px 16px;
    border-radius: 16px 16px 0 0;
  }
  .ccb-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .ccp-panel { border-radius: 20px; }
  .ccp-footer { flex-direction: column; }
  .ccp-footer .ccb-btn { width: 100%; justify-content: center; text-align: center; }
}
