/* Lišta souhlasu s cookies (dole přes celou šířku, bez zatmavení) a formulář volby (dialog i /Privacy#nastaveni). */

.cookie-bar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--st-surface);
  box-shadow: 0 -1px 0 var(--st-border-subtle), 0 -8px 24px rgba(14, 15, 12, 0.1);
}

.cookie-bar__inner {
  max-width: 1248px;
  margin: 0 auto;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-bar__text {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--st-text-secondary);
}

.cookie-bar__text strong {
  font-weight: 700;
  color: var(--st-text-primary);
}

/* Mobil: jedna věta; desktop: dvě věty. */
.cookie-bar__text--long {
  display: none;
}

/* Mobil: Přijmout vše, Odmítnout, pod nimi Nastavení (pořadí v kódu je desktopové). */
.cookie-bar__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.cookie-bar__actions .button {
  width: 100%;
}

.cookie-bar__settings {
  align-self: center;
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
}

/* Lišta je fixní: patička a oznámení dostanou odsazení, aby je nezakryla. */
.site-footer--bar-space {
  padding-bottom: 248px;
}

.toast-region--above-bar {
  bottom: 248px;
}

@media (min-width: 768px) {
  .cookie-bar__inner {
    padding: 16px 24px;
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }

  .cookie-bar__text {
    flex: 1;
  }

  .cookie-bar__text--long {
    display: block;
  }

  .cookie-bar__text--short {
    display: none;
  }

  .cookie-bar__actions {
    flex: none;
    flex-direction: row;
    align-items: center;
  }

  .cookie-bar__actions .button {
    width: auto;
    min-width: 140px;
    height: 44px;
    font-size: 15px;
  }

  .cookie-bar__settings {
    align-self: auto;
  }

  .site-footer--bar-space {
    padding-bottom: 112px;
  }

  .toast-region--above-bar {
    bottom: 112px;
  }
}

/* Formulář volby cookies: kategorie se switchem, tlačítka. */
.consent-form {
  display: flex;
  flex-direction: column;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--st-border-subtle);
}

.consent-row__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.consent-row__title {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 800;
}

.consent-row__title span {
  font-weight: 500;
  color: var(--st-text-muted);
}

.consent-row__text p {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--st-text-secondary);
}

.switch {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
  cursor: pointer;
}

.switch__state {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--st-text-muted);
}

.switch__on {
  display: none;
}

/* Text „Zapnuto“ / „Vypnuto“ se přepíná podle políčka i bez JS. */
.switch:has(.switch__input:checked) .switch__on {
  display: inline;
}

.switch:has(.switch__input:checked) .switch__off {
  display: none;
}

/* Skutečné políčko leží průhledně přes ovladač: ovládá se klávesnicí i čtečkou, jako by bylo vidět. */
.switch__input {
  position: absolute;
  right: 0;
  width: 48px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch__input:disabled {
  cursor: not-allowed;
}

.switch__track {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 9999px;
  background: var(--st-border-strong);
}

.switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--st-surface);
  box-shadow: 0 1px 2px rgba(14, 15, 12, 0.3);
  transition: left 0.15s;
}

.switch__input:checked + .switch__track {
  background: var(--st-toggle-on);
}

.switch__input:checked + .switch__track .switch__knob {
  left: 23px;
}

.switch__input:disabled + .switch__track {
  opacity: 0.55;
}

.switch__input:focus-visible + .switch__track {
  outline: 2px solid var(--st-text-link);
  outline-offset: 2px;
}

/* Mobil: Přijmout vše nahoře (pořadí v kódu je desktopové). */
.consent-form__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--st-border-subtle);
}

.consent-form__actions .button {
  width: 100%;
}

@media (min-width: 768px) {
  .consent-form__actions {
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 20px;
  }

  .consent-form__actions .button {
    width: auto;
    min-width: 150px;
    height: 44px;
    font-size: 15px;
  }
}
