/* ═══════════════════════════════════════════════════════════════
   NTech Electrique — cookies.css
   Bannière de consentement cookies RGPD
   Chargé sur toutes les pages du site
═══════════════════════════════════════════════════════════════ */

/* Overlay (panneau personnalisation) */
.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cookie-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Bannière principale */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 3px solid var(--green-500);
  box-shadow: 0 -4px 30px rgba(0,0,0,.12);
  z-index: 9999;
  padding: var(--space-xl) 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
}
.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.cookie-banner__icon {
  font-size: 2rem;
  flex-shrink: 0;
  color: var(--green-500);
}

.cookie-banner__text {
  flex: 1;
  min-width: 280px;
}
.cookie-banner__text h3 {
  font-size: var(--size-md);
  margin-bottom: var(--space-xs);
  font-family: var(--font-title);
}
.cookie-banner__text p {
  font-size: var(--size-sm);
  color: var(--grey-600);
  margin: 0;
}
.cookie-banner__text a {
  color: var(--green-700);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

/* Boutons de la bannière */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: var(--size-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.cookie-btn--accept {
  background: var(--green-500);
  color: var(--white);
  box-shadow: var(--shadow-green);
}
.cookie-btn--accept:hover {
  background: var(--green-700);
  transform: translateY(-1px);
}
.cookie-btn--refuse {
  background: var(--grey-100);
  color: var(--grey-800);
  border-color: var(--grey-200);
}
.cookie-btn--refuse:hover {
  background: var(--grey-200);
  color: var(--anthracite);
}
.cookie-btn--settings {
  background: transparent;
  color: var(--grey-600);
  border-color: var(--grey-200);
  font-size: var(--size-xs);
}
.cookie-btn--settings:hover {
  color: var(--green-700);
  border-color: var(--green-500);
}

/* Panneau de personnalisation */
.cookie-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: min(600px, 95vw);
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(.25,.8,.25,1);
  max-height: 90vh;
  overflow-y: auto;
}
.cookie-panel.visible {
  transform: translate(-50%, 0);
}

.cookie-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--grey-200);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.cookie-panel__header h3 {
  font-size: var(--size-lg);
  font-family: var(--font-title);
}
.cookie-panel__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--grey-100);
  color: var(--grey-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.9rem;
  border: none;
}
.cookie-panel__close:hover { background: var(--grey-200); color: var(--anthracite); }

.cookie-panel__body {
  padding: var(--space-xl) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.cookie-panel__body > p {
  font-size: var(--size-sm);
  color: var(--grey-600);
  margin: 0;
}

/* Catégorie de cookie */
.cookie-category {
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--grey-100);
  gap: var(--space-md);
}
.cookie-category__info { flex: 1; }
.cookie-category__title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: var(--size-base);
  color: var(--anthracite);
  margin-bottom: 2px;
}
.cookie-category__desc {
  font-size: var(--size-xs);
  color: var(--grey-600);
}
.cookie-category__body {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--size-xs);
  color: var(--grey-600);
  line-height: 1.6;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cookie-toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--grey-300, #ccc);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}
.cookie-toggle__slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cookie-toggle input:checked + .cookie-toggle__slider {
  background: var(--green-500);
}
.cookie-toggle input:checked + .cookie-toggle__slider::before {
  transform: translateX(22px);
}
.cookie-toggle input:disabled + .cookie-toggle__slider {
  opacity: 0.6;
  cursor: not-allowed;
}
.cookie-toggle input:focus-visible + .cookie-toggle__slider {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
}

/* Badge "Toujours actif" */
.cookie-badge-required {
  display: inline-block;
  background: var(--green-100);
  color: var(--green-700);
  font-size: var(--size-xs);
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Footer du panneau */
.cookie-panel__footer {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--grey-200);
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--white);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .cookie-banner__inner { gap: var(--space-md); }
  .cookie-banner__actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
  .cookie-btn--settings { display: none; }
  .cookie-banner__actions { flex-direction: column-reverse; align-items: stretch; }
  .cookie-btn { justify-content: center; }
}
