/* ==========================================================
   Okno so súhlasom (cookies a meranie) – inc/suhlas.php, assets/suhlas.js
   Tri tlačidlá v prvej vrstve majú rovnakú veľkosť; „Prijať všetky“ je jediné modré, ostatné inverzné (Jakub 30. 11. 2026,
   riziko farieb voči odporúčaniu regulátora akceptoval). Odmietnutie musí ostať čitateľné tlačidlo, nie odkaz.
   ========================================================== */

/* kým sa návštevník nerozhodne: závoj cez stránku už pri prvom vykreslení (okno doplní suhlas.js) */
html.suhlas-caka, html.suhlas-caka body { overflow: hidden; }
html.suhlas-caka::before {
  content: ""; position: fixed; inset: 0; z-index: 10000;
  background: rgba(13, 24, 33, .62);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
}

.suhlas {
  position: fixed; inset: 0; z-index: 10001; overflow-y: auto; overscroll-behavior: contain;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.suhlas-box {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 700px;
  max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px);
  background: #fff; color: var(--text, #1e2733); border-radius: 18px;
  border-top: 5px solid var(--blue-700, #0057ad);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38); overflow: hidden;
}
.suhlas-obsah { overflow-y: auto; padding: 26px 30px 6px; }
.suhlas h2 { margin: 0 40px 10px 0; font-size: 1.5rem; line-height: 1.25; outline: none; }
.suhlas p { margin: 0 0 14px; font-size: .98rem; line-height: 1.55; }
.suhlas-x {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: #eef2f7; color: var(--muted, #5b6673); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.suhlas-x:hover { background: #e0e8f1; color: var(--text, #1e2733); }
.suhlas-x[hidden] { display: none; }

.suhlas-ucely { display: grid; gap: 8px; margin: 0 0 14px; }
.suhlas-ucel {
  display: flex; align-items: center; gap: 18px; padding: 12px 16px; cursor: pointer;
  border: 1px solid var(--border, #e2e8ef); border-radius: 12px; background: #f8fafc;
}
.suhlas-ucel:has(input:checked:not(:disabled)) { border-color: var(--blue-700, #0057ad); background: var(--blue-50, #f0f6fc); }
.suhlas-ucel:has(input:disabled) { cursor: default; }
.suhlas-ucel-text { flex: 1 1 auto; display: grid; gap: 1px; }
.suhlas-ucel-text strong { font-size: 1rem; }
.suhlas-ucel-text span { font-size: .89rem; line-height: 1.45; color: var(--muted, #5b6673); }
.suhlas-prepinac { position: relative; flex: 0 0 auto; width: 48px; height: 28px; }
.suhlas-prepinac input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; z-index: 1; }
.suhlas-prepinac i { position: absolute; inset: 0; border-radius: 999px; background: #b4c0ce; transition: background .15s; }
.suhlas-prepinac i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.suhlas-prepinac input:checked + i { background: var(--blue-700, #0057ad); }
.suhlas-prepinac input:checked + i::after { transform: translateX(20px); }
.suhlas-prepinac input:disabled + i { background: #7f93a8; }
.suhlas-prepinac input:focus-visible + i { outline: 3px solid rgba(0, 101, 203, .5); outline-offset: 2px; }
.suhlas .suhlas-pozn { font-size: .85rem; line-height: 1.5; color: var(--muted, #5b6673); }
.suhlas-pozn a { color: var(--blue-700, #0057ad); }

.suhlas-tlacidla {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  padding: 16px 30px 24px; background: #fff; border-top: 1px solid var(--border, #e2e8ef);
}
.suhlas-tlacidla button {
  padding: 14px 10px; border: 2px solid var(--blue-700, #0057ad); border-radius: 12px;
  background: var(--blue-700, #0057ad); color: #fff; font: inherit; font-size: 1.02rem; font-weight: 700; line-height: 1.25; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.suhlas-tlacidla button:hover { background: var(--blue-600, #0065cb); border-color: var(--blue-600, #0065cb); }
.suhlas-tlacidla button:not([data-suhlas-volba="vsetko"]) { background: #fff; color: var(--blue-700, #0057ad); }
.suhlas-tlacidla button:not([data-suhlas-volba="vsetko"]):hover { background: var(--blue-50, #f0f6fc); border-color: var(--blue-600, #0065cb); color: var(--blue-600, #0065cb); }
.suhlas-tlacidla button:focus-visible, .suhlas-x:focus-visible { outline: 3px solid rgba(0, 101, 203, .5); outline-offset: 2px; }

/* právne stránky (ochrana súkromia, podmienky): okno dole, stránka sa dá čítať */
.suhlas.suhlas-lista { inset: auto 0 0 0; max-height: 62vh; padding: 10px; pointer-events: none; }
.suhlas.suhlas-lista .suhlas-box { pointer-events: auto; max-width: 1080px; max-height: calc(62vh - 20px); box-shadow: 0 -6px 40px rgba(0, 0, 0, .28); }
.suhlas.suhlas-lista .suhlas-obsah { padding: 16px 24px 2px; }
.suhlas.suhlas-lista h2 { font-size: 1.15rem; margin-bottom: 4px; }
.suhlas.suhlas-lista p { font-size: .88rem; margin-bottom: 10px; }
.suhlas.suhlas-lista .suhlas-tlacidla { padding: 10px 24px 14px; }
.suhlas.suhlas-lista .suhlas-tlacidla button { padding: 11px 10px; }
@media (min-width: 900px) {
  .suhlas.suhlas-lista .suhlas-ucely { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .suhlas.suhlas-lista .suhlas-ucel { align-items: flex-start; padding: 9px 12px; gap: 10px; }
  .suhlas.suhlas-lista .suhlas-ucel-text span { font-size: .8rem; line-height: 1.4; }
}
html.suhlas-lista-je body { padding-bottom: 48vh; }

@media (max-width: 640px) {
  .suhlas { padding: 10px; align-items: flex-end; }
  .suhlas-box { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .suhlas-obsah { padding: 20px 18px 4px; }
  .suhlas h2 { font-size: 1.28rem; }
  .suhlas p { font-size: .94rem; margin-bottom: 12px; }
  .suhlas-ucel { padding: 10px 12px; gap: 12px; }
  .suhlas-ucel-text span { font-size: .85rem; }
  .suhlas-tlacidla { grid-template-columns: 1fr; gap: 8px; padding: 12px 18px 16px; }
  .suhlas-tlacidla button { padding: 12px 10px; }
}
@media (max-width: 640px) and (max-height: 700px) { .suhlas-tlacidla { grid-template-columns: repeat(3, minmax(0, 1fr)); } .suhlas-tlacidla button { font-size: .88rem; padding: 12px 4px; } }

/* odkaz „Nastavenia cookies“ v päte a v zásadách */
.suhlas-odkaz { padding: 0; border: 0; background: none; color: #a9bdd3; font: inherit; text-align: left; cursor: pointer; }
.suhlas-odkaz:hover { color: #fff; }

/* tabuľka cookies v zásadách ochrany súkromia */
.cookies-tab { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: .9rem; line-height: 1.45; }
.cookies-tab th, .cookies-tab td { padding: 8px 10px; border: 1px solid var(--border, #e2e8ef); text-align: left; vertical-align: top; }
.cookies-tab th { background: var(--blue-50, #f0f6fc); }
.cookies-tab code { font-size: .86em; overflow-wrap: anywhere; }
.cookies-tab-obal { overflow-x: auto; }

@media print { .suhlas, html.suhlas-caka::before { display: none !important; } html.suhlas-caka, html.suhlas-caka body { overflow: visible; } }
@media (prefers-reduced-motion: reduce) { .suhlas-prepinac i, .suhlas-prepinac i::after, .suhlas-tlacidla button { transition: none; } }
