/* ==========================================================================
   GDPR Cookie Consent Banner & Settings Modal
   Reusable, self-contained, WCAG AA compliant, zero layout shift.
   Theme tokens match Golvkreatör Sverige AB (#1a1a1a / #f28b1a).
   ========================================================================== */

:root {
  --cc-bg: #1a1a1a;
  --cc-surface: #242424;
  --cc-border: rgba(255, 255, 255, 0.14);
  --cc-text: #ffffff;
  --cc-text-muted: rgba(255, 255, 255, 0.78);
  --cc-accent: #f28b1a;
  --cc-accent-hover: #ff9c33;
  --cc-accent-text: #141414;
  --cc-radius: 2px;
  --cc-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --cc-font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --cc-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --cc-z-banner: 9990;
  --cc-z-modal: 9999;
}

.cc-hidden {
  display: none !important;
}

/* Bottom Cookie Banner */
.cc-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--cc-z-banner);
  max-width: 72rem;
  margin: 0 auto;
  background: rgba(26, 26, 26, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-left: 4px solid var(--cc-accent);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 1.25rem 1.5rem;
  font-family: var(--cc-font-sans);
  line-height: 1.55;
}

.cc-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cc-banner__title {
  margin: 0 0 0.35rem 0;
  font-family: var(--cc-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cc-text);
  letter-spacing: -0.01em;
}

.cc-banner__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--cc-text-muted);
}

.cc-banner__link {
  color: var(--cc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.cc-banner__link:hover {
  color: var(--cc-accent-hover);
}

.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

/* Buttons */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cc-font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.7rem 1.15rem;
  border-radius: var(--cc-radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  min-height: 44px;
  white-space: nowrap;
}

.cc-btn:focus-visible,
.cc-banner__link:focus-visible,
.cc-modal__close:focus-visible,
.cc-switch__input:focus-visible + .cc-switch__slider {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.cc-btn--primary {
  background-color: var(--cc-accent);
  color: var(--cc-accent-text);
  border-color: var(--cc-accent);
}

.cc-btn--primary:hover {
  background-color: var(--cc-accent-hover);
  border-color: var(--cc-accent-hover);
}

.cc-btn--secondary {
  background-color: transparent;
  color: var(--cc-text);
  border-color: rgba(255, 255, 255, 0.35);
}

.cc-btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.65);
}

.cc-btn--ghost {
  background-color: transparent;
  color: var(--cc-text-muted);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.cc-btn--ghost:hover {
  color: var(--cc-text);
}

/* Settings Modal Overlay */
.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--cc-z-modal);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cc-modal {
  width: 100%;
  max-width: 34rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-top: 3px solid var(--cc-accent);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: 1.5rem;
  font-family: var(--cc-font-sans);
}

.cc-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cc-modal__title {
  margin: 0;
  font-family: var(--cc-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cc-text);
}

.cc-modal__close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--cc-text);
  width: 36px;
  height: 36px;
  border-radius: var(--cc-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.cc-modal__close:hover {
  border-color: var(--cc-accent);
  color: var(--cc-accent);
}

.cc-modal__intro {
  margin: 0 0 1.25rem 0;
  font-size: 0.875rem;
  color: var(--cc-text-muted);
  line-height: 1.6;
}

.cc-category {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.cc-category__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.cc-category__name {
  font-family: var(--cc-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cc-text);
  margin: 0;
}

.cc-category__badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cc-accent);
}

.cc-category__desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--cc-text-muted);
  line-height: 1.5;
}

/* Toggle Switch */
.cc-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.cc-switch__input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cc-switch__slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.cc-switch__slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cc-switch__input:checked + .cc-switch__slider {
  background-color: var(--cc-accent);
}

.cc-switch__input:checked + .cc-switch__slider::before {
  transform: translateX(20px);
  background-color: #141414;
}

.cc-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cc-border);
}

@media (min-width: 768px) {
  .cc-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .cc-banner__content {
    max-width: 44rem;
  }

  .cc-banner__actions {
    flex-shrink: 0;
  }
}

@media (max-width: 639px) {
  .cc-banner {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 1rem 1.125rem;
  }

  .cc-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-btn {
    width: 100%;
  }

  .cc-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-btn,
  .cc-switch__slider,
  .cc-switch__slider::before,
  .gk-lang-btn {
    transition: none;
  }
}

/* ==========================================================================
   Language Switcher (SV | EN | PL) & Utility Styles
   Self-contained CSS (no uncompiled Tailwind dependencies).
   ========================================================================== */

.gk-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  flex-shrink: 0;
}

.gk-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  font-family: var(--cc-font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gk-lang-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.gk-lang-btn.is-active,
.gk-lang-btn[aria-pressed="true"] {
  background-color: var(--cc-accent);
  color: var(--cc-accent-text);
}

.gk-lang-btn:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

.gk-lang-switcher--mobile {
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.gk-lang-switcher--mobile .gk-lang-btn {
  min-width: 54px;
  height: 40px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.gk-policy-nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  min-height: 5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  gap: 0.5rem 1rem;
}

.gk-policy-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gk-form-feedback {
  padding: 0.875rem 1rem;
  background: rgba(242, 139, 26, 0.12);
  border-left: 3px solid var(--cc-accent);
  color: #1a1a1a;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 2px;
}

@media (max-width: 639px) {
  .gk-policy-back-label {
    display: none;
  }
}

/* Keep full-screen mobile menu above the cookie banner (9990) and below the cookie modal (9999) */
#mobileMenu {
  z-index: 9995 !important;
}
