/* ═══════════════════════════════════════════════════════════════
   Bandeau consentement cookies — Criée Côte d'Albâtre
   RGPD / CNIL 2026
   ═══════════════════════════════════════════════════════════════ */

/* ── Utilitaires ─────────────────────────────────────────────── */
.cc-noscroll { overflow: hidden; }
.cc--hidden  { display: none !important; }

/* ── Backdrop ────────────────────────────────────────────────── */
.cc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 36, 36, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9998;
  animation: cc-fade-in 250ms ease forwards;
}

/* ── Bandeau principal (bas de page) ─────────────────────────── */
.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #ffffff;
  border-top: 3px solid #04999a;
  box-shadow: 0 -4px 32px rgba(4, 153, 154, 0.15), 0 -2px 8px rgba(0,0,0,0.08);
  animation: cc-slide-up 320ms cubic-bezier(.22,.9,.36,1) forwards;
  max-height: 90dvh;
  overflow-y: auto;
}

.cc-banner[aria-hidden="true"] {
  display: none;
}

.cc-banner__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 2rem 1.25rem;
}

/* En-tête */
.cc-banner__head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .875rem;
}

.cc-banner__icon {
  width: 2rem;
  height: 2rem;
  color: #04999a;
  flex-shrink: 0;
}

.cc-banner__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1A2424;
  margin: 0;
}

/* Texte */
.cc-banner__text {
  font-size: .9rem;
  color: #4A5858;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Boutons d'action */
.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  margin-bottom: .875rem;
}

/* Mentions légales */
.cc-banner__legal {
  font-size: .78rem;
  color: #7a8a8a;
  margin: 0;
}

/* ── Boutons ─────────────────────────────────────────────────── */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.375rem;
  border-radius: 50px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 200ms ease, transform 150ms ease, box-shadow 200ms ease;
  border: 2px solid transparent;
  white-space: nowrap;
  line-height: 1;
}

.cc-btn:focus-visible {
  outline: 3px solid #04999a;
  outline-offset: 3px;
}

/* Accepter — couleur principale teal */
.cc-btn--accept {
  background: #04999a;
  color: #ffffff;
  border-color: #04999a;
}
.cc-btn--accept:hover {
  background: #037273;
  border-color: #037273;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(4,153,154,.35);
}

/* Refuser — même poids visuel que Accepter */
.cc-btn--refuse {
  background: #ffffff;
  color: #1A2424;
  border-color: #c8bdb0;
}
.cc-btn--refuse:hover {
  background: #f3ede3;
  border-color: #1A2424;
  transform: translateY(-1px);
}

/* Personnaliser — style secondaire */
.cc-btn--customize {
  background: transparent;
  color: #04999a;
  border-color: #04999a;
}
.cc-btn--customize:hover {
  background: #e0f5f5;
  transform: translateY(-1px);
}

/* ── Lien ────────────────────────────────────────────────────── */
.cc-link {
  color: #04999a;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.cc-link:hover { color: #037273; }

/* ── Panneau de personnalisation (modale) ────────────────────── */
.cc-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
}

.cc-panel[aria-hidden="true"] { display: none; }

.cc-panel--open {
  pointer-events: auto;
  opacity: 1;
}

.cc-panel__inner {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(26,36,36,.2), 0 4px 16px rgba(4,153,154,.15);
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: cc-scale-in 280ms cubic-bezier(.22,.9,.36,1) forwards;
}

/* En-tête panneau */
.cc-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
  border-bottom: 1px solid #e2dad0;
  padding-bottom: 1rem;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  z-index: 1;
}

.cc-panel__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1A2424;
  margin: 0;
}

.cc-panel__close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3ede3;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #4A5858;
  transition: background 180ms ease;
  flex-shrink: 0;
}
.cc-panel__close:hover { background: #e2dad0; color: #1A2424; }
.cc-panel__close svg { width: 1rem; height: 1rem; }

/* Corps panneau */
.cc-panel__body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Ligne toggle */
.cc-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f8f5f0;
  border-radius: 12px;
  border: 1px solid #e2dad0;
}

.cc-toggle-info { flex: 1; }

.cc-toggle-name {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: #1A2424;
  margin-bottom: .3rem;
}

.cc-toggle-desc {
  font-size: .8rem;
  color: #4A5858;
  line-height: 1.55;
  margin: 0;
}

/* Switch toggle */
.cc-toggle-switch {
  flex-shrink: 0;
  cursor: pointer;
  margin-top: .1rem;
}

.cc-toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle-track {
  display: block;
  width: 3rem;
  height: 1.625rem;
  background: #c8bdb0;
  border-radius: 50px;
  position: relative;
  transition: background 200ms ease;
}

.cc-toggle-switch input:checked + .cc-toggle-track {
  background: #04999a;
}

.cc-toggle-thumb {
  position: absolute;
  top: .1875rem;
  left: .1875rem;
  width: 1.25rem;
  height: 1.25rem;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform 200ms ease;
}

.cc-toggle-switch input:checked + .cc-toggle-track .cc-toggle-thumb {
  transform: translateX(1.375rem);
}

.cc-toggle-switch input:focus-visible + .cc-toggle-track {
  outline: 3px solid #04999a;
  outline-offset: 2px;
}

/* Toujours actif */
.cc-toggle-switch--locked {
  cursor: default;
  align-self: center;
}

.cc-toggle-always {
  display: inline-block;
  padding: .25rem .75rem;
  background: #e0f5f5;
  color: #04999a;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 50px;
  white-space: nowrap;
}

/* Pied panneau */
.cc-panel__footer {
  padding: 0 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
}

.cc-panel__legal {
  font-size: .78rem;
  color: #7a8a8a;
  text-align: center;
  padding: 0 1.5rem 1.25rem;
  margin: 0;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes cc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cc-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes cc-scale-in {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cc-banner__inner {
    padding: 1.25rem 1rem 1rem;
  }

  .cc-banner__actions {
    flex-direction: column;
  }

  .cc-btn {
    width: 100%;
    justify-content: center;
    padding: .75rem 1rem;
  }

  .cc-toggle-row {
    flex-direction: column;
    gap: .75rem;
  }

  .cc-toggle-switch--locked {
    align-self: flex-start;
  }

  .cc-panel__footer {
    flex-direction: column;
  }
}
