/* ============================================================
   WTS Byg – Cookie Consent Modal
   Matches brand design system (dark green, --radius-xl, etc.)
   ============================================================ */

#wts-cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#wts-cookie-modal {
  background: #0e2612;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2rem 2rem 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* ── Header ── */
.wts-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.wts-modal-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.wts-modal-title {
  color: #ffffff !important;
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.wts-modal-body {
  color: rgba(255, 255, 255, 0.72) !important;
  font-size: 0.9rem !important;
  line-height: 1.65 !important;
  margin: 0 0 1.5rem !important;
}

/* ── Categories ── */
#wts-categories {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  margin-bottom: 1.25rem;
}

.wts-category {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.wts-category:last-child {
  border-bottom: none;
}

.wts-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.wts-category-name {
  color: #ffffff !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  display: block !important;
  margin-bottom: 0.3rem !important;
}

.wts-category-desc {
  color: rgba(255, 255, 255, 0.55) !important;
  font-size: 0.78rem !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

/* ── Always-on badge ── */
.wts-toggle-always {
  color: #0DE85C;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

/* ── Toggle switch ── */
.wts-toggle-wrap {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
}

.wts-toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.wts-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  transition: background 0.25s;
}

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

.wts-toggle-input:checked + .wts-toggle-slider {
  background: #0DE85C;
}

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

.wts-toggle-input:focus-visible + .wts-toggle-slider {
  outline: 2px solid #0DE85C;
  outline-offset: 2px;
}

/* ── Buttons ── GDPR-compliant: Accept and Reject must be equally prominent ── */
.wts-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.wts-btn {
  flex: 1;
  width: auto;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: inherit;
  line-height: 1.2;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff !important;
}

.wts-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Both buttons share identical styling — no preferential treatment */
.wts-btn-primary,
.wts-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.25);
}

.wts-btn-primary:hover,
.wts-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Save-button (inside "Tilpas indstillinger") — full width green to confirm action */
#wts-save {
  background: #0DE85C !important;
  color: #0a1f0e !important;
  border-color: #0DE85C !important;
  flex: none;
}

#wts-save:hover {
  background: #0bc44d !important;
  border-color: #0bc44d !important;
}

/* ── Floating sticky cookie button ── */
#wts-cookie-float {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0e2612;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  padding: 0;
  font-family: inherit;
}

#wts-cookie-float:hover {
  background: #133117;
  border-color: rgba(13, 232, 92, 0.6);
  transform: translateY(-2px);
}

#wts-cookie-float svg {
  width: 22px;
  height: 22px;
  display: block;
}

@media (max-width: 520px) {
  #wts-cookie-float {
    bottom: 1rem;
    left: 1rem;
    width: 42px;
    height: 42px;
  }
  .wts-buttons { flex-direction: column; }
  .wts-btn { padding: 0.85rem 1.5rem; }
}

/* ── Customize link ── */
.wts-link-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0;
  font-family: inherit;
  text-decoration: underline;
  width: 100%;
  text-align: center;
  display: block;
  transition: color 0.2s;
}

.wts-link-btn:hover {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* ── Legal links ── */
.wts-legal-links {
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 0.75rem !important;
  text-align: center;
  margin: 1rem 0 0 !important;
  line-height: 1.5;
}

.wts-legal-links a {
  color: #0DE85C !important;
  text-decoration: none;
}

.wts-legal-links a:hover {
  text-decoration: underline;
}

/* ── Mobile: slide up from bottom ── */
@media (max-width: 520px) {
  #wts-cookie-overlay {
    align-items: flex-end;
    padding: 0;
  }

  #wts-cookie-modal {
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 1.25rem 1.5rem;
    max-height: 88vh;
  }
}
