/* =========================================================================
   Golf Getaways - Cookie-consent (glas-banner nere till vänster + flytande knapp)
   Använder temats designtokens (--gold/--ink/--paper). Matchar mega-menyns glas.
   ========================================================================= */

/* ---------- Banner-skal (fixed, nere till vänster) ---------- */
.gg-consent {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1001;
  width: min(330px, calc(100vw - 40px));
  /* dold tills is-visible */
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition:
    opacity .5s var(--ease-out, ease),
    transform .5s var(--ease-out, ease),
    visibility 0s linear .5s;
}
.gg-consent.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity .5s var(--ease-out, ease),
    transform .5s var(--ease-out, ease);
}
.gg-consent[data-reduce="1"],
.gg-consent[data-reduce="1"].is-visible {
  transition: none;
}

/* ---------- Glas-kortet ---------- */
.gg-consent-card {
  position: relative;
  padding: 18px 20px 16px;
  border-radius: 14px;
  background: rgba(19, 18, 17, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  backdrop-filter: blur(14px) saturate(1.12);
  border: 1px solid rgba(166, 130, 69, .30);
  box-shadow: 0 24px 60px -22px rgba(0, 0, 0, .7);
  color: var(--paper, #f7f3eb);
}

.gg-consent-kicker {
  margin: 0 0 5px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-soft, #c8a36a);
}
.gg-consent-title {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.15;
  color: var(--gold-warm, #d9b677);
}
.gg-consent-text {
  margin: 0 0 14px;
  font-family: var(--body, sans-serif);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(247, 243, 235, .82);
}
.gg-consent-link {
  color: var(--gold-warm, #d9b677);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gg-consent-link:hover { color: var(--gold-soft, #c8a36a); }

/* ---------- Kategorier (inställningspanel) ---------- */
/* [hidden] måste vinna över display:flex (annars syns panelen som default) */
.gg-consent-cats[hidden],
.gg-consent-saverow[hidden] { display: none; }
.gg-consent-cats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
}
.gg-consent-cat {
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(42, 38, 34, .6);
  border-left: 2px solid var(--gold, #a68245);
}
.gg-consent-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.gg-consent-cat-name {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--paper, #f7f3eb);
}
.gg-consent-cat-lock {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-soft, #c8a36a);
}
.gg-consent-cat-desc {
  margin: 0;
  font-family: var(--body, sans-serif);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(247, 243, 235, .68);
}

/* Toggle-switch */
.gg-consent-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.gg-consent-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.gg-consent-slider {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(247, 243, 235, .18);
  border: 1px solid rgba(166, 130, 69, .35);
  transition: background .3s var(--ease-out, ease);
}
.gg-consent-slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper, #f7f3eb);
  transform: translateY(-50%);
  transition: transform .3s var(--ease-out, ease), background .3s var(--ease-out, ease);
}
.gg-consent-switch input:checked + .gg-consent-slider {
  background: var(--gold, #a68245);
  border-color: var(--gold, #a68245);
}
.gg-consent-switch input:checked + .gg-consent-slider::after {
  transform: translateY(-50%) translateX(16px);
  background: var(--ink, #131211);
}
.gg-consent-switch input:focus-visible + .gg-consent-slider {
  outline: 2px solid var(--gold-warm, #d9b677);
  outline-offset: 2px;
}

/* ---------- Knappar ---------- */
.gg-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
/* Kompaktare varianter av temats pill/outline inom bannern */
.gg-consent .btn-pill,
.gg-consent .btn-outline {
  padding: 10px 18px;
  font-size: 10.5px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 110px;
}
.gg-consent-settings-toggle {
  flex: 1 1 100%;
  margin-top: 0;
  padding: 2px;
  background: none;
  border: 0;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold-soft, #c8a36a);
  cursor: pointer;
  transition: color .25s var(--ease-out, ease);
}
.gg-consent-settings-toggle:hover { color: var(--gold-warm, #d9b677); }
.gg-consent-saverow { margin-top: 14px; }
.gg-consent-saverow .btn-pill { width: 100%; justify-content: center; }

/* ---------- Flytande rund cookie-knapp ---------- */
.gg-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(19, 18, 17, .72);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(166, 130, 69, .35);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .65);
  color: var(--gold-warm, #d9b677);
  cursor: pointer;
  transition: transform .3s var(--ease-out, ease), color .3s var(--ease-out, ease), border-color .3s var(--ease-out, ease);
}
.gg-cookie-fab:hover {
  transform: translateY(-3px);
  color: var(--gold-soft, #c8a36a);
  border-color: rgba(166, 130, 69, .6);
}
.gg-cookie-fab:focus-visible {
  outline: 2px solid var(--gold-warm, #d9b677);
  outline-offset: 3px;
}
.gg-cookie-fab[hidden] { display: none; }

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

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