/* ════════════════════════════════════════════════════════════════
   TY TAN PENMARCH — Bandeau de consentement cookies (RGPD / CNIL)
   Chargé par index.html ET par les pages légales.
   Les variables de couleur sont redéclarées en fallback pour que la
   feuille reste autonome si elle est chargée seule.
   ════════════════════════════════════════════════════════════════ */

.cc-banner,
.cc-modal {
  font-family: var(--sans, 'Jost', system-ui, sans-serif);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.78);
}

/* ══════════════
   BANDEAU
══════════════ */
.cc-banner {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 900;
  width: min(420px, calc(100vw - 3rem));
  background: var(--navy, #0B1F3A);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 1.6rem 1.7rem 1.5rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.cc-banner.cc-visible { opacity: 1; transform: translateY(0); }

.cc-title {
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}
.cc-text {
  font-size: 0.83rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.66);
  margin-bottom: 1.2rem;
}
.cc-text a {
  color: var(--sand-light, #E4D2B4);
  text-decoration: none;
  border-bottom: 1px solid rgba(228, 210, 180, 0.4);
}
.cc-text a:hover { border-bottom-color: var(--sand-light, #E4D2B4); }

/* ══════════════
   BOUTONS
   « Tout accepter » et « Tout refuser » ont volontairement le même
   poids visuel : exigence CNIL (refuser doit être aussi simple).
══════════════ */
.cc-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.cc-btn {
  flex: 1 1 auto;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.78rem 1.1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.cc-btn-accept,
.cc-btn-refuse {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.9);
}
.cc-btn-accept:hover,
.cc-btn-refuse:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}
.cc-btn-settings {
  flex: 1 1 100%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 0 0;
  text-align: center;
}
.cc-btn-settings:hover { color: rgba(255, 255, 255, 0.85); }

/* ══════════════
   MODALE DE RÉGLAGES
══════════════ */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 12, 22, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cc-modal.cc-open { display: flex; }
.cc-modal-box {
  background: var(--navy, #0B1F3A);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.2rem 2.2rem 1.8rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.cc-modal-close {
  float: right;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 1rem;
}
.cc-modal-close:hover { color: #FFFFFF; }

.cc-cat {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.3rem 0;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  justify-content: space-between;
}
.cc-cat-name {
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 0.35rem;
}
.cc-cat-desc {
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.58);
}
.cc-cat-desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  color: var(--sand-light, #E4D2B4);
}

/* interrupteur */
.cc-switch { position: relative; flex-shrink: 0; width: 46px; height: 26px; }
.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.cc-switch .cc-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  transition: background 0.25s;
  pointer-events: none;
}
.cc-switch .cc-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.25s;
}
.cc-switch input:checked + .cc-slider { background: var(--horizon, #2868A0); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider {
  outline: 2px solid var(--sand, #C4A97D);
  outline-offset: 2px;
}
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-slider { background: rgba(255, 255, 255, 0.28); opacity: 0.6; }

.cc-modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.4rem;
}
.cc-note {
  font-size: 0.72rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.42);
  padding-top: 1rem;
}
.cc-note a { color: rgba(255, 255, 255, 0.6); text-decoration: underline; }

/* bouton « gérer mes cookies » posé dans une page */
.cc-inline-btn {
  display: inline-block;
  font-family: var(--sans, 'Jost', system-ui, sans-serif);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy, #0B1F3A);
  background: none;
  border: 1px solid rgba(11, 31, 58, 0.35);
  border-radius: 3px;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.cc-inline-btn:hover { background: rgba(11, 31, 58, 0.06); border-color: var(--navy, #0B1F3A); }

/* ══════════════
   MOBILE
══════════════ */
@media (max-width: 600px) {
  .cc-banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    padding: 1.4rem 1.3rem 1.2rem;
  }
  .cc-btn { flex: 1 1 100%; }
  .cc-modal-box { padding: 1.7rem 1.4rem 1.4rem; }
  .cc-cat { flex-direction: row; gap: 0.9rem; }
}

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