/* ════════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER  (vx-cookie-banner)
   ════════════════════════════════════════════════════════════════ */

/* ── Banner card (bottom-of-viewport floating card) ─────────── */
#vx-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-cookie, 600);
  width: calc(100% - 48px);
  max-width: 780px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(15, 10, 30, 0.14), 0 2px 8px rgba(15, 10, 30, 0.06);
  animation: vxcb-slide-up 0.30s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#vx-cookie-banner:not(.u-hidden) {
  display: block;
}

@keyframes vxcb-slide-up {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.vxcb-inner {
  position: relative;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Content block ────────────────────────────────────────────── */
.vxcb-content {
  padding-right: 32px; /* room for × close button */
}

.vxcb-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  margin: 0 0 10px;
  line-height: 1.3;
}

.vxcb-body {
  font-size: 0.845rem;
  color: var(--color-text-body);
  line-height: 1.7;
  margin: 0;
}

.vxcb-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(181, 23, 158, 0.35);
  text-underline-offset: 2px;
  font-weight: 500;
}
.vxcb-link:hover {
  text-decoration-color: var(--color-primary);
}

/* ── Button row ───────────────────────────────────────────────── */
.vxcb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Close button (top-right corner of banner) ──────────────── */
.vxcb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.vxcb-close:hover {
  background: var(--color-neutral-100);
  color: var(--color-text);
}
.vxcb-close:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Shared button base ───────────────────────────────────────── */
.vxcb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  line-height: 1.2;
}

/* Primary — gradient fill */
.vxcb-btn--primary {
  background: var(--gradient-hero);
  color: #fff;
  border-color: transparent;
}
.vxcb-btn--primary:hover {
  box-shadow: 0 4px 18px rgba(106, 13, 173, 0.30);
  filter: brightness(1.06);
}
.vxcb-btn--primary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Secondary — outlined */
.vxcb-btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.vxcb-btn--secondary:hover {
  border-color: #c4b5d4;
  background: var(--color-neutral-100);
}
.vxcb-btn--secondary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Ghost — subtle text link style */
.vxcb-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  padding-left: 8px;
  padding-right: 8px;
  font-weight: 500;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(107, 114, 128, 0.4);
}
.vxcb-btn--ghost:hover {
  color: var(--color-text);
  text-decoration-color: var(--color-text);
}
.vxcb-btn--ghost:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  #vx-cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation-name: vxcb-slide-up-mobile;
  }

  @keyframes vxcb-slide-up-mobile {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .vxcb-inner {
    padding: 20px 20px 24px;
  }

  .vxcb-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .vxcb-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }
}


/* ════════════════════════════════════════════════════════════════
   COOKIE SETTINGS MODAL  (vx-cookie-modal)
   ════════════════════════════════════════════════════════════════ */

#vx-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-cookie, 600) + 1);
  align-items: flex-end;
  justify-content: center;
  animation: vxcm-fade-in 0.2s ease both;
}

#vx-cookie-modal:not(.u-hidden) {
  display: flex;
}

@keyframes vxcm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Semi-transparent overlay */
.vxcm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 30, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
}

/* Modal card */
.vxcm-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -8px 48px rgba(15, 10, 30, 0.20);
  animation: vxcm-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes vxcm-slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Header */
.vxcm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  z-index: 2;
}

.vxcm-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.vxcm-close {
  background: var(--color-neutral-100);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.vxcm-close:hover  { background: var(--color-border); color: var(--color-text); }
.vxcm-close:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* Body */
.vxcm-body {
  padding: 18px 24px;
}

.vxcm-intro {
  font-size: 0.82rem;
  color: var(--color-text-body);
  line-height: 1.65;
  margin: 0 0 16px;
}

/* Individual consent row */
.vxcm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
}

.vxcm-row-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 0;
  min-width: 0;
}

.vxcm-row-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text);
}

.vxcm-row-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Toggle switch */
.vxcm-toggle {
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.vxcm-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.vxcm-slider {
  display: block;
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 100px;
  transition: background 0.2s;
  position: relative;
}

.vxcm-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}

.vxcm-toggle input:checked + .vxcm-slider {
  background: var(--gradient-hero);
}

.vxcm-toggle input:checked + .vxcm-slider::after {
  transform: translateX(20px);
}

.vxcm-toggle input:focus-visible + .vxcm-slider {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Locked (necessary) toggle */
.vxcm-toggle--locked {
  cursor: default;
}

.vxcm-always-on {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(181, 23, 158, 0.08);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* Footer */
.vxcm-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.vxcm-footer .vxcb-btn {
  flex: 1 1 120px;
}

/* ── Responsive modal ─────────────────────────────────────────── */
@media (min-width: 600px) {
  .vxcm-box {
    border-radius: 16px;
    margin-bottom: 24px;
    margin-left: 16px;
    margin-right: 16px;
  }
  #vx-cookie-modal {
    align-items: center;
  }
}

/* ── Focus trap when cookie banner is active ────────────────────
   Prevents keyboard users bypassing consent (GDPR compliance).
   JS adds data-cookie-active to body when banner is shown.
─────────────────────────────────────────────────────────────────*/
body[data-cookie-active] main,
body[data-cookie-active] header,
body[data-cookie-active] footer {
  pointer-events: none;
  user-select: none;
}
body[data-cookie-active] #vx-cookie-banner {
  pointer-events: auto;
  user-select: auto;
}