/* ==========================================================================
   TESLA LOUNGE & BAR — consent.css
   Obaveštenje o kolačićima / cookie notice. Vidi assets/js/consent.js.

   Samo tokeni iz theme.css — prozor tako prati svaki skin, i svetli (ivory).
   Tokens only, so the notice follows every skin, including the light one.

   Prozor ne blokira stranicu: meni se čita i poručuje i dok je otvoren. Zato
   stoji ISPOD popupa za količinu (z-index 80), a iznad poruke i dugmeta
   „nazad na vrh". Non-blocking: sits below the quantity popup, above the rest.
   ========================================================================== */

.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.consent[hidden] { display: none; }

.consent__box {
  pointer-events: auto;
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px 16px;
  border: 1px solid var(--panel-border);
  border-top-color: var(--gold);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--panel-glow, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow), 0 -10px 40px rgba(0,0,0,.28);
  color: var(--text);
  font-family: var(--font-body);
  animation: consent-in .38s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes consent-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.consent__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-strong);
  outline: none;
}
.consent__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: .95rem;
}

.consent__text {
  margin: 10px 0 0;
  font-size: .86rem;
  line-height: 1.6;
  color: var(--soft, var(--text));
}

/* ---------- detalji / details ---------- */

.consent__details { margin-top: 14px; display: grid; gap: 10px; }
.consent__details[hidden] { display: none; }

.consent__group {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.consent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .82rem;
  color: var(--text-strong);
}
.consent__always {
  font-style: normal;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.consent__items {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
/* Stalna širina prve kolone, da se opisi poravnaju ispod najdužeg naziva. */
.consent__items li {
  display: grid;
  grid-template-columns: 8.8rem minmax(0, 1fr);
  gap: 1px 10px;
  font-size: .76rem;
  line-height: 1.45;
}
.consent__items code {
  grid-row: span 3;
  align-self: start;
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .7rem;
  color: var(--gold-2);
}
.consent__kind { color: var(--muted); font-size: .7rem; }
.consent__purpose { color: var(--text); }
.consent__time { color: var(--muted); }

.consent__desc {
  display: block;
  margin-top: 6px;
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Prekidač: pravi checkbox, samo drugačije nacrtan — tastatura i čitači ekrana
   rade bez ikakvog JS-a. Nikad unapred uključen.
   A real checkbox, only drawn differently; never pre-ticked. */
.consent__group--switch { cursor: pointer; }
.consent__head input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.consent__head input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .2s ease, background .2s ease;
}
.consent__head input:checked { background: var(--gold); border-color: var(--gold); }
.consent__head input:checked::after { transform: translateX(20px); background: #17150f; }
.consent__head input:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------- dugmad / buttons ---------- */

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

/* Dugmad se protežu u visinu reda: kada se jedan natpis prelomi u dva reda,
   „prihvati" i „odbij" i dalje ostaju iste veličine.
   Buttons stretch to the row height, so accept and reject stay the same size
   even when one label wraps. */
.consent__btn {
  flex: 1 1 170px;
  align-self: stretch;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 13px;
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.consent__btn:hover { border-color: var(--gold-2); }
.consent__btn--solid { background: var(--gold); color: #17150f; }
.consent__btn--solid:hover { background: var(--gold-2); }
.consent__btn:focus-visible,
.consent__link:focus-visible,
.consent__privacy:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

.consent__link {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--gold-2);
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.consent__privacy {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 0;
  color: var(--muted);
  font-size: .74rem;
  text-underline-offset: 3px;
}
.consent__privacy:hover { color: var(--gold-2); }

/* ---------- ostatak strane dok je prozor otvoren ---------- */

html.consent-open body { padding-bottom: var(--consent-h, 0); }
html.consent-open .back-top { bottom: calc(22px + var(--consent-h, 0px)); }
html.consent-open .menu-toast { bottom: calc(26px + var(--consent-h, 0px)); }

@media (max-width: 520px) {
  .consent { left: 10px; right: 10px; bottom: 10px; }
  .consent__box { padding: 18px 16px 12px; border-radius: 22px; }
  .consent__title { font-size: 1.32rem; }
  .consent__text { font-size: .82rem; }
  .consent__btn { flex-basis: 130px; }
  .consent__items li { grid-template-columns: 7.6rem minmax(0, 1fr); }
  .consent__items code { font-size: .64rem; padding: 2px 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .consent__box { animation: none; }
  .consent__head input,
  .consent__head input::after { transition: none; }
}

@media print {
  .consent { display: none !important; }
}
