/* =========================================================
   NORDSAFE — COOKIE CONSENT SYSTEM
   DSGVO-konform · Google Consent Mode v2
   ========================================================= */

/* ============ BANNER ============ */
#ns-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: #0d0d0d;
  border-top: 1px solid rgba(201, 162, 39, 0.3);
  padding: 28px 0;
  transform: translateY(110%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.65);
}
#ns-cookie-banner.ns-visible { transform: translateY(0); }

.ns-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.ns-banner-text h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ns-banner-text p {
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
  max-width: 680px;
}
.ns-banner-text p a {
  color: #C9A227;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ns-banner-text p a:hover { color: #d4b347; }

.ns-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  align-items: stretch;
  min-width: 200px;
}

/* ============ BUTTONS ============ */
.ns-btn-accept {
  display: block;
  background: #C9A227;
  color: #000000;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 13px 24px;
  border: 1px solid #C9A227;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}
.ns-btn-accept:hover { background: #d4b347; border-color: #d4b347; transform: translateY(-1px); }
.ns-btn-accept:active { transform: translateY(0); }

.ns-btn-necessary {
  display: block;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.ns-btn-necessary:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }

.ns-btn-settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 0;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  transition: color 0.2s;
}
.ns-btn-settings:hover { color: #C9A227; }

/* ============ MODAL BACKDROP ============ */
#ns-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#ns-cookie-modal.ns-open {
  opacity: 1;
  visibility: visible;
}

.ns-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* ============ MODAL BOX ============ */
.ns-modal-box {
  position: relative;
  z-index: 1;
  background: #111111;
  border: 1px solid rgba(201, 162, 39, 0.22);
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75);
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.25) transparent;
}
#ns-cookie-modal.ns-open .ns-modal-box { transform: translateY(0); }
.ns-modal-box::-webkit-scrollbar { width: 4px; }
.ns-modal-box::-webkit-scrollbar-track { background: transparent; }
.ns-modal-box::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.25); border-radius: 2px; }

.ns-modal-header {
  padding: 28px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 20px;
}
.ns-modal-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ns-modal-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ns-modal-close:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.ns-modal-close svg { width: 16px; height: 16px; }

.ns-modal-body { padding: 20px 28px; }

.ns-modal-intro {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ============ CATEGORY ITEMS ============ */
.ns-category {
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.ns-category:hover { border-color: rgba(255, 255, 255, 0.13); }
.ns-category.ns-open { border-color: rgba(201, 162, 39, 0.2); }

.ns-cat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
}
.ns-cat-header:hover { background: rgba(255, 255, 255, 0.025); }

.ns-cat-info { flex: 1; min-width: 0; }
.ns-cat-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.ns-badge-always {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(201, 162, 39, 0.12);
  color: #C9A227;
  padding: 2px 7px;
  border: 1px solid rgba(201, 162, 39, 0.25);
}
.ns-cat-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.5;
}

/* Chevron */
.ns-cat-chevron {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  transition: transform 0.25s ease;
  margin-left: auto;
}
.ns-category.ns-open .ns-cat-chevron { transform: rotate(180deg); }

/* Toggle switch */
.ns-toggle {
  position: relative;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}
.ns-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ns-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.ns-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
}
.ns-toggle input:checked + .ns-toggle-track { background: #C9A227; }
.ns-toggle input:checked + .ns-toggle-track::after {
  transform: translateX(20px);
  background: #000000;
}
.ns-toggle input:disabled + .ns-toggle-track { cursor: not-allowed; opacity: 0.6; }
.ns-toggle input:focus-visible + .ns-toggle-track {
  outline: 2px solid #C9A227;
  outline-offset: 2px;
}

/* Category details (expanded) */
.ns-cat-details {
  display: none;
  padding: 0 18px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.ns-category.ns-open .ns-cat-details { display: block; }
.ns-cat-details p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.47);
  line-height: 1.75;
  margin-top: 12px;
}
.ns-cat-details table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 11.5px;
}
.ns-cat-details th,
.ns-cat-details td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.45);
  vertical-align: top;
}
.ns-cat-details th {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============ MODAL FOOTER ============ */
.ns-modal-footer {
  padding: 16px 28px 28px;
  display: flex;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}
.ns-modal-footer .ns-btn-necessary { flex: 1; }
.ns-modal-footer .ns-btn-save { flex: 1; }
.ns-modal-footer .ns-btn-accept-all { flex: 2; }

/* ============ FOOTER TRIGGER ============ */
.ns-footer-trigger {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s;
  display: inline;
}
.ns-footer-trigger:hover { color: #C9A227; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .ns-banner-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .ns-banner-actions { flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .ns-btn-accept, .ns-btn-necessary { flex: 1; }
  .ns-btn-settings { flex: 0 0 100%; }
}
@media (max-width: 600px) {
  .ns-banner-inner { padding: 0 16px; }
  #ns-cookie-banner { padding: 20px 0; }
  .ns-banner-actions { flex-direction: column; }
  .ns-btn-accept, .ns-btn-necessary { flex: none; }
  .ns-modal-header { padding: 20px 18px 16px; }
  .ns-modal-body { padding: 16px 18px; }
  .ns-modal-footer { padding: 14px 18px 22px; flex-direction: column; }
  .ns-modal-footer .ns-btn-necessary,
  .ns-modal-footer .ns-btn-save,
  .ns-modal-footer .ns-btn-accept-all { flex: none; }
  .ns-cat-header { padding: 12px 14px; }
  .ns-cat-details { padding: 0 14px 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #ns-cookie-banner,
  #ns-cookie-modal,
  .ns-modal-box,
  .ns-toggle-track,
  .ns-toggle-track::after,
  .ns-cat-chevron { transition-duration: 0.01ms !important; }
}
