/* ==========================================================================
   Bandeau de consentement cookies — Café d'Icogne
   Classes préfixées "cc-" pour éviter tout conflit avec style.css
   ========================================================================== */

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  font-family: "Mulish", "Segoe UI", Roboto, sans-serif;
}

.cc-banner[hidden] {
  display: none;
}

.cc-card {
  pointer-events: auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 1120px;
  padding: 18px 20px;
  background-color: #ffffff;
  border: 1px solid #e6e8f2;
  border-radius: 18px;
  box-shadow: 0 12px 40px hsla(232, 64%, 20%, 0.18);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.cc-banner.cc-visible .cc-card {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Ligne principale ---------- */

.cc-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cc-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #eef0fa;
  color: #1d2b85;
}

.cc-text {
  flex: 1 1 340px;
  min-width: 240px;
}

.cc-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #16173a;
}

.cc-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #4a4d68;
}

.cc-desc a {
  color: #1d2b85;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

.cc-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ---------- Boutons ---------- */

.cc-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.cc-btn:focus-visible {
  outline: 2px solid #1d2b85;
  outline-offset: 2px;
}

.cc-btn-primary {
  background-color: #2b3990;
  color: #ffffff;
}

.cc-btn-primary:hover {
  background-color: #1d2b85;
}

.cc-btn-ghost {
  background-color: #ffffff;
  color: #1d2b85;
  border-color: #c9cee6;
}

.cc-btn-ghost:hover {
  background-color: #eef0fa;
}

.cc-btn-link {
  background: none;
  padding: 13px 8px;
  color: #4a4d68;
  text-decoration: underline;
}

.cc-btn-link:hover {
  color: #1d2b85;
}

/* ---------- Panneau "Personnaliser" ---------- */

.cc-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e6e8f2;
}

.cc-panel[hidden] {
  display: none;
}

.cc-option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
}

.cc-option + .cc-option {
  border-top: 1px dashed #e6e8f2;
}

.cc-option-txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cc-option-title {
  font-size: 14px;
  font-weight: 700;
  color: #16173a;
}

label.cc-option-title {
  cursor: pointer;
}

.cc-option-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #61648a;
}

.cc-always {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 50px;
  background-color: #eef0fa;
  color: #1d2b85;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.cc-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ---------- Interrupteur ---------- */

.cc-switch {
  flex: 0 0 auto;
  position: relative;
  margin-left: auto;
  width: 46px;
  height: 26px;
  cursor: pointer;
}

.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cc-slider {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background-color: #c9cee6;
  transition: background-color 0.25s ease;
  pointer-events: none;
}

.cc-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.25);
  transition: transform 0.25s ease;
}

.cc-switch input:checked + .cc-slider {
  background-color: #2b3990;
}

.cc-switch input:checked + .cc-slider::before {
  transform: translateX(20px);
}

.cc-switch input:focus-visible + .cc-slider {
  outline: 2px solid #1d2b85;
  outline-offset: 2px;
}

.cc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Lien "Gérer mes cookies" (pied de page) ---------- */

.cc-settings-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: bold;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.cc-settings-link:hover {
  text-decoration: underline;
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
  .cc-card {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .cc-main {
    gap: 12px;
  }

  .cc-icon {
    width: 38px;
    height: 38px;
  }

  .cc-text {
    flex: 1 1 180px;
    min-width: 0;
  }

  .cc-actions {
    flex-wrap: wrap;
    width: 100%;
    margin-left: 0;
  }

  .cc-actions .cc-btn-ghost,
  .cc-actions .cc-btn-primary {
    flex: 1 1 140px;
    text-align: center;
  }

  .cc-btn-link {
    order: 3;
    flex: 1 1 100%;
    text-align: center;
  }

  .cc-option {
    flex-wrap: wrap;
  }

  .cc-panel-actions .cc-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-card {
    transition: none;
  }
}
