/* Šťastíčko — lišta súhlasu s cookies. Farby z theme.json témy (s náhradou, ak premenná chýba). */
.stm-lista, .stm-panel {
  --stm-pozadie: var(--wp--preset--color--white, #FFFFFF);
  --stm-text: var(--wp--preset--color--contrast, #2B2340);
  --stm-tlmena: var(--wp--preset--color--mute, #6E6787);
  --stm-linka: var(--wp--preset--color--linka, #EDE4D6);
  --stm-piesok: var(--wp--preset--color--sand, #FFF1D6);
  --stm-koral: var(--wp--preset--color--primary-tmava, #E2522F);
  --stm-mint: var(--wp--preset--color--mint, #5FD3A7);
  --stm-radius: var(--wp--custom--radius--medium, 20px);
  font-family: var(--wp--preset--font-family--text, system-ui, sans-serif);
  color: var(--stm-text);
  font-size: 0.95rem;
  line-height: 1.5;
  box-sizing: border-box;
}
.stm-lista *, .stm-panel * { box-sizing: border-box; }
.stm-lista[hidden], .stm-panel[hidden] { display: none !important; }

/* ── lišta ─────────────────────────────────────────────────────────── */
.stm-lista {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 99998;
  max-width: 680px;
  margin: 0 auto;
  background: var(--stm-pozadie);
  border: 1px solid var(--stm-linka);
  border-radius: var(--stm-radius);
  box-shadow: 0 10px 40px rgba(43, 35, 64, .18);
  padding: 18px 20px;
}
.stm-lista__nadpis { margin: 0 0 4px; font-weight: 800; font-size: 1.05rem; }
.stm-lista__text { margin: 0 0 14px; }
.stm-lista a, .stm-panel a { color: var(--stm-text); text-decoration: underline; text-underline-offset: 2px; }
.stm-lista__tlacidla { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Prijať / Len nevyhnutné: ROVNAKÝ vzhľad aj veľkosť — odmietnuť je rovnako ľahké ako prijať. */
.stm-btn {
  appearance: none;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  min-height: 44px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 2px solid var(--stm-text);
  background: var(--stm-text);
  color: #FFFFFF;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 150px;
}
.stm-btn:hover { background: #3d3358; border-color: #3d3358; }
.stm-btn--text {
  flex: 0 0 auto;
  min-width: 0;
  background: transparent;
  border-color: transparent;
  color: var(--stm-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-left: 10px; padding-right: 10px;
}
.stm-btn--text:hover { background: var(--stm-piesok); border-color: var(--stm-piesok); }
.stm-btn:focus-visible, .stm-lista a:focus-visible, .stm-panel a:focus-visible,
.stm-pata__odkaz:focus-visible, .stm-prepinac input:focus-visible + .stm-prepinac__draha {
  outline: 3px solid var(--stm-koral);
  outline-offset: 2px;
}

/* ── panel nastavení (dialóg) ──────────────────────────────────────── */
.stm-panel {
  position: fixed; inset: 0;
  z-index: 99999;
  background: rgba(43, 35, 64, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.stm-panel__okno {
  background: var(--stm-pozadie);
  border-radius: var(--wp--custom--radius--large, 28px);
  max-width: 560px; width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(43, 35, 64, .3);
}
.stm-panel__okno:focus { outline: none; }
.stm-panel__nadpis { margin: 0 0 14px; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--stm-text); }
.stm-kat { border: 1px solid var(--stm-linka); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.stm-kat__hlava { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stm-kat__nazov { font-weight: 800; }
.stm-kat__vzdy { font-size: .85rem; font-weight: 700; color: var(--stm-tlmena); }
.stm-kat__popis { margin: 6px 0 0; color: var(--stm-tlmena); font-size: .9rem; }
.stm-kat__popis code { font-size: .85em; background: var(--stm-piesok); padding: 0 4px; border-radius: 4px; }
.stm-panel .stm-lista__tlacidla { margin-top: 16px; }

/* prepínač = natívny checkbox (klávesnica aj čítačka zadarmo) */
.stm-prepinac { position: relative; display: inline-block; width: 52px; height: 30px; flex: 0 0 auto; }
.stm-prepinac input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.stm-prepinac__draha {
  position: absolute; inset: 0; border-radius: 999px;
  background: #CFC8DA; transition: background .15s;
}
.stm-prepinac__draha::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.stm-prepinac input:checked + .stm-prepinac__draha { background: var(--stm-text); }
.stm-prepinac input:checked + .stm-prepinac__draha::after { transform: translateX(22px); }
html.stm-otvorene { overflow: hidden; }

/* ── odkaz v päte ──────────────────────────────────────────────────── */
.stm-pata {
  margin: 0; padding: 10px 16px 14px; text-align: center;
  background: var(--wp--preset--color--sand, #FFF1D6);
}
.stm-pata__odkaz {
  appearance: none; background: none; border: 0; padding: 4px 6px; cursor: pointer;
  font: inherit; font-size: .85rem; color: var(--wp--preset--color--mute, #6E6787);
  text-decoration: underline; text-underline-offset: 2px;
}

@media (max-width: 560px) {
  .stm-lista { left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .stm-lista__tlacidla { flex-direction: column; align-items: stretch; }
  .stm-btn { width: 100%; min-width: 0; }
  .stm-btn--text { align-self: center; width: auto; }
  .stm-panel { align-items: flex-end; padding: 8px; }
  .stm-panel__okno { padding: 20px 16px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .stm-prepinac__draha, .stm-prepinac__draha::after { transition: none; }
}
