/* =====================================================================
   Surtea — Cookie consent banner & modal
   ===================================================================== */

/* ─── Banner bas d'écran ────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  background: #fff;
  border-radius: var(--r-xl, 18px);
  box-shadow: 0 12px 40px rgba(8, 31, 77, 0.18), 0 0 0 1px rgba(8, 31, 77, 0.06);
  padding: 1.1rem 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  max-width: 1180px;
  margin: 0 auto;
  font-family: var(--font-body, system-ui, sans-serif);
}

.cookie-banner.is-visible { opacity: 1; transform: translateY(0); }

.cookie-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 280px;
}

.cookie-banner-text strong {
  display: block;
  font-family: var(--font-heading, sans-serif);
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy, #081F4D);
  margin-bottom: 0.3rem;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-body, #364153);
}

.cookie-banner-text a { font-weight: 600; }

.cookie-banner-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .cookie-banner { padding: 1rem 1.1rem; }
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-banner-actions { flex-direction: column; }
  .cookie-btn { width: 100%; }
}

/* ─── Boutons ──────────────────────────────────────────────────────── */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-md, 12px);
  font-family: var(--font-body, sans-serif);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 0;
  white-space: nowrap;
}

.cookie-btn-ghost {
  background: transparent;
  border: 2px solid var(--border-light, #E8ECF2);
  color: var(--navy, #081F4D);
}
.cookie-btn-ghost:hover { border-color: var(--blue, #1E96FC); color: var(--blue, #1E96FC); }

.cookie-btn-accept {
  background: linear-gradient(135deg, var(--blue, #1E96FC) 0%, var(--blue-hover, #0D87F0) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(30, 150, 252, 0.3);
}
.cookie-btn-accept:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30, 150, 252, 0.4); }

/* ─── Modal personnalisation ───────────────────────────────────────── */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 31, 77, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}

.cookie-modal-overlay.is-visible { opacity: 1; }

.cookie-modal-card {
  background: #fff;
  border-radius: var(--r-xl, 18px);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(8, 31, 77, 0.3);
  position: relative;
  font-family: var(--font-body, sans-serif);
}

@media (max-width: 540px) {
  .cookie-modal-card { padding: 1.5rem 1.25rem; }
}

.cookie-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  color: var(--text-muted, #6B7D8F);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cookie-modal-close:hover { background: var(--bg-gray, #F2F4F8); }

#cookie-modal-title {
  font-family: var(--font-heading, sans-serif);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--navy, #081F4D);
  margin: 0 0 0.5rem;
}

.cookie-modal-intro {
  color: var(--text-muted, #6B7D8F);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
  line-height: 1.55;
}

/* ─── Catégories ───────────────────────────────────────────────────── */
.cookie-cats {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.cookie-cat {
  background: var(--bg-cream, #F8F9FB);
  border: 1px solid var(--border-light, #E8ECF2);
  border-radius: var(--r-md, 12px);
  padding: 1rem 1.1rem;
}

.cookie-cat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin-bottom: 0.4rem;
}

.cookie-cat-head input { display: none; }

.cookie-switch {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  background: var(--border-mid, #D5DDE7);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.cookie-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.cookie-cat-head input:checked + .cookie-switch {
  background: var(--blue, #1E96FC);
}
.cookie-cat-head input:checked + .cookie-switch::after {
  transform: translateX(18px);
}

.cookie-cat-head input:disabled + .cookie-switch {
  background: var(--green, #35C593);
  cursor: not-allowed;
}
.cookie-cat-head input:disabled + .cookie-switch::after { transform: translateX(18px); }

.cookie-cat-label {
  font-weight: 700;
  color: var(--navy, #081F4D);
  font-size: 0.95rem;
}

.cookie-cat-label em {
  font-style: normal;
  color: var(--text-muted, #6B7D8F);
  font-weight: 500;
  font-size: 0.78rem;
}

.cookie-cat-desc {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text-muted, #6B7D8F);
  line-height: 1.55;
  padding-left: 54px;
}

.cookie-modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light, #E8ECF2);
}

@media (max-width: 540px) {
  .cookie-modal-actions { flex-direction: column-reverse; }
  .cookie-modal-actions .cookie-btn { width: 100%; }
}

/* ─── Bouton flottant permanent ─────────────────────────────────────── */
.cookie-reopen {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 9998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-mid, #D5DDE7);
  box-shadow: 0 4px 16px rgba(8, 31, 77, 0.12);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.cookie-reopen:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(8, 31, 77, 0.2);
}

@media (max-width: 720px) {
  .cookie-reopen { display: none; } /* on cache sur mobile pour ne pas gêner */
}
