/**
 * Bloc de consentement cookies - EIM TECHNOLOGIES
 * Position : bas à gauche, fixe, discret
 * Charte graphique : bleu profond, orange, gris, blanc
 */

.cookie-consent-block {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  max-width: 380px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(10, 37, 64, 0.15);
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease;
}

.cookie-consent-block.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cookie-consent-block.hiding {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.cookie-consent-inner {
  padding: 1rem 1.25rem;
}

.cookie-consent-text {
  font-size: 0.875rem;
  color: var(--gray-700);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.cookie-consent-text a {
  color: var(--blue-deep);
  text-decoration: underline;
}

.cookie-consent-text a:hover {
  color: var(--orange);
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-consent-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.cookie-consent-btn-secondary {
  background: var(--gray-200);
  color: var(--gray-700);
}

.cookie-consent-btn-secondary:hover {
  background: var(--gray-300);
}

.cookie-consent-btn-accept {
  background: var(--orange);
  color: var(--white);
}

.cookie-consent-btn-accept:hover {
  background: var(--orange-hover);
}

.cookie-consent-btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.cookie-consent-expand {
  display: none;
  padding: 0 1.25rem 1rem;
  border-top: 1px solid var(--gray-200);
}

.cookie-consent-expand.show {
  display: block;
}

.cookie-consent-why {
  padding: 0.75rem 0;
}

.cookie-consent-why h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-deep);
  margin-bottom: 0.5rem;
}

.cookie-consent-why ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
  color: var(--gray-700);
}

.cookie-consent-why li {
  margin-bottom: 0.25rem;
}

.cookie-consent-preferences {
  margin-top: 0.5rem;
}

.cookie-preference-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.cookie-preference-item:last-child {
  border-bottom: none;
}

.cookie-preference-item label {
  font-size: 0.85rem;
  color: var(--blue-deep);
  flex: 1;
  margin-right: 0.75rem;
}

.cookie-preference-essential {
  opacity: 0.8;
}

.cookie-preference-essential .cookie-toggle {
  pointer-events: none;
}

.cookie-toggle {
  width: 40px;
  height: 22px;
  background: var(--gray-300);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.cookie-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.cookie-toggle.active {
  background: var(--orange);
}

.cookie-toggle.active::after {
  left: 20px;
}

.cookie-consent-floating {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-deep);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(10, 37, 64, 0.3);
  z-index: 9998;
  transition: var(--transition);
}

.cookie-consent-floating.show {
  display: flex;
}

.cookie-consent-floating:hover {
  background: var(--blue-accent);
  transform: scale(1.05);
}

@media (max-width: 479px) {
  .cookie-consent-block {
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
    bottom: 0.75rem;
  }

  .cookie-consent-inner {
    padding: 0.9rem 1rem;
  }

  .cookie-consent-actions {
    flex-direction: column;
  }

  .cookie-consent-btn {
    width: 100%;
  }

  .cookie-consent-floating {
    left: 0.75rem;
    bottom: 0.75rem;
  }
}
