/* ============================================
   Cookie banner — Atôlier Class Car
   Custom, RGPD/CNIL compliant, Consent Mode v2
   ============================================ */

:root {
  --cb-radius: 16px;
  --cb-shadow: 0 24px 60px rgba(0,0,0,0.25);
}

/* ---------- Backdrop (used by modal only) ---------- */
.cb-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.cb-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* ---------- Bottom banner (discreet) ---------- */
.cb-banner {
  position: fixed;
  left: 24px; right: 24px; bottom: 24px;
  max-width: 1100px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  padding: 24px 28px;
  z-index: 9999;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  transform: translateY(calc(100% + 48px));
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.cb-banner.is-open { transform: translateY(0); }
.cb-banner .cb-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0a0a0a;
  margin-bottom: 8px;
}
.cb-banner .cb-icon::before {
  content: '';
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #ffd60a;
  background-image: radial-gradient(circle at 30% 30%, rgba(0,0,0,0.15) 2px, transparent 3px),
                    radial-gradient(circle at 70% 50%, rgba(0,0,0,0.15) 2px, transparent 3px),
                    radial-gradient(circle at 45% 75%, rgba(0,0,0,0.15) 2px, transparent 3px);
}
.cb-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4a4a4a;
  max-width: 700px;
}
.cb-banner p a {
  color: #0a0a0a;
  border-bottom: 1.5px solid #ffd60a;
  text-decoration: none;
}
.cb-banner p a:hover { background: #ffd60a; }

.cb-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  min-width: 180px;
}
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s ease;
  font-family: inherit;
  white-space: nowrap;
}
.cb-btn-primary { background: #ffd60a; color: #0a0a0a; }
.cb-btn-primary:hover { background: #e6c000; transform: translateY(-1px); }
.cb-btn-secondary { background: #ffffff; color: #0a0a0a; border-color: #d6d6d6; }
.cb-btn-secondary:hover { border-color: #0a0a0a; }
.cb-btn-text {
  background: transparent;
  color: #4a4a4a;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 12px;
}
.cb-btn-text:hover { color: #0a0a0a; }

/* ---------- Modal (personnalisation) ---------- */
.cb-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  z-index: 9999;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.cb-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.cb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cb-modal-header h3 {
  font-family: 'Anton', sans-serif;
  font-size: 24px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0a0a0a;
  margin: 0;
  font-weight: 400;
}
.cb-close {
  background: transparent;
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  color: #4a4a4a;
  transition: background .15s;
}
.cb-close:hover { background: #f4f4f4; }
.cb-close svg { width: 18px; }
.cb-modal-intro {
  font-size: 14px;
  line-height: 1.6;
  color: #4a4a4a;
  margin-bottom: 24px;
}
.cb-modal-intro a { color: #0a0a0a; border-bottom: 1.5px solid #ffd60a; text-decoration: none; }

.cb-category {
  border-top: 1px solid #f4f4f4;
  padding: 20px 0;
}
.cb-category:last-of-type { border-bottom: 1px solid #f4f4f4; margin-bottom: 24px; }
.cb-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.cb-category-title {
  font-weight: 700;
  font-size: 15px;
  color: #0a0a0a;
  margin: 0;
}
.cb-category-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #4a4a4a;
  margin: 0;
}
.cb-category-required {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a4a4a;
  padding: 6px 12px;
  background: #f4f4f4;
  border-radius: 999px;
}

/* Toggle switch */
.cb-toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.cb-toggle input {
  position: absolute; opacity: 0;
  width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.cb-toggle .cb-slider {
  position: absolute; inset: 0;
  background: #d6d6d6;
  border-radius: 999px;
  transition: background .2s;
  cursor: pointer;
}
.cb-toggle .cb-slider::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cb-toggle input:checked + .cb-slider { background: #0a0a0a; }
.cb-toggle input:checked + .cb-slider::before { transform: translateX(20px); }
.cb-toggle input:disabled + .cb-slider { background: #ffd60a; opacity: 0.6; cursor: not-allowed; }

.cb-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cb-modal-actions .cb-btn { flex: 1; min-width: 130px; }

/* ---------- Floating reopen button ---------- */
.cb-reopen {
  position: fixed;
  left: 20px; bottom: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 2px solid #ffd60a;
  color: #ffd60a;
  display: grid; place-items: center;
  cursor: pointer;
  z-index: 9997;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform .2s, opacity .2s;
  opacity: 0;
  pointer-events: none;
}
.cb-reopen.is-visible { opacity: 1; pointer-events: auto; }
.cb-reopen:hover { transform: scale(1.08); }
.cb-reopen svg { width: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .cb-banner {
    grid-template-columns: 1fr;
    left: 12px; right: 12px; bottom: 12px;
    padding: 20px;
    gap: 16px;
  }
  .cb-actions { min-width: 0; }
  .cb-modal { padding: 24px; }
  .cb-modal-actions { flex-direction: column; }
  .cb-reopen { left: 12px; bottom: 12px; }
}
