/* ── Cookie Consent System — Neodustria ── */

:root {
  --ck-navy:     #07090f;
  --ck-panel:    #0d1120;
  --ck-border:   #1a2240;
  --ck-blue:     #168BFF;
  --ck-blue-dk:  #005dba;
  --ck-text:     #c8d4e8;
  --ck-muted:    #6b7a9a;
  --ck-white:    #ffffff;
  --ck-green:    #22c55e;
  --ck-radius:   14px;
  --ck-radius-sm:8px;
  --ck-shadow:   0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(22,139,255,0.12);
  --ck-z:        9999;
}

/* ── Overlay ── */
.ck-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,9,15,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: calc(var(--ck-z) - 1);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ck-overlay.ck-visible { opacity: 1; }

/* ── Banner (State 1) ── */
.ck-banner {
  display: none;
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: min(420px, calc(100vw - 56px));
  background: var(--ck-panel);
  border: 1px solid var(--ck-border);
  border-radius: var(--ck-radius);
  box-shadow: var(--ck-shadow);
  padding: 24px;
  z-index: var(--ck-z);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.ck-banner.ck-visible {
  opacity: 1;
  transform: translateY(0);
}
.ck-banner-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ck-banner-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(22,139,255,0.12);
  border: 1px solid rgba(22,139,255,0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ck-banner-icon svg { width: 18px; height: 18px; }
.ck-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ck-white);
  letter-spacing: -0.01em;
  margin: 0;
}
.ck-banner-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ck-muted);
  margin: 0 0 20px;
}
.ck-banner-body a {
  color: var(--ck-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ck-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ck-banner-row {
  display: flex;
  gap: 8px;
}

/* ── Buttons ── */
.ck-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--ck-radius-sm);
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}
.ck-btn-primary {
  background: var(--ck-blue);
  color: #fff;
  flex: 1;
}
.ck-btn-primary:hover { background: #1a9aff; box-shadow: 0 0 20px rgba(22,139,255,0.3); }
.ck-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--ck-text);
  border: 1px solid var(--ck-border);
  flex: 1;
}
.ck-btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(22,139,255,0.3); }
.ck-btn-ghost {
  background: transparent;
  color: var(--ck-muted);
  width: 100%;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
}
.ck-btn-ghost:hover { color: var(--ck-text); }

/* ── Modal base ── */
.ck-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--ck-z);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ck-modal.ck-active { display: flex; }

.ck-modal-box {
  background: var(--ck-panel);
  border: 1px solid var(--ck-border);
  border-radius: var(--ck-radius);
  box-shadow: var(--ck-shadow);
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.ck-modal-box.ck-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Modal header ── */
.ck-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}
.ck-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ck-white);
  letter-spacing: -0.02em;
  margin: 0;
}
.ck-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--ck-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.ck-close:hover { background: rgba(255,255,255,0.12); border-color: rgba(22,139,255,0.3); }
.ck-close svg { width: 14px; height: 14px; stroke: var(--ck-muted); }

/* ── State 2: Preferences Modal ── */
.ck-prefs-modal .ck-modal-box { max-width: 520px; }
.ck-modal-desc {
  font-size: 13px;
  color: var(--ck-muted);
  line-height: 1.6;
  margin: 12px 24px 0;
}
.ck-categories {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ck-category {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--ck-border);
  border-radius: 10px;
  padding: 16px;
  transition: border-color 0.2s;
}
.ck-category:hover { border-color: rgba(22,139,255,0.2); }
.ck-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ck-category-meta { flex: 1; }
.ck-category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ck-white);
  margin: 0 0 3px;
}
.ck-category-desc {
  font-size: 12px;
  color: var(--ck-muted);
  margin: 0;
  line-height: 1.5;
}
.ck-category-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ck-details-link {
  font-size: 11px;
  color: var(--ck-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.ck-details-link:hover { color: #1a9aff; }

/* ── Toggle switch ── */
.ck-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.ck-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ck-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--ck-border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.ck-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.ck-toggle input:checked + .ck-toggle-track {
  background: var(--ck-blue);
  border-color: var(--ck-blue);
}
.ck-toggle input:checked + .ck-toggle-track::after { transform: translateX(20px); }
.ck-toggle input:disabled + .ck-toggle-track { opacity: 0.5; cursor: not-allowed; }
.ck-toggle input:focus-visible + .ck-toggle-track { outline: 2px solid var(--ck-blue); outline-offset: 2px; }

.ck-required-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--ck-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--ck-border);
  border-radius: 4px;
  padding: 3px 7px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ck-modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 8px;
}
.ck-modal-footer .ck-btn { flex: 1; }

/* ── State 3: Detailed Panel ── */
.ck-detail-modal .ck-modal-box {
  max-width: 720px;
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr auto;
  max-height: 580px;
}
.ck-detail-modal .ck-modal-header {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--ck-border);
  padding-bottom: 16px;
  margin-bottom: 0;
}
.ck-detail-nav {
  border-right: 1px solid var(--ck-border);
  padding: 16px 0;
  overflow-y: auto;
}
.ck-detail-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ck-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.ck-detail-nav-item:hover { color: var(--ck-text); background: rgba(255,255,255,0.03); }
.ck-detail-nav-item.ck-active {
  color: var(--ck-blue);
  border-left-color: var(--ck-blue);
  background: rgba(22,139,255,0.06);
}
.ck-detail-nav-toggle { flex-shrink: 0; }
.ck-detail-content {
  padding: 24px;
  overflow-y: auto;
}
.ck-detail-pane { display: none; }
.ck-detail-pane.ck-active { display: block; }
.ck-detail-pane-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ck-white);
  margin: 0 0 8px;
}
.ck-detail-pane-desc {
  font-size: 13px;
  color: var(--ck-muted);
  line-height: 1.6;
  margin: 0 0 20px;
}
.ck-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.ck-detail-meta-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--ck-border);
  border-radius: 8px;
  padding: 12px;
}
.ck-detail-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ck-muted);
  margin: 0 0 4px;
}
.ck-detail-meta-val {
  font-size: 12px;
  color: var(--ck-text);
  margin: 0;
  line-height: 1.4;
}
.ck-detail-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ck-muted);
  margin: 0 0 8px;
}
.ck-detail-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ck-detail-list li {
  font-size: 12px;
  color: var(--ck-text);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.ck-detail-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ck-blue);
}
.ck-detail-modal .ck-modal-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ck-border);
  padding: 16px 24px;
  margin-top: 0;
}

/* ── State 4: Purpose Detail ── */
.ck-purpose-modal .ck-modal-box { max-width: 480px; }
.ck-purpose-body { padding: 20px 24px; }
.ck-purpose-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ck-blue);
  background: rgba(22,139,255,0.1);
  border: 1px solid rgba(22,139,255,0.25);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.ck-purpose-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ck-white);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.ck-purpose-text {
  font-size: 13px;
  color: var(--ck-muted);
  line-height: 1.65;
  margin: 0 0 20px;
}
.ck-purpose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.ck-purpose-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--ck-border);
  border-radius: 8px;
  padding: 12px;
}
.ck-purpose-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ck-muted);
  margin: 0 0 4px;
}
.ck-purpose-card-val {
  font-size: 12px;
  color: var(--ck-text);
  margin: 0;
}
.ck-purpose-footer {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--ck-border);
}
.ck-purpose-footer .ck-btn { flex: 1; }

/* ── State 5: Confirmation ── */
.ck-confirm-modal .ck-modal-box { max-width: 460px; }
.ck-confirm-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--ck-radius) var(--ck-radius) 0 0;
  display: block;
}
.ck-confirm-body { padding: 28px 28px 8px; text-align: center; }
.ck-confirm-check {
  width: 52px;
  height: 52px;
  background: rgba(34,197,94,0.12);
  border: 2px solid var(--ck-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.ck-confirm-check svg { width: 24px; height: 24px; stroke: var(--ck-green); }
.ck-confirm-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ck-white);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.ck-confirm-text {
  font-size: 13px;
  color: var(--ck-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}
.ck-confirm-summary {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.ck-confirm-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 4px 10px;
}
.ck-confirm-badge.on {
  color: var(--ck-green);
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
}
.ck-confirm-badge.off {
  color: var(--ck-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ck-border);
}
.ck-confirm-footer {
  padding: 0 28px 28px;
}
.ck-confirm-footer .ck-btn { width: 100%; }

/* ── State 6: Toast Notification ── */
.ck-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ck-panel);
  border: 1px solid rgba(22,139,255,0.35);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(22,139,255,0.1);
  padding: 14px 18px;
  z-index: calc(var(--ck-z) + 1);
  display: none;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  min-width: 260px;
  max-width: 340px;
}
.ck-toast.ck-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ck-toast-icon {
  width: 28px;
  height: 28px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ck-toast-icon svg { width: 14px; height: 14px; stroke: var(--ck-green); }
.ck-toast-body { flex: 1; min-width: 0; }
.ck-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ck-white);
  margin: 0 0 2px;
}
.ck-toast-link {
  font-size: 11px;
  color: var(--ck-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ck-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--ck-blue);
  border-radius: 0 0 10px 10px;
  transition: width linear;
}

/* ── Scrollbar ── */
.ck-modal-box::-webkit-scrollbar,
.ck-detail-nav::-webkit-scrollbar,
.ck-detail-content::-webkit-scrollbar { width: 4px; }
.ck-modal-box::-webkit-scrollbar-track,
.ck-detail-nav::-webkit-scrollbar-track,
.ck-detail-content::-webkit-scrollbar-track { background: transparent; }
.ck-modal-box::-webkit-scrollbar-thumb,
.ck-detail-nav::-webkit-scrollbar-thumb,
.ck-detail-content::-webkit-scrollbar-thumb {
  background: rgba(22,139,255,0.25);
  border-radius: 4px;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .ck-banner {
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: var(--ck-radius) var(--ck-radius) 0 0;
  }
  .ck-modal { padding: 0; align-items: flex-end; }
  .ck-modal-box {
    border-radius: var(--ck-radius) var(--ck-radius) 0 0;
    max-height: 88vh;
  }
  .ck-detail-modal .ck-modal-box {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }
  .ck-detail-nav {
    border-right: none;
    border-bottom: 1px solid var(--ck-border);
    display: flex;
    overflow-x: auto;
    padding: 0;
    gap: 0;
  }
  .ck-detail-nav-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    justify-content: center;
  }
  .ck-detail-nav-item.ck-active {
    border-left-color: transparent;
    border-bottom-color: var(--ck-blue);
  }
  .ck-detail-nav-toggle { display: none; }
  .ck-detail-meta { grid-template-columns: 1fr; }
  .ck-purpose-grid { grid-template-columns: 1fr; }
  .ck-toast {
    right: 0;
    bottom: 0;
    left: 0;
    max-width: 100%;
    border-radius: var(--ck-radius) var(--ck-radius) 0 0;
  }
}
