/* ==========================================================================
   Marie Julien Cuisine — Bandeau cookies + Modal "Personnaliser"
   (Consent Mode v2 granulaire : Analytics / Ads)
   ========================================================================== */

/* ─── Bandeau (3 boutons : Personnaliser / Tout refuser / Tout accepter) ── */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 560px;
  margin: 0 auto;
  background: #FFFEF8;
  color: #243B69;
  border: 1px solid rgba(36, 59, 105, .15);
  border-radius: 12px;
  padding: 22px 24px 20px;
  z-index: 99998;
  box-shadow: 0 24px 60px -10px rgba(36, 59, 105, .25);
  transform: translateY(140%);
  opacity: 0;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .55s;
  font-family: 'Sora', system-ui, sans-serif;
}
.cookie-banner.show {
  transform: translateY(0);
  opacity: 1;
}
.cookie-banner__title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #243B69;
}
.cookie-banner__text {
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
  color: rgba(36, 59, 105, .85);
}
.cookie-banner__text a {
  color: #243B69;
  text-decoration: underline;
}
.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cookie-banner__btn {
  flex: 1 1 130px;
  min-width: 110px;
  padding: 11px 16px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .07em;
  cursor: pointer;
  border: 1px solid #243B69;
  background: transparent;
  color: #243B69;
  transition: background .25s, color .25s, transform .15s;
}
.cookie-banner__btn:hover {
  transform: translateY(-1px);
}
.cookie-banner__btn:focus-visible {
  outline: 2px solid #243B69;
  outline-offset: 2px;
}
.cookie-banner__btn--customize {
  background: transparent;
  color: #243B69;
}
.cookie-banner__btn--customize:hover {
  background: rgba(36, 59, 105, .06);
}
.cookie-banner__btn--refuse:hover {
  background: rgba(36, 59, 105, .08);
}
.cookie-banner__btn--accept {
  background: #243B69;
  color: #FFFEF8;
}
.cookie-banner__btn--accept:hover {
  background: #1a2c4f;
  border-color: #1a2c4f;
}
@media (max-width: 600px) {
  .cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 18px 18px 14px;
  }
  .cookie-banner__title {
    font-size: 15px;
  }
  .cookie-banner__btn {
    font-size: 11px;
    padding: 10px 12px;
    letter-spacing: .05em;
  }
}

/* ─── Modal "Personnaliser" ───────────────────────────────────────────── */
.cookie-prefs-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', system-ui, sans-serif;
}

.cookie-prefs-modal.show {
  display: flex;
  animation: cpfade .25s ease-out;
}

@keyframes cpfade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.cookie-prefs-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 59, 105, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cookie-prefs-modal__panel {
  position: relative;
  background: #FFFEF8;
  color: #243B69;
  border-radius: 16px;
  padding: 32px 32px 24px;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 32px 80px -10px rgba(36, 59, 105, .35);
  animation: cppop .35s cubic-bezier(.2, .8, .2, 1);
}

@keyframes cppop {
  from { transform: translateY(20px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1);     opacity: 1; }
}

.cookie-prefs-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: #243B69;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.cookie-prefs-modal__close:hover,
.cookie-prefs-modal__close:focus-visible {
  background: rgba(36, 59, 105, .08);
  outline: none;
}

.cookie-prefs-modal__close svg {
  width: 18px;
  height: 18px;
}

.cookie-prefs-modal__title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #243B69;
  padding-right: 32px;
}

.cookie-prefs-modal__intro {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(36, 59, 105, .8);
  margin: 0 0 20px;
}

/* ---- Catégorie ---- */
.cookie-prefs-cat {
  border: 1px solid rgba(36, 59, 105, .15);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: rgba(36, 59, 105, .02);
}

.cookie-prefs-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.cookie-prefs-cat__title {
  font-size: 14px;
  font-weight: 600;
  color: #243B69;
  margin: 0;
  flex: 1;
}

.cookie-prefs-cat__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(36, 59, 105, .08);
  color: #243B69;
}

.cookie-prefs-cat__desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(36, 59, 105, .72);
  margin: 0;
}

/* ---- Switch iOS-like ---- */
.cookie-prefs-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-prefs-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.cookie-prefs-switch__slider {
  position: absolute;
  inset: 0;
  background: rgba(36, 59, 105, .25);
  border-radius: 100px;
  transition: background .25s;
  cursor: pointer;
}

.cookie-prefs-switch__slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #FFFEF8;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
  transition: transform .25s;
}

.cookie-prefs-switch input:checked + .cookie-prefs-switch__slider {
  background: #243B69;
}

.cookie-prefs-switch input:checked + .cookie-prefs-switch__slider::before {
  transform: translateX(20px);
}

.cookie-prefs-switch input:focus-visible + .cookie-prefs-switch__slider {
  outline: 2px solid #243B69;
  outline-offset: 2px;
}

/* ---- Actions ---- */
.cookie-prefs-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.cookie-prefs-modal__btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 22px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  cursor: pointer;
  border: 1px solid #243B69;
  transition: background .25s, color .25s, transform .15s;
}

.cookie-prefs-modal__btn:hover {
  transform: translateY(-1px);
}

.cookie-prefs-modal__btn--save {
  background: transparent;
  color: #243B69;
}

.cookie-prefs-modal__btn--save:hover {
  background: rgba(36, 59, 105, .08);
}

.cookie-prefs-modal__btn--accept-all {
  background: #243B69;
  color: #FFFEF8;
}

.cookie-prefs-modal__btn--accept-all:hover {
  background: #1a2c4f;
  border-color: #1a2c4f;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .cookie-prefs-modal__panel {
    padding: 24px 20px 20px;
    border-radius: 14px;
    width: calc(100% - 24px);
  }
  .cookie-prefs-modal__title {
    font-size: 18px;
  }
  .cookie-prefs-modal__btn {
    font-size: 11px;
    padding: 11px 18px;
  }
}
