/* Cookie lišta a dialog nastavení (vlastník D). Prvky vytváří consent.js.
   Tři volby jsou záměrně stejně velké a stejně výrazné (GDPR, ePrivacy). */

/* Rezerva dole, dokud je lišta vidět: konec stránky ani fokus nezmizí pod lištou. */
html.has-cookie-banner { scroll-padding-bottom: var(--cookie-banner-h, 0px); }
html.has-cookie-banner body { padding-bottom: var(--cookie-banner-h, 0px); }

/* ---------- společná tlačítka ---------- */
.cookie-actions { display: flex; gap: 12px; }
.cookie-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.cookie-btn:hover { border-color: var(--accent-text); }

/* ---------- lišta ---------- */
.cookie-banner {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(1178px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  display: flex;
  align-items: center;
  gap: 24px 64px;
  padding: 28px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.cookie-banner-body { flex: 1 1 auto; max-width: 540px; }
.cookie-banner-title { margin: 0 0 8px; font-size: 18px; line-height: 1.5; font-weight: 700; }
.cookie-banner-text { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.cookie-banner .cookie-actions { flex: 0 1 560px; }

@media (max-width: 1120px) {
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .cookie-banner-body { max-width: none; }
  .cookie-banner .cookie-actions { flex-basis: auto; }
}

@media (max-width: 560px) {
  /* Mobil podle Figmy: přes celou šířku u spodního okraje, tlačítka pod sebou. */
  .cookie-banner {
    left: 0; bottom: 0;
    transform: none;
    width: 100%;
    max-height: 70dvh;
    gap: 20px;
    padding: 24px 21px;
    border-width: 1px 0 0;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }
  .cookie-actions { flex-direction: column; }
  .cookie-btn { flex: 0 0 auto; width: 100%; }
}

/* ---------- dialog ---------- */
.cookie-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.cookie-dialog[open] { display: flex; }
/* ::backdrop nedědí tokeny ve všech prohlížečích, proto pevná průhledná černá. */
.cookie-dialog::backdrop { background: rgb(0 0 0 / 45%); }

.cookie-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.cookie-dialog-title { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 700; }
.cookie-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--target);
  height: var(--target);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.cookie-close:hover { border-color: var(--accent-text); }

.cookie-dialog-body { overflow-y: auto; padding: 4px 24px 8px; }
.cookie-dialog-intro { margin: 16px 0; color: var(--text-muted); font-size: 15px; line-height: 1.55; }

.cookie-cat {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.cookie-cat-text { flex: 1 1 auto; min-width: 0; }
.cookie-cat-title { margin: 0 0 6px; font-size: 16px; line-height: 1.5; font-weight: 600; }
.cookie-cat-text p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.cookie-details { margin-top: 4px; }
.cookie-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--target);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.cookie-details summary::-webkit-details-marker { display: none; }
.cookie-details summary::before { content: "›"; font-size: 16px; transition: transform .2s; }
.cookie-details[open] summary::before { transform: rotate(90deg); }
.cookie-list { margin: 0 0 4px; padding-left: 20px; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.cookie-list strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

/* Přepínač: nativní checkbox s role=switch, popisek stavu je jen vizuální. */
.cookie-switch {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: var(--target);
  min-height: var(--target);
  cursor: pointer;
}
.cookie-switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 52px;
  height: 30px;
  margin: 0;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.cookie-switch input::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--toggle-shadow);
  border: 1px solid var(--border-input);
  transition: transform .2s var(--ease-out);
}
.cookie-switch input:checked { background: var(--accent); border-color: var(--accent); }
.cookie-switch input:checked::before { transform: translateX(22px); border-color: var(--accent-contrast); }
.cookie-switch input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-pill); }
.cookie-switch input:disabled { cursor: default; opacity: .75; }
.cookie-switch:has(input:disabled) { cursor: default; }
.cookie-switch-state { color: var(--text-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cookie-switch .is-on { display: none; }
.cookie-switch input:checked ~ .cookie-switch-state .is-on { display: inline; }
.cookie-switch input:checked ~ .cookie-switch-state .is-off { display: none; }

.cookie-dialog-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

@media (max-width: 560px) {
  .cookie-dialog-head { padding: 16px; }
  .cookie-dialog-body { padding: 4px 16px 8px; }
  .cookie-dialog-foot { padding: 16px; }
}
