/* ============================================
   BRILLION STUDIO - COOKIE CONSENT
   GDPR-compliant banner + preferences modal
   ============================================ */

/* ---------- PAGE BACKDROP ---------- */
/* Applied while the consent banner is awaiting a choice. Content is still
   readable (light 6 px blur), still fully keyboard/link-accessible, and is
   not a "cookie wall" — crawlers index the DOM normally. */
html.cc-awaiting-choice body > *:not(.cc-banner):not(.cc-modal):not(.site-drawer) {
  filter: blur(6px);
  transition: filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: filter;
}
html body > *:not(.cc-banner):not(.cc-modal):not(.site-drawer) {
  transition: filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- BANNER ---------- */
.cc-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 820px;
  margin: 0 auto;
  z-index: 1300;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  transform: translateY(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
[data-theme="light"] .cc-banner {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}
.cc-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cc-banner__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.cc-banner__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.cc-banner__msg {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}
.cc-banner__msg a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cc-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.cc-btn--secondary {
  border-color: var(--border);
  color: var(--text-muted);
}
.cc-btn--secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.cc-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cc-btn--primary:hover { background: #e84a00; }
.cc-btn--text {
  padding: 10px 10px;
  color: var(--text-muted);
}
.cc-btn--text:hover { color: var(--text); }

/* ---------- MODAL ---------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cc-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.cc-modal__panel {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cc-modal.is-visible .cc-modal__panel {
  transform: translateY(0) scale(1);
}
.cc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cc-modal__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.cc-modal__title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--text);
}
.cc-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.25s ease;
}
.cc-modal__close:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: rotate(90deg);
}
.cc-modal__close::before,
.cc-modal__close::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}
.cc-modal__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.cc-modal__sub {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 28px;
}

/* ---------- CATEGORY ROWS ---------- */
.cc-cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--border-dim);
}
.cc-cat:last-of-type { border-bottom: 1px solid var(--border-dim); }
.cc-cat__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-cat__tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-dim);
}
[data-theme="light"] .cc-cat__tag {
  background: rgba(0, 0, 0, 0.04);
}
.cc-cat__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- TOGGLE (iOS-style) ---------- */
.cc-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.cc-toggle input:disabled {
  cursor: not-allowed;
}
.cc-toggle__track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.25s ease;
}
.cc-toggle__track::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.cc-toggle input:checked + .cc-toggle__track { background: var(--accent); }
.cc-toggle input:checked + .cc-toggle__track::before { transform: translateX(20px); }
.cc-toggle input:disabled + .cc-toggle__track { opacity: 0.55; }

/* ---------- MODAL FOOTER BUTTONS ---------- */
.cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.cc-modal__actions .cc-btn { flex: 1; min-width: 150px; }

/* ---------- MANAGE COOKIES TRIGGER (footer reopen link) ---------- */
.cc-reopen {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cc-reopen:hover { color: var(--text); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 720px) {
  .cc-banner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
    bottom: 14px;
    left: 14px;
    right: 14px;
  }
  .cc-banner__actions {
    flex-wrap: wrap;
  }
  .cc-banner__actions .cc-btn { flex: 1; }
  .cc-modal__panel { padding: 24px; }
  .cc-modal__title { font-size: 22px; }
}
