/* ============================================================
   TEJO INVEST — cookies.css
   Bannière RGPD + Widget paramétrage
============================================================ */

/* ── BANNIÈRE ── */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 9999;
  width: min(780px, calc(100vw - 2rem));
  background: var(--ink);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15,28,46,0.35), 0 0 0 1px rgba(255,255,255,0.06);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease, visibility 0.35s;
}
.cookie-banner.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.4rem;
}
.cookie-banner-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: rgba(184,136,42,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light);
}
.cookie-banner-text { flex: 1; min-width: 0; }
.cookie-banner-title {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.2rem;
}
.cookie-banner-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
  margin: 0;
}
.cookie-banner-desc a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── BOUTONS ── */
.cookie-btn {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  transition: all 0.22s ease;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.cookie-btn-settings {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
}
.cookie-btn-settings:hover {
  background: rgba(255,255,255,0.14);
  color: var(--white);
}
.cookie-btn-reject {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}
.cookie-btn-reject:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}
.cookie-btn-accept {
  background: var(--gold);
  color: var(--white);
  border: 1px solid transparent;
}
.cookie-btn-accept:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(184,136,42,0.4);
}

/* ── BOUTON FLOTTANT ── */
.cookie-float-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9990;
  width: 42px; height: 42px;
  background: var(--ink);
  color: var(--gold-light);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(15,28,46,0.3);
  transition: all 0.25s ease;
  opacity: 0.75;
}
.cookie-float-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(15,28,46,0.4);
  background: var(--ink-2);
}

/* ── OVERLAY ── */
.cookie-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,28,46,0.5);
  z-index: 9997;
  backdrop-filter: blur(3px);
}
.cookie-overlay.open { display: block; }

/* ── PANEL LATÉRAL ── */
.cookie-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--white);
  z-index: 9998;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 48px rgba(15,28,46,0.18);
}
.cookie-panel.open {
  transform: translateX(0);
}

.cookie-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cookie-panel-title-wrap {
  display: flex; align-items: center; gap: 0.75rem;
}
.cookie-panel-icon {
  width: 36px; height: 36px;
  background: var(--gold-pale);
  border: 1px solid var(--gold-border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.cookie-panel-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.cookie-panel-close {
  width: 34px; height: 34px;
  background: var(--bg);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-3);
  transition: all 0.2s;
}
.cookie-panel-close:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.cookie-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0;
}
.cookie-panel-intro {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

/* Catégories */
.cookie-category {
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 0;
}
.cookie-category:last-child { border-bottom: none; }
.cookie-category-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.cookie-category-info { flex: 1; min-width: 0; }
.cookie-category-name {
  display: block;
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.cookie-category-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Toggle "Sempre ativo" */
.cookie-toggle--locked {
  flex-shrink: 0;
}
.cookie-toggle-label {
  font-family: var(--font-title);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-pale);
  border: 1px solid var(--gold-border);
  border-radius: 100px;
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
}

/* Toggle switch */
.cookie-toggle-switch {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.cookie-checkbox {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.cookie-slider {
  display: block;
  width: 46px; height: 26px;
  background: var(--bg-2);
  border-radius: 100px;
  border: 2px solid var(--border);
  transition: background 0.25s ease, border-color 0.25s ease;
  position: relative;
}
.cookie-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(15,28,46,0.2);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cookie-checkbox:checked + .cookie-slider {
  background: var(--gold);
  border-color: var(--gold);
}
.cookie-checkbox:checked + .cookie-slider::after {
  transform: translateX(20px);
}
.cookie-checkbox:focus-visible + .cookie-slider {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Footer panel */
.cookie-panel-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 0.7rem;
  flex-shrink: 0;
}
.cookie-panel-footer .cookie-btn {
  flex: 1; justify-content: center;
}
.cookie-panel-footer .cookie-btn-reject {
  background: var(--bg);
  color: var(--ink-3);
  border: 1.5px solid var(--border);
}
.cookie-panel-footer .cookie-btn-reject:hover {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--ink-3);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .cookie-banner {
    bottom: 0;
    left: 0; right: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .cookie-banner.visible {
    transform: translateY(0);
  }
  .cookie-banner-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .cookie-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .cookie-float-btn {
    bottom: 1rem;
    left: 1rem;
  }
  .cookie-panel {
    width: 100vw;
  }
}
