/* ============================================================
   Cookie Consent - afondlacom  |  v1.0.0
   Compatible PrestaShop 8.x
   ============================================================ */

/* ---------- BANDEAU PRINCIPAL ---------- */
#afcookies-banner {
  position: fixed;
  bottom: 22px;
  left: 22px;
  width: 400px;
  max-width: calc(100vw - 44px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(8, 115, 171, 0.18), 0 2px 12px rgba(0,0,0,0.10);
  border: 1px solid rgba(8, 115, 171, 0.12);
  z-index: 99998;
  padding: 24px 24px 20px 24px;
  overflow: visible;
  display: none; /* affiché via JS si pas de consentement */
  animation: afcookies-slidein 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
  box-sizing: border-box;
}

@keyframes afcookies-slidein {
  from {
    transform: translateX(-120%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* ---------- ILLUSTRATION ---------- */
.afcookies-illus {
  position: absolute;
  top: -20px;
  right: -12px;
  pointer-events: none;
  user-select: none;
  line-height: 0;
}

/* ---------- CONTENU TEXTE ---------- */
.afcookies-body {
  padding-right: 110px; /* espace pour l'illustration */
  margin-bottom: 14px;
}

.afcookies-hello {
  margin: 0 0 2px 0;
  font-size: 13px;
  color: #666;
  font-weight: 400;
}

.afcookies-title {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.15;
}

.afcookies-text {
  margin: 0 0 8px 0;
  font-size: 13px;
  line-height: 1.55;
  color: #444;
}

.afcookies-policy-link {
  margin: 6px 0 0;
  font-size: 11.5px;
}

.afcookies-policy-link a {
  color: #0873ab;
  text-decoration: underline;
}

.afcookies-policy-link a:hover {
  color: #065a8a;
}

/* ---------- BOUTONS ---------- */
.afcookies-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(8, 115, 171, 0.10);
  padding-top: 14px;
}

.afcookies-btn {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.12s;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.01em;
}

.afcookies-btn:active {
  transform: scale(0.97);
}

.afcookies-btn--light {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
}

.afcookies-btn--light:hover {
  background: #f4f4f4;
  color: #333;
}

.afcookies-btn--primary {
  background: #0873ab;
  color: #ffffff;
  border: 1px solid #0873ab;
  font-size: 13.5px;
}

.afcookies-btn--primary:hover {
  background: #065a8a;
  border-color: #065a8a;
}

/* ---------- OVERLAY ---------- */
#afcookies-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.40);
  z-index: 99999;
  animation: afcookies-fadein 0.25s ease;
}

@keyframes afcookies-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- MODALE PERSONNALISATION ---------- */
#afcookies-modal {
  display: none;
  position: fixed;
  bottom: 22px;
  left: 22px;
  width: 440px;
  max-width: calc(100vw - 44px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 50px rgba(8, 115, 171, 0.22), 0 2px 16px rgba(0,0,0,0.12);
  z-index: 100000;
  padding: 28px;
  box-sizing: border-box;
  animation: afcookies-slidein 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.afcookies-modal-inner {
  position: relative;
}

.afcookies-modal-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f0f0f0;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.afcookies-modal-close:hover {
  background: #e0e0e0;
}

.afcookies-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 8px 0;
}

.afcookies-modal-intro {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin: 0 0 18px 0;
}

/* ---------- CATÉGORIES ---------- */
.afcookies-categories {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.afcookies-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #f7f9fc;
  border-radius: 12px;
  border: 1px solid #e8eef4;
}

.afcookies-cat-info {
  flex: 1;
}

.afcookies-cat-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 3px;
}

.afcookies-cat-info span {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* ---------- TOGGLE SWITCH ---------- */
.afcookies-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.afcookies-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.afcookies-slider {
  display: block;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.2s;
  position: relative;
}

.afcookies-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
}

.afcookies-toggle input:checked + .afcookies-slider {
  background: #0873ab;
}

.afcookies-toggle input:checked + .afcookies-slider::after {
  transform: translateX(20px);
}

.afcookies-toggle input:focus-visible + .afcookies-slider {
  outline: 2px solid #0873ab;
  outline-offset: 2px;
}

/* Toggle verrouillé (fonctionnels) */
.afcookies-toggle--locked {
  cursor: default;
}

.afcookies-toggle-on {
  font-size: 11px;
  font-weight: 700;
  color: #0873ab;
  background: rgba(8, 115, 171, 0.08);
  border: 1px solid rgba(8, 115, 171, 0.20);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* ---------- BOUTONS MODALE ---------- */
.afcookies-modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.afcookies-modal-actions .afcookies-btn {
  flex: 1;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  #afcookies-banner,
  #afcookies-modal {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
  }

  .afcookies-illus {
    width: 120px;
    height: 130px;
    right: -8px;
    top: -18px;
  }

  .afcookies-body {
    padding-right: 90px;
  }

  .afcookies-title {
    font-size: 19px;
  }

  .afcookies-actions {
    flex-wrap: wrap;
  }

  .afcookies-btn {
    font-size: 12px;
    padding: 8px 6px;
  }
}
