/* =========================================================
   ECS-COOKIES-RGPD (2026-04-23)
   Bandeau RGPD + modale de personnalisation.
   Palette : #253745 (fond foncé eCS), #32c36c (accepter),
             #7c619f (personnaliser), #525252 (refuser).
   ========================================================= */

/* ============ BANNIÈRE ============ */
#ecs-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: #253745;
  color: #ffffff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
  padding: 24px 20px;
  display: none;
  font-family: inherit;
}
#ecs-cookie-banner.ecs-cookies-visible {
  display: block;
}
#ecs-cookie-banner .ecs-cookies-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
#ecs-cookie-banner .ecs-cookies-content h3 {
  color: #ffffff;
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
}
#ecs-cookie-banner .ecs-cookies-content p {
  color: #ffffff;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.95;
}
#ecs-cookie-banner .ecs-cookies-content a {
  color: #32c36c;
  text-decoration: underline;
}
#ecs-cookie-banner .ecs-cookies-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#ecs-cookie-banner .ecs-cookies-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-family: inherit;
  white-space: nowrap;
}
#ecs-cookie-banner .ecs-cookies-btn:hover {
  transform: translateY(-1px);
}
#ecs-cookie-banner .ecs-cookies-btn--accept {
  background: #32c36c;
  color: #ffffff;
}
#ecs-cookie-banner .ecs-cookies-btn--accept:hover {
  background: #28a559;
}
#ecs-cookie-banner .ecs-cookies-btn--custom {
  background: #7c619f;
  color: #ffffff;
}
#ecs-cookie-banner .ecs-cookies-btn--custom:hover {
  background: #6a5188;
}
#ecs-cookie-banner .ecs-cookies-btn--reject {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
#ecs-cookie-banner .ecs-cookies-btn--reject:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============ MODALE ============ */
#ecs-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
#ecs-cookie-modal.ecs-cookies-visible {
  display: flex;
}
#ecs-cookie-modal .ecs-cookies-modal-inner {
  background: #ffffff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  color: #253745;
}
#ecs-cookie-modal h3 {
  color: #253745;
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 700;
}
#ecs-cookie-modal .ecs-cookies-modal-intro {
  color: #525252;
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.5;
}
#ecs-cookie-modal .ecs-cookies-category {
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
#ecs-cookie-modal .ecs-cookies-category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
#ecs-cookie-modal .ecs-cookies-category-head strong {
  color: #253745;
  font-size: 16px;
}
#ecs-cookie-modal .ecs-cookies-category-desc {
  color: #525252;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

/* Toggle switch */
.ecs-cookies-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.ecs-cookies-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ecs-cookies-toggle-slider {
  position: absolute;
  inset: 0;
  background: #c0c6cc;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.ecs-cookies-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.ecs-cookies-toggle input:checked + .ecs-cookies-toggle-slider {
  background: #32c36c;
}
.ecs-cookies-toggle input:checked + .ecs-cookies-toggle-slider::before {
  transform: translateX(20px);
}
.ecs-cookies-toggle input:disabled + .ecs-cookies-toggle-slider {
  opacity: 0.7;
  cursor: not-allowed;
}

#ecs-cookie-modal .ecs-cookies-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e0e4e8;
}
#ecs-cookie-modal .ecs-cookies-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: inherit;
}
#ecs-cookie-modal .ecs-cookies-btn--accept {
  background: #32c36c;
  color: #ffffff;
}
#ecs-cookie-modal .ecs-cookies-btn--accept:hover {
  background: #28a559;
}
#ecs-cookie-modal .ecs-cookies-btn--confirm {
  background: #253745;
  color: #ffffff;
}
#ecs-cookie-modal .ecs-cookies-btn--confirm:hover {
  background: #1a2a36;
}
#ecs-cookie-modal .ecs-cookies-btn--reject {
  background: transparent;
  color: #253745;
  border: 1px solid #253745;
}
#ecs-cookie-modal .ecs-cookies-btn--reject:hover {
  background: rgba(37, 55, 69, 0.05);
}

/* ============ RESPONSIVE MOBILE ============ */
@media (max-width: 767.98px) {
  #ecs-cookie-banner {
    padding: 16px;
  }
  #ecs-cookie-banner .ecs-cookies-wrap {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  #ecs-cookie-banner .ecs-cookies-actions {
    justify-content: center;
  }
  #ecs-cookie-banner .ecs-cookies-btn {
    flex: 1;
    min-width: 0;
  }
  #ecs-cookie-modal .ecs-cookies-modal-inner {
    padding: 20px;
  }
  #ecs-cookie-modal .ecs-cookies-modal-actions {
    justify-content: stretch;
  }
  #ecs-cookie-modal .ecs-cookies-modal-actions .ecs-cookies-btn {
    flex: 1;
  }
}

/* Footer link "Gérer mes cookies" */
.ecs-manage-cookies-link {
  background: none;
  border: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}
.ecs-manage-cookies-link:hover {
  color: #32c36c;
}
