/* =========================================================================
   Tecnovap - Cookie-consent (banner nere till vänster + flytande knapp).
   Re-skinnad från wp-consent-ga4-skillen till Tecnovap-identiteten:
   mörk yta (#2a2a2a, som footern), gul accent (#fff000), Poppins, vit text.

   CRITICAL GOTCHA (radera inte första regeln): kategoripanelen + save-row
   startar stängda via [hidden]-attributet, men .tv-consent-cats sätter
   display:flex. Ett explicit display vinner över [hidden] → utan reset-regeln
   syns panelen som default. Behåll .tv-consent-cats[hidden]{display:none}.
   ========================================================================= */

/* ---------- Banner-skal (fixed, nere till vänster) ---------- */
.tv-consent {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1001;
  width: min(340px, calc(100vw - 40px));
  /* dold tills is-visible */
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity .4s ease, transform .4s ease, visibility 0s linear .4s;
  font-family: 'Poppins', system-ui, sans-serif;
}
.tv-consent.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .4s ease, transform .4s ease;
}
.tv-consent[data-reduce="1"],
.tv-consent[data-reduce="1"].is-visible {
  transition: none;
}

/* ---------- Kortet (mörk yta) ---------- */
.tv-consent-card {
  position: relative;
  padding: 20px 22px 18px;
  border-radius: 14px;
  background: rgba(42, 42, 42, .97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 240, 0, .28);
  box-shadow: 0 24px 60px -22px rgba(0, 0, 0, .7);
  color: var(--c-inverse, #ffffff);
}

.tv-consent-kicker {
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--c-yellow, #fff000);
}
.tv-consent-title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  color: var(--c-inverse, #ffffff);
}
.tv-consent-text {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .82);
}
.tv-consent-link {
  color: var(--c-yellow, #fff000);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.tv-consent-link:hover { color: var(--c-yellow-hover, #f5d800); }

/* ---------- Kategorier (inställningspanel) ---------- */
/* [hidden] måste vinna över display:flex (annars syns panelen som default) */
.tv-consent-cats[hidden],
.tv-consent-saverow[hidden] { display: none; }
.tv-consent-cats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
}
.tv-consent-cat {
  padding: 13px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border-left: 3px solid var(--c-yellow, #fff000);
}
.tv-consent-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.tv-consent-cat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-inverse, #ffffff);
}
.tv-consent-cat-lock {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-yellow, #fff000);
}
.tv-consent-cat-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .65);
}

/* Toggle-switch */
.tv-consent-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.tv-consent-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tv-consent-slider {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .25);
  transition: background .3s ease, border-color .3s ease;
}
.tv-consent-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transform: translateY(-50%);
  transition: transform .3s ease, background .3s ease;
}
.tv-consent-switch input:checked + .tv-consent-slider {
  background: var(--c-yellow, #fff000);
  border-color: var(--c-yellow, #fff000);
}
.tv-consent-switch input:checked + .tv-consent-slider::after {
  transform: translateY(-50%) translateX(16px);
  background: var(--c-text, #1a1a1a);
}
.tv-consent-switch input:focus-visible + .tv-consent-slider {
  outline: 2px solid var(--c-yellow, #fff000);
  outline-offset: 2px;
}

/* ---------- Knappar ---------- */
.tv-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.tv-consent-accept,
.tv-consent-reject,
.tv-consent-save {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 110px;
  padding: 11px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.tv-consent-accept,
.tv-consent-save {
  background: var(--c-yellow, #fff000);
  border: 1px solid var(--c-yellow, #fff000);
  color: var(--c-text, #1a1a1a);
}
.tv-consent-accept:hover,
.tv-consent-save:hover {
  background: var(--c-yellow-hover, #f5d800);
  border-color: var(--c-yellow-hover, #f5d800);
}
.tv-consent-reject {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .4);
  color: var(--c-inverse, #ffffff);
}
.tv-consent-reject:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, .08);
}
.tv-consent-accept:focus-visible,
.tv-consent-reject:focus-visible,
.tv-consent-save:focus-visible {
  outline: 2px solid var(--c-yellow, #fff000);
  outline-offset: 2px;
}
.tv-consent-settings-toggle {
  flex: 1 1 100%;
  margin-top: 0;
  padding: 2px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-yellow, #fff000);
  cursor: pointer;
  transition: color .25s ease;
}
.tv-consent-settings-toggle:hover { color: var(--c-yellow-hover, #f5d800); }
.tv-consent-saverow { margin-top: 14px; }
.tv-consent-saverow .tv-consent-save { width: 100%; }

/* ---------- Flytande rund cookie-knapp ---------- */
.tv-cookie-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1001;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(42, 42, 42, .95);
  border: 1px solid rgba(255, 240, 0, .4);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .65);
  color: var(--c-yellow, #fff000);
  cursor: pointer;
  transition: transform .3s ease, color .3s ease, border-color .3s ease;
}
.tv-cookie-fab:hover {
  transform: translateY(-3px);
  color: var(--c-yellow-hover, #f5d800);
  border-color: rgba(255, 240, 0, .7);
}
.tv-cookie-fab:focus-visible {
  outline: 2px solid var(--c-yellow, #fff000);
  outline-offset: 3px;
}
.tv-cookie-fab[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tv-cookie-fab,
  .tv-consent-slider,
  .tv-consent-slider::after { transition: none; }
  .tv-cookie-fab:hover { transform: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  .tv-consent {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
  .tv-cookie-fab { left: 14px; bottom: 14px; }
  .tv-consent-title { font-size: 20px; }
}
