/* ==========================================================================
   MUS.sk – vyhľadávanie, "pro" vzhľad (index-pro.php)
   Samostatná kópia – css/main.css ostáva nezmenený.
   ========================================================================== */

/* --- Farby: svetlý režim (predvolený) ------------------------------------- */
:root {
    --bg: #f8f8f6;               /* jemne teplá off-white – neoslňuje ako čistá biela */
    --surface: #efefec;          /* jemné pozadie (hover, mobilné pozadie) */
    --card: #ffffff;
    --fg: #202124;               /* hlavný text */
    --fg-2: #3c4043;             /* text úryvku – tmavší, aby tenké písmo nebolo bledé */
    --muted: #5f6368;            /* URL, dátum, meta */
    --border: #e2e2de;
    --border-strong: #cdcdc8;
    --al: #1f4bb4;               /* odkaz – menej sýta modrá */
    --alv: #66309e;              /* navštívený odkaz */
    --accent: #2a56c6;
    --accent-fg: #ffffff;
    --accent-soft: #e8eefd;
    --input-bg: #ffffff;
    --input-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 6px rgba(16, 24, 40, .06);
    --input-shadow-focus: 0 2px 10px rgba(16, 24, 40, .12);
    --header-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(16, 24, 40, .06);
    --card-shadow: 0 4px 16px rgba(16, 24, 40, .10);
    --footer: #f2f3f5;
    --avail-in: #137333;
    --avail-wait: #a35200;
    --avail-out: #c5221f;
    --star: #e8a200;             /* hviezdičky hodnotenia */
    --star-empty: #d6d6d1;

    --gutter: 168px;             /* ľavý odstup výsledkov = šírka stĺpca s logom */
    --col: 680px;                /* šírka stĺpca s výsledkami */
    --radius: 12px;
}

/* --- Farby: tmavý režim (systém alebo trieda .dark z js/theme.js) --------- */
@media (prefers-color-scheme: dark) {
    :root:not(.light) {
        --bg: #101417;
        --surface: #181d21;
        --card: #161b1f;
        --fg: #e4e6e8;
        --fg-2: #bfc4c9;
        --muted: #8f969d;
        --border: #2a3137;
        --border-strong: #3a434a;
        --al: #8ab4f8;
        --alv: #c9a2f7;
        --accent: #8ab4f8;
        --accent-fg: #0d1b30;
        --accent-soft: #1d2a3d;
        --input-bg: #1b2125;
        --input-shadow: 0 1px 2px rgba(0, 0, 0, .4);
        --input-shadow-focus: 0 2px 12px rgba(0, 0, 0, .55);
        --header-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(0, 0, 0, .4);
        --card-shadow: 0 6px 20px rgba(0, 0, 0, .45);
        --footer: #161a1d;
        --avail-in: #81c995;
        --avail-wait: #fdd663;
        --avail-out: #f28b82;
        --star: #fdd663;
        --star-empty: #3e474e;
    }
}

:root.dark {
    --bg: #101417;
    --surface: #181d21;
    --card: #161b1f;
    --fg: #e4e6e8;
    --fg-2: #bfc4c9;
    --muted: #8f969d;
    --border: #2a3137;
    --border-strong: #3a434a;
    --al: #8ab4f8;
    --alv: #c9a2f7;
    --accent: #8ab4f8;
    --accent-fg: #0d1b30;
    --accent-soft: #1d2a3d;
    --input-bg: #1b2125;
    --input-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --input-shadow-focus: 0 2px 12px rgba(0, 0, 0, .55);
    --header-shadow: 0 1px 0 var(--border), 0 4px 14px rgba(0, 0, 0, .4);
    --card-shadow: 0 6px 20px rgba(0, 0, 0, .45);
    --footer: #161a1d;
    --avail-in: #81c995;
    --avail-wait: #fdd663;
    --avail-out: #f28b82;
    --star: #fdd663;
    --star-empty: #3e474e;
}

/* --- Základ --------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--fg);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    /* Svetlý režim: predvolené vyhladzovanie – na macOS je písmo plnšie.
       "antialiased" ho stenčuje, preto ho používame len v tmavom režime. */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

@media (prefers-color-scheme: dark) {
    :root:not(.light) body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

:root.dark body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a:link {
    color: var(--al);
    text-decoration: none;
}

a:visited {
    color: var(--alv);
    text-decoration: none;
}

svg {
    fill: currentColor;
}

/* Odkaz roztiahnutý na celý najbližší relatívne pozicovaný blok */
a.l::after {
    content: '';
    position: absolute;
    inset: 0;
    cursor: pointer;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* --- Rozloženie stránky --------------------------------------------------- */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.spacer-top,
.spacer-bottom {
    flex-grow: 1;
}

.has-results .spacer-top {
    flex-grow: 0;
}

/* Spoločný kontajner: hlavička aj výsledky majú rovnaký ľavý okraj */
.header-inner,
.results,
.has-results .widget {
    width: 100%;
    max-width: calc(var(--gutter) + var(--col) + 360px);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Hlavička ------------------------------------------------------------- */
.site-header {
    width: 100%;
    background: var(--bg);
}

/* Úvodná stránka: logo nad poľom, všetko na stred */
.home .header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    max-width: 660px;
    padding-bottom: 16px;
    padding-top: 10px;
}

.logo picture {
    display: block;
}

.home .logo img {
    display: block;
    width: 190px;
}

.search-form {
    width: 100%;
}

/* Výsledky: prilepená hlavička, logo v ľavom stĺpci */
.has-results .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    transition: box-shadow .2s ease;
}

.has-results .site-header.is-stuck {
    box-shadow: var(--header-shadow);
}

.has-results .header-inner {
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, var(--col));
    align-items: start;
    padding-top: 18px;
}

.has-results .logo {
    padding-top: 4px;
}

.has-results .logo img {
    display: block;
    width: 108px;
}

/* --- Vyhľadávacie pole ---------------------------------------------------- */
.search-box {
    position: relative;
    margin-bottom: 6px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 48px;
    color: var(--fg);
    background: var(--input-bg);
    font: inherit;
    font-size: 16px;
    /* celé px: pri párnej výške poľa je text centrovaný bez zlomku pixela
       (Chrome ho v poli zaokrúhli inak ako sivé doplnenie v .search-ghost) */
    line-height: 24px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    box-shadow: var(--input-shadow);
    outline: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.search-input:hover,
.search-input:focus {
    border-color: transparent;
    box-shadow: var(--input-shadow-focus);
}

.has-results .search-input {
    height: 46px;
}

.search-icon,
.clear-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    fill: var(--muted);
}

.search-icon {
    left: 16px;
    pointer-events: none;
}

.clear-icon {
    right: 14px;
    top: 50%;
    padding: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.clear-icon:hover {
    fill: var(--fg);
    background: var(--surface);
}

/* --- Našepkávač ----------------------------------------------------------- */
/* Sivé doplnenie za kurzorom: vrstva presne nad poľom, napísaný text je
   neviditeľný (iba drží pozíciu), viditeľné je len doplnenie.
   Padding/okraj/font synchronizuje autosuggest.js podľa poľa. */
.search-ghost {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: pre;
    pointer-events: none;
    border: 1px solid transparent;
    font-size: 16px;
    line-height: 24px;
}

.search-ghost .ghost-typed {
    visibility: hidden;
}

.search-ghost .ghost-rest {
    color: var(--muted);
    opacity: .75;
}

.suggestions-anchor {
    position: relative;
}

/* Menu nadväzuje na pole: autosuggest.js pri otvorení dá poľu hranaté spodné
   rohy a zruší spodný okraj, menu pokračuje bez horného okraja */
.suggestions-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    padding: 0 0 10px;
    color: var(--fg);
    background: var(--input-bg);
    border: 1px solid var(--border-strong);
    border-top: 0;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 18px -6px rgba(16, 24, 40, .18);
}

/* Oddeľovač medzi poľom a návrhmi */
.suggestions-menu::before {
    content: '';
    display: block;
    height: 1px;
    margin: 0 18px 6px;
    background: var(--border);
}

/* Kým je menu otvorené, pole a menu tvoria jeden panel */
.search-box:has(.suggestions-menu[style*="block"]) .search-input {
    border-color: var(--border-strong);
    box-shadow: none;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    padding: 9px 48px;
    font-size: 15px;
    cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: var(--surface);
}

.suggestion-item.selected {
    font-weight: 500;
}

/* --- Režim vyhľadávania ako záložky --------------------------------------- */
.search-modes {
    display: flex;
    gap: 4px;
}

.search-modes input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.search-modes label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: color .15s ease, background-color .15s ease;
}

.search-modes svg {
    width: 16px;
    height: 16px;
}

.search-modes label:hover {
    color: var(--fg);
}

.search-modes label:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Úvodná stránka: segmentový prepínač */
.home .search-modes {
    justify-content: center;
    width: max-content;
    margin: 16px auto 0;
    padding: 4px;
    background: var(--surface);
    border-radius: 999px;
}

.home .search-modes label {
    padding: 6px 14px;
    border-radius: 999px;
}

.home .search-modes label:has(input:checked) {
    color: var(--fg);
    background: var(--bg);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}

/* Výsledky: záložky pod poľom s podčiarknutím aktívnej */
.has-results .search-modes {
    padding-left: 8px;
}

.has-results .search-modes label {
    padding: 10px 12px 11px;
}

.has-results .search-modes label:has(input:checked) {
    color: var(--accent);
}

.has-results .search-modes label:has(input:checked)::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
}

/* Výsledky: záložky sa počas prvých 60px skrolovania zbalia a pri návrate
   na vrch stránky sa znova rozbalia – čisté CSS cez scroll-driven animation
   (Chrome/Edge 115+, Safari 26+). Bez podpory ostanú záložky viditeľné.
   Animujú sa len transform a opacity (bežia na kompozítore, bez relayoutu):
   celá hlavička sa posunie hore o výšku záložiek, logo a pole sa o rovnaký
   kus posunú späť dole (ostanú na mieste) a záložky zmiznú pod nimi. */
@supports (animation-timeline: scroll()) {
    .has-results {
        --modes-h: 44px;
    }

    .has-results .site-header,
    .has-results .logo,
    .has-results .search-box,
    .has-results .search-modes {
        animation: linear both;
        animation-timeline: scroll(root block);
        animation-range: 0 60px;
    }

    .has-results .site-header {
        animation-name: collapse-header;
    }

    .has-results .logo,
    .has-results .search-box {
        animation-name: collapse-keep;
    }

    /* pole (a jeho návrhy) musí po zbalení prekryť skryté záložky */
    .has-results .logo,
    .has-results .search-box {
        position: relative;
        z-index: 1;
    }

    .has-results .search-modes {
        animation-name: collapse-modes;
    }

    @keyframes collapse-header {
        to { transform: translateY(calc(-1 * var(--modes-h))); }
    }

    @keyframes collapse-keep {
        to { transform: translateY(var(--modes-h)); }
    }

    @keyframes collapse-modes {
        to { opacity: 0; }
    }
}

/* --- Widgety (počasie, tetris) -------------------------------------------- */
.widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
}

.has-results .widget {
    justify-content: flex-start;
    padding-left: calc(24px + var(--gutter));
}

.has-results .widget:empty {
    display: none;
}

/* --- Výsledky ------------------------------------------------------------- */
.results {
    padding-left: calc(24px + var(--gutter));
}

.results > * {
    max-width: var(--col);
}

.results-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.results-count {
    margin-right: auto;
}

/* Oprava preklepu: "Zobrazujú sa aj výsledky pre kontakt. Hľadať iba konakt" */
.spell-notice {
    margin: 0;
    padding: 16px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--fg);
}

.spell-notice strong {
    font-style: italic;
}

.spell-exact {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.site-chip {
    display: inline-flex;
    align-items: center;
    /* rovnaká veľkosť a vzhľad ako štítky "Viac podobných z …" (.img-site) */
    gap: 7px;
    padding: 5px 6px 5px 9px;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
}

.site-chip img {
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.site-chip-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: var(--muted);
    transition: background-color .15s ease, color .15s ease;
}

.site-chip-clear:hover,
.site-chip-clear:focus-visible {
    color: var(--fg);
    background: var(--border);
}

.site-chip-clear svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.section-heading {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 500;
    color: var(--fg);
}

/* Jeden výsledok */
.result {
    margin-bottom: 30px;
}

.result-main {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.result-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Klikateľná časť výsledku: favicon, názov stránky, URL a titulok */
.result-head {
    position: relative;
    width: fit-content;
    max-width: 100%;
}

.result-source {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.favicon {
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
}

.favicon img {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.source-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.source-name,
.source-path {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.source-name {
    color: var(--fg);
    font-size: 14px;
}

.source-path {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.result-link {
    display: block;
}

.result-title {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

a.result-link:hover .result-title {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.snippet {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--fg-2);
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.result-date {
    color: var(--muted);
}

.result-date::after {
    content: ' — ';
}

.thumb {
    flex-shrink: 0;
    width: 104px;
    height: 104px;
    margin-top: 34px;
    /* náhľady sú obdĺžnikové – zobrazíme z nich štvorcový výsek zo stredu */
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.thumb.is-missing {
    display: none;
}

/* Podvýsledky z rovnakej domény – odsadené so zvislou linkou */
.sub-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 12px 0 0 13px;
    padding-left: 26px;
    border-left: 2px solid var(--border);
}

.sub-result {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px;
    margin-left: -10px;
    border-radius: 10px;
    transition: background-color .12s ease;
}

.sub-result:hover {
    background-color: var(--surface);
}

.sub-result-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.sub-result-text a.l {
    font-size: 16px;
    line-height: 1.35;
}

.sub-result:hover .sub-result-text a.l {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sub-meta {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sub-result .thumb {
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 8px;
}

.more-from-site {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 2px;
    margin-top: 6px;
    padding: 6px 8px 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background-color .12s ease;
}

.more-from-site:link,
.more-from-site:visited {
    color: var(--fg);
}

.more-from-site:hover {
    background: var(--surface);
}

.more-from-site svg {
    width: 18px;
    height: 18px;
}

/* --- Pás produktov ---------------------------------------------------------
   Šírka karty sa počíta z počtu viditeľných kariet (--pvis, polovica = náznak
   ďalšej karty); --pgaps = medzery medzi celými kartami (floor(--pvis) * gap). */
.products {
    position: relative;
    width: 100%;
    margin: 0 0 34px;
}

.products-track {
    --pvis: 4.5;
    --pgaps: 16px;
    display: flex;
    gap: 4px;
    padding: 2px 2px 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.products-track::-webkit-scrollbar {
    display: none;
}

.product {
    position: relative;
    display: flex;
    flex: 0 0 calc((100% - var(--pgaps)) / var(--pvis));
    flex-direction: column;
    min-width: 0;
    padding: 8px 8px 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    scroll-snap-align: start;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.product:hover {
    border-color: transparent;
    box-shadow: var(--card-shadow);
}

.product-img {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 120px;
    max-width: 100%;
    height: 120px;
    margin: 0 auto 8px;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

/* Náhľady sú obdĺžnikové (výška 150px) – zobrazíme z nich štvorcový výsek zo stredu */
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Fotka produktu z JSON-LD (ri.img, data-fallback ešte nepoužitý) – celý produkt na bielom, nič neorezávať */
.product-img img[data-fallback]:not([data-fb]) {
    object-fit: contain;
}

.product-img[hidden] {
    display: none;
}

.product-img.is-missing {
    background: var(--surface);
}

a.l.product-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 18px;
    min-height: 36px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

a.l.product-title:link,
a.l.product-title:visited {
    color: var(--fg);
}

.product:hover a.l.product-title {
    color: var(--al);
}

.product-price {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.product-avail {
    font-size: 12px;
    line-height: 16px;
}

.product-avail.in   { color: var(--avail-in); }
.product-avail.wait { color: var(--avail-wait); }
.product-avail.out  { color: var(--avail-out); }

/* --- Hodnotenie (ratingHtml v inc/functions.php) --------------------------- */
.rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 18px;
    white-space: nowrap;
}

.rating-value {
    color: var(--fg-2);
    font-weight: 600;
}

/* 5 sivých hviezd a nad nimi žlté orezané na --r (napr. 92 % = 4,6 z 5) */
.stars {
    position: relative;
    display: inline-block;
    color: var(--star-empty);
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 1;
}

.stars::before {
    content: '★★★★★';
}

.stars::after {
    content: '★★★★★';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--r, 0%);
    overflow: hidden;
    color: var(--star);
}

.rating.compact {
    gap: 4px;
    font-size: 12px;
}

.rating.compact .stars {
    font-size: 12px;
    letter-spacing: 0;
}

.product-site {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
}

.product-site img {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.product-site span {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Šípky – posun po celých kartách; doprava zároveň dočítava ďalšie produkty */
.products-nav {
    position: absolute;
    top: 72px;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--card-shadow);
    transform: translateY(-50%);
    cursor: pointer;
}

.products-nav[hidden] {
    display: none;
}

.products-nav:hover {
    background: var(--surface);
}

.products-nav svg {
    width: 22px;
    height: 22px;
}

.products-nav.prev { left: -19px; }
.products-nav.next { right: -19px; }

.products-nav.is-loading {
    cursor: progress;
}

.products-nav.is-loading svg {
    display: none;
}

.products-nav.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--fg);
    border-radius: 50%;
    animation: products-spin .8s linear infinite;
}

@keyframes products-spin {
    to { transform: rotate(360deg); }
}

@media (hover: none) {
    .products-nav {
        display: none;
    }
}

/* --- Stránkovanie --------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 12px 0 48px;
    font-size: 14px;
}

.pagination a,
.pagination .current {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    transition: background-color .12s ease;
}

.pagination a:hover {
    background: var(--surface);
}

.pagination .current {
    color: var(--accent-fg);
    background: var(--accent);
    font-weight: 600;
}

.pagination .page-step {
    gap: 2px;
    font-weight: 500;
}

.pagination .page-step:first-child {
    margin-right: 8px;
    padding-left: 6px;
}

.pagination .page-step:last-child {
    margin-left: 8px;
    padding-right: 6px;
}

.pagination .page-step svg {
    width: 20px;
    height: 20px;
}

/* "Načítať ďalšie" – len na mobile namiesto stránkovania */
.load-more {
    display: none;
    justify-content: center;
    margin: 8px 0 32px;
}

.load-more-btn {
    display: block;
    width: 100%;
    max-width: 420px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--card);
}

.load-more-btn:link,
.load-more-btn:visited {
    color: var(--al);
}

.load-more-btn.is-loading {
    opacity: .6;
    pointer-events: none;
}

/* --- Pätička -------------------------------------------------------------- */
.site-footer {
    /* 3 stĺpce: nastavenia | odkazy (vždy v strede) | krajina */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px 24px;
    min-height: 52px;
    padding: 12px 24px;
    color: var(--muted);
    background-color: var(--footer);
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 24px;
}

.footer-country {
    justify-self: end;
}

.footer-links a:link,
.footer-links a:visited {
    color: var(--muted);
}

.footer-links a:hover {
    color: var(--fg);
}

/* Nastavenia v pätičke: odkaz otvorí menu nad sebou (ako Google) */
.footer-settings {
    position: relative;
    justify-self: start;
}

.settings-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.settings-btn:hover,
.settings-btn[aria-expanded="true"] {
    color: var(--fg);
}

.settings-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    z-index: 50;
    min-width: 270px;
    padding: 8px 0;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.settings-item:hover {
    background: var(--border);
}

.settings-item .switch {
    flex: none;
    width: 40px;
    height: 22px;
}

/* checkbox ostáva prístupný z klávesnice (Tab + medzerník), len je neviditeľný */
.settings-item .switch input {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.settings-item input:focus-visible + .slider {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.settings-item .slider::before {
    width: 16px;
    height: 16px;
}

.settings-item input:checked + .slider {
    background: #1a73e8;
}

.settings-item input:checked + .slider::before {
    transform: translateX(18px);
    background: #fff;
}

/* Prepínač svetlý / tmavý režim */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: 28px;
    cursor: pointer;
    transition: .25s;
}

.slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: .25s;
}

input:checked + .slider {
    background: #3a434a;
}

input:checked + .slider::before {
    transform: translateX(28px);
    background: #8ab4f8;
}

.icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    pointer-events: none;
    filter: grayscale(1);
}

.sun  { left: 7px; }
.moon { right: 7px; }

input:not(:checked) + .slider .moon,
input:checked + .slider .sun {
    opacity: .35;
}

/* --- Užšie obrazovky ------------------------------------------------------ */
@media screen and (max-width: 1100px) {
    :root {
        --gutter: 140px;
    }

    .products-track {
        --pvis: 3.5;
        --pgaps: 12px;
    }

    .products-nav.prev { left: 4px; }
    .products-nav.next { right: 4px; }
}

@media screen and (max-width: 860px) {
    :root {
        --gutter: 0px;
    }

    .has-results .header-inner {
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 16px;
        padding-top: 12px;
    }

    .has-results .logo {
        padding-top: 11px;
    }

    .has-results .logo img {
        width: 72px;
    }

    .has-results .search-modes {
        grid-column: 1 / -1;
    }

    .results,
    .has-results .widget {
        padding-left: 24px;
    }

    .results > * {
        max-width: none;
    }
}

/* --- Mobil: výsledky ako karty -------------------------------------------- */
@media screen and (max-width: 600px) {
    .header-inner,
    .results {
        padding-left: 12px;
        padding-right: 12px;
    }

    .home .logo img {
        width: 150px;
    }

    .has-results {
        background: var(--surface);
    }

    .has-results .site-header {
        background: var(--bg);
    }

    .has-results .header-inner {
        column-gap: 10px;
        padding-top: 10px;
    }

    .has-results .logo {
        padding-top: 0px;
    }

    /* Mobilné logo bez nápisu (lo_s_m.svg) je štvorcový znak */
    .has-results .logo img {
        width: 36px;
    }

    /* Pole v aktívnom stave: logo sa skryje a pole sa roztiahne doľava
       cez jeho miesto (šírka loga 36px + column-gap 10px);
       prepínače režimu ostávajú na mieste */
    .has-results .header-inner:has(.search-input:focus) .logo {
        visibility: hidden;
    }

    .has-results .header-inner:has(.search-input:focus) .search-box {
        margin-left: -46px;
    }

    .has-results .search-input {
        height: 44px;
        padding: 0 42px;
    }

    /* Text návrhov zarovno s textom v poli */
    .has-results .suggestion-item {
        padding-left: 42px;
        padding-right: 42px;
    }

    .has-results .suggestions-menu::before {
        margin-left: 14px;
        margin-right: 14px;
    }

    .search-icon {
        left: 13px;
    }

    .has-results .search-modes {
        margin-top: 2px;
        padding-left: 0;
        gap: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    /* tri záložky (web, sémantické, obrázky) sa musia zmestiť na úzky displej */
    .has-results .search-modes label {
        flex: none;
        gap: 5px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .has-results .search-modes label:has(input:checked)::after {
        left: 3px;
        right: 3px;
    }

    .results-info {
        padding: 12px 4px;
    }

    .section-heading {
        margin-left: 4px;
    }

    /* karta cez celú šírku: záporný okraj zruší bočný padding .results (12px) */
    .result {
        margin: 0 -12px 10px;
        padding: 14px 16px;
        background: var(--card);
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .result-main {
        gap: 12px;
    }

    .result-title {
        font-size: 18px;
    }

    .thumb {
        width: 76px;
        height: 76px;
        margin-top: 36px;
    }

    .sub-results {
        margin: 10px 0 0;
        padding-left: 0;
        border-left: 0;
        gap: 0;
    }

    .sub-result {
        margin-left: 0;
        padding: 10px 0;
        border-top: 1px solid var(--border);
        border-radius: 0;
    }

    .sub-result:hover {
        background: none;
    }

    .sub-result .thumb {
        width: 44px;
        height: 44px;
        margin: 0;
    }

    .more-from-site {
        margin-top: 4px;
    }

    .products-track {
        --pvis: 2.4;
        --pgaps: 8px;
    }

    .products {
        margin-bottom: 20px;
    }

    .site-footer {
        grid-template-columns: 1fr 1fr;
    }

    .footer-links {
        order: 3;
        grid-column: 1 / -1;
    }

    .pagination {
        display: none;
    }

    .load-more {
        display: flex;
    }
}

/* --- "Viac podobných z …" (domény z výsledkov → skrytý ?site=, web aj obrázky) -------------------- */
/* jeden riadok, ktorý sa dá posúvať do strany (bez viditeľného posuvníka) */
.img-sites {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin: -8px 0 14px;
    padding: 2px 0;              /* miesto pre obrys pri fokuse */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.img-sites::-webkit-scrollbar {
    display: none;
}

/* Stmievanie okraja, kde rad pokračuje (triedy nastavuje js/app.js) */
.img-sites.fade-left  { --fade-l: 56px; }
.img-sites.fade-right { --fade-r: 56px; }

.img-sites.fade-left,
.img-sites.fade-right {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 0px)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 0px)), transparent 100%);
}

/* Obal so šípkami (vytvára js/app.js; bez JS ostáva samotný .img-sites) */
.img-sites-wrap {
    position: relative;
    margin: -8px 0 14px;
}

.img-sites-wrap > .img-sites {
    margin: 0;
}

.img-sites-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--card-shadow);
    transform: translateY(-50%);
    cursor: pointer;
}

.img-sites-nav[hidden] {
    display: none;
}

.img-sites-nav:hover {
    background: var(--surface);
}

.img-sites-nav svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.img-sites-nav.prev { left: 0; }
.img-sites-nav.next { right: 0; }

/* dotykové zariadenia posúvajú prstom – šípky netreba, stmievanie ostáva */
@media (hover: none) {
    .img-sites-nav {
        display: none;
    }
}

.img-sites > .img-site {
    flex: none;
    scroll-snap-align: start;
}

.img-site {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 9px;
    font-size: 13px;
    white-space: nowrap;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    background: var(--card);
    transition: background-color .15s ease, border-color .15s ease;
}

/* Zaoblené sú len vonkajšie okraje prvej a poslednej domény */
.img-sites > .img-site:first-child {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.img-sites > .img-site:last-child {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
}

.img-site:link,
.img-site:visited {
    color: var(--fg);
}

.img-site:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.img-site img {
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 3px;
}
