/**
 * 2026-004 Linka - hlavicka (komponenta hlavicka, varianta default). Markup hlavicka.latte,
 * hlavicka--checkout.latte. Navrh: 01-Homepage-desktop / -mobil, 06-Stavy (mega menu, sticky, drawer).
 */

#hlavicka.lk-hd {
    position: relative;
    z-index: 50;
    background: var(--tpl-header-bg);
    color: var(--tpl-header-text);
}

/* --- oznamovaci lista (jadro .tpl-oznameni, barvy v core.css = akcent) --- */
.lk-hd .tpl-oznameni { min-height: 32px; font-size: 12px; letter-spacing: .02em; }
.lk-hd .tpl-oznameni-in { min-height: 32px; padding-top: 0; padding-bottom: 0; }
.lk-hd .tpl-oznameni-text { color: inherit; }

/* --- topbar --- */
.lk-topbar {
    background: var(--tpl-topbar-bg);
    color: var(--tpl-topbar-text);
    font-size: 12px;
    letter-spacing: .02em;
}
.lk-topbar-in {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 36px;
}
.lk-topbar-info {
    display: flex;
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}
.lk-topbar-r { justify-self: end; }

/* --- jazyk a mena (details) --- */
.lk-lm { position: relative; }
.lk-lm-tl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 2px;
    list-style: none;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: .02em;
    opacity: .8;
}
.lk-lm-tl::-webkit-details-marker { display: none; }
.lk-lm-tl:hover,
.lk-lm[open] .lk-lm-tl { opacity: 1; }
.lk-lm[open] .lk-lm-sipka { transform: rotate(180deg); }
.lk-lm-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 70;
    display: flex;
    gap: 32px;
    min-width: 220px;
    padding: 16px 20px;
    background: var(--tpl-surface);
    color: var(--tpl-text);
    border: 1px solid var(--tpl-line);
    border-radius: var(--tpl-thumb-radius);
}
.lk-lm-sl { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.lk-lm-nadpis {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tpl-text-light);
}
.lk-lm-volba,
a.lk-lm-volba { display: block; padding: 6px 0; font-size: 14px; color: var(--tpl-text); }
.lk-lm-volba--on { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* --- hlavni radek --- */
.lk-hd-pruh { background: var(--tpl-header-bg); }
#hlavicka_obsah.lk-hd-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding-top: 22px;
    padding-bottom: 18px;
    border-bottom: 0;
    background: none;
    max-width: calc(var(--tpl-max-width) + 2 * var(--tpl-gutter));
}
.lk-hd-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lk-hd-c { display: flex; justify-content: center; }
.lk-hd-r {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 28px;
    font-size: 13px;
}
.lk-hd-moduly[hidden] { display: none; }

/* --- logotyp --- */
.lk-logo,
a.lk-logo {
    display: inline-flex;
    align-items: center;
    color: var(--tpl-primary);
    text-decoration: none;
    white-space: nowrap;
}
.lk-logo:hover { color: var(--tpl-primary); text-decoration: none; }
.lk-logo--text {
    font-family: var(--tpl-font);
    font-weight: 500;
    line-height: 1;
    letter-spacing: .32em;
    margin-right: -.32em;
    text-transform: uppercase;
}
.lk-logo--hlavicka { font-size: 26px; }
.lk-logo--mobil { font-size: 20px; }
.lk-logo--paticka { font-size: 22px; color: var(--tpl-footer-text); }
.lk-logo--paticka:hover { color: var(--tpl-footer-text); }
.lk-logo-pruh {
    display: inline-block;
    width: 3px;
    height: 1em;
    margin-right: .32em;
    background: var(--tpl-accent);
}
.lk-logo--mobil .lk-logo-pruh { width: 2px; }
.lk-logo--obrazek img { display: block; max-width: 240px; max-height: 48px; width: auto; height: auto; }

/* --- hledani (modul fulltextove_vyhledavani jako pilulka 260 x 40) --- */
.lk-hd-search .tpl-header-search { width: auto; margin: 0; padding: 0; background: none; }
#hlavicka .lk-hd-search form {
    position: relative;
    display: flex;
    align-items: center;
    width: 260px;
    height: 40px;
    margin: 0;
    padding: 0 16px 0 40px;
    border: 1px solid var(--tpl-border);
    border-radius: var(--tpl-pill);
    background: var(--tpl-surface);
    box-shadow: none;
}
#hlavicka .lk-hd-search form::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    background: var(--tpl-text-light);
    -webkit-mask: var(--tpl-ico-search) center / contain no-repeat;
    mask: var(--tpl-ico-search) center / contain no-repeat;
}
#hlavicka .lk-hd-search form:focus-within { border-color: var(--tpl-primary); }
#hlavicka .lk-hd-search input.input_text,
#hlavicka .lk-hd-search input[type="text"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--tpl-text);
    font: 400 13px/1 var(--tpl-font);
}
#hlavicka .lk-hd-search input.defaultTextActive { color: var(--tpl-text-light); }
#hlavicka .lk-hd-search input.submit,
#hlavicka .lk-hd-search input[type="submit"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    font-size: 0;
    cursor: pointer;
}
.lk-hd-hledat {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tpl-primary);
    font: 500 13px/1 var(--tpl-font);
    cursor: pointer;
}
.lk-hd-burger,
.lk-hd-zpet { display: none; }

/* --- textove odkazy vpravo --- */
.lk-hd-odkaz,
a.lk-hd-odkaz {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--tpl-header-text);
    font-size: 13px;
    white-space: nowrap;
}
.lk-hd-odkaz:hover { color: var(--tpl-header-text); text-decoration: underline; text-underline-offset: 4px; }
.lk-hd-kosik-ico { display: none; }
.lk-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--tpl-cta);
    color: var(--tpl-cta-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.lk-count[hidden] { display: none; }

/* --- navigace + textove mega menu --- */
.lk-nav { position: relative; background: var(--tpl-menu-bg); border-top: 1px solid var(--tpl-line); border-bottom: 1px solid var(--tpl-line); }
.lk-nav-ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 34px;
    margin: 0 auto;
    list-style: none;
}
.lk-nav-li { position: static; }
.lk-nav-a,
a.lk-nav-a {
    display: block;
    padding: 16px 0 14px;
    border-bottom: 2px solid transparent;
    color: var(--tpl-menu-text);
    font-size: 13px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.lk-nav-a:hover,
.lk-nav-li--on > .lk-nav-a,
.lk-nav-li.is-open > .lk-nav-a {
    color: var(--tpl-menu-text);
    border-bottom-color: var(--tpl-primary);
    text-decoration: none;
}
a.lk-nav-a--sleva,
a.lk-nav-a--sleva:hover { color: var(--tpl-sale-price); text-decoration: var(--tpl-sale-deco); text-underline-offset: 4px; }
a.lk-nav-a--info { font-weight: 400; color: var(--tpl-text-light); }

.lk-mega {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 60;
    background: var(--tpl-surface);
    border-top: 1px solid var(--tpl-line);
    border-bottom: 1px solid var(--tpl-line);
    text-align: left;
}
.lk-nav-li.is-open > .lk-mega,
.lk-nav-li:focus-within > .lk-mega { display: block; }
html:not(.lk-js) .lk-nav-li--panel:hover > .lk-mega { display: block; }
.lk-mega-in {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) auto;
    gap: 48px;
    padding-top: 32px;
    padding-bottom: 32px;
}
.lk-mega-nadpis {
    margin-bottom: 8px;
    font-family: var(--tpl-font-head);
    font-weight: var(--tpl-head-weight);
    letter-spacing: var(--tpl-head-ls);
    font-size: calc(20px - var(--tpl-head-shrink));
    line-height: 1.3;
    color: var(--tpl-primary);
}
.lk-mega-popis { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--tpl-text-light); }
.lk-mega-sl-nadpis {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tpl-text-light);
}
.lk-mega-pod { margin: 0; padding: 0; list-style: none; }
.lk-mega-pod--2 { columns: 2; column-gap: 40px; }
.lk-mega-pod--3 { columns: 3; column-gap: 40px; }
.lk-mega-pod a { display: block; padding: 0; line-height: 32px; font-size: 14px; color: var(--tpl-text); }
.lk-mega-n { color: var(--tpl-text-light); font-size: 12px; margin-left: 4px; }
.lk-mega-sl--znacky { min-width: 160px; }

/* --- pilulky kategorii (jen homepage, mobil) a drawer --- */
.lk-pilulky-kat { display: none; }
.lk-drawer,
.lk-drawer-overlay { display: none; }

/* --- sticky (hd_sticky = ano: body.tpl-hd-sticky po 120 px, J-L8 body.tpl-hd-nahoru) --- */
body.tpl-hd-sticky #hlavicka.lk-hd { min-height: var(--lk-hd-h, auto); }
body.tpl-hd-sticky .lk-hd-pruh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    border-bottom: 1px solid var(--tpl-line);
}
body.tpl-hd-sticky #hlavicka_obsah.lk-hd-main {
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 0;
}
body.tpl-hd-sticky .lk-logo--hlavicka { font-size: 20px; }
body.tpl-hd-sticky .lk-logo--hlavicka.lk-logo--obrazek img { max-height: 36px; }
body.tpl-hd-sticky:not(.tpl-hd-nahoru) .lk-nav { display: none; }
body.tpl-hd-sticky .lk-nav { border-top: 1px solid var(--tpl-line); border-bottom: 0; }
body.tpl-hd-sticky .lk-hd-search { display: none; }
body.tpl-hd-sticky .lk-hd-hledat { display: inline-flex; }
body.tpl-hd-sticky #hlavicka.lk-search-open .lk-hd-search,
#hlavicka.lk-search-open .lk-hd-search {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 75;
    padding: 12px var(--tpl-gutter);
    background: var(--tpl-surface);
    border-bottom: 1px solid var(--tpl-line);
}
#hlavicka.lk-search-open .lk-hd-search form { width: 100%; max-width: 560px; margin: 0 auto; }
.lk-hd-l { position: static; }
body.tpl-hd-sticky #hlavicka_obsah.lk-hd-main { position: relative; }

/* ================================================================
   Tablet 769-1100: mensi mezery v navigaci a odkazech
   ================================================================ */
@media (max-width: 1100px) {
    .lk-nav-ul { column-gap: 22px; }
    .lk-hd-r { gap: 18px; }
    #hlavicka .lk-hd-search form { width: 220px; }
    .lk-mega-in { grid-template-columns: 220px minmax(0, 1fr); }
    .lk-mega-sl--znacky { display: none; }
}

/* ================================================================
   Mobil <= 768 px (01-Homepage-mobil, 06 sekce 04)
   ================================================================ */
@media (max-width: 768px) {
    .lk-topbar { font-size: 14px; }
    .lk-topbar-in { display: flex; justify-content: center; min-height: 32px; }
    .lk-topbar-l,
    .lk-topbar-r { display: none; }
    .lk-topbar-info li ~ li { display: none; }
    .lk-topbar-info { gap: 0; white-space: normal; text-align: center; }

    #hlavicka_obsah.lk-hd-main {
        grid-template-columns: 1fr auto 1fr;
        gap: 8px;
        min-height: 56px;
        padding-top: 0;
        padding-bottom: 0;
    }
    .lk-logo--hlavicka { font-size: 20px; }
    .lk-logo--hlavicka .lk-logo-pruh { width: 2px; }
    .lk-logo--obrazek img { max-width: 160px; max-height: 36px; }
    .lk-hd-l { gap: 0; }
    .lk-hd-burger,
    .lk-hd-zpet {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: -12px;
        color: var(--tpl-primary);
        cursor: pointer;
    }
    .lk-hd--detail .lk-hd-burger { display: none; }
    .lk-hd-search { display: none; }
    .lk-hd-hledat {
        display: inline-flex;
        justify-content: center;
        width: 44px;
        order: 3;
        margin-left: auto;
    }
    .lk-hd-hledat svg { width: 20px; height: 20px; }
    .lk-hd-hledat-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .lk-hd-l { display: flex; }
    .lk-hd-r { gap: 0; }
    a.lk-hd-ucet,
    a.lk-hd-obl { display: none; }
    .lk-hd-kosik { position: relative; justify-content: center; width: 44px; }
    .lk-hd-kosik-ico { display: block; }
    .lk-hd-kosik-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .lk-hd-kosik .lk-count {
        position: absolute;
        top: 4px;
        right: 2px;
        min-width: 16px;
        height: 16px;
        margin: 0;
        padding: 0 4px;
        font-size: 10px;
        background: var(--tpl-accent);
        color: var(--tpl-accent-text);
    }
    /* lupa vpravo vedle kosiku: presunout tlacitko do praveho sloupce vizualne */
    .lk-hd-l .lk-hd-hledat { position: absolute; right: calc(var(--tpl-gutter) + 40px); top: 50%; transform: translateY(-50%); }
    #hlavicka_obsah.lk-hd-main { position: relative; }
    #hlavicka.lk-search-open .lk-hd-search { padding: 10px var(--tpl-gutter); }

    .lk-nav { display: none; }
    body.tpl-hd-sticky.tpl-hd-nahoru .lk-nav { display: none; }

    .lk-pilulky-kat { display: block; border-bottom: 1px solid var(--tpl-line); }
    .lk-pilulky-kat ul {
        display: flex;
        gap: 8px;
        margin: 0;
        padding: 12px var(--tpl-gutter);
        list-style: none;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .lk-pilulky-kat ul::-webkit-scrollbar { display: none; }
    .lk-pilulky-kat .lk-pilulka { font-size: 14px; }

    /* drawer zleva 86 % */
    .lk-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1001;
        width: 86%;
        max-width: 380px;
        overflow-y: auto;
        background: var(--tpl-surface);
        color: var(--tpl-text);
        border-right: 1px solid var(--tpl-line);
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform .25s ease, visibility .25s;
    }
    .lk-drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: var(--tpl-overlay);
    }
    #tpl-menu-toggle:checked ~ #hlavicka .lk-drawer { transform: none; visibility: visible; }
    #tpl-menu-toggle:checked ~ #hlavicka .lk-drawer-overlay { display: block; }
    .lk-drawer-hl {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 56px;
        padding: 0 4px 0 var(--tpl-gutter);
        border-bottom: 1px solid var(--tpl-line);
    }
    .lk-drawer-x {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        cursor: pointer;
    }
    .lk-drawer-menu { margin: 0; padding: 0; list-style: none; }
    .lk-drawer-menu > li { border-bottom: 1px solid var(--tpl-line); }
    .lk-drawer-a,
    a.lk-drawer-a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 52px;
        padding: 0 var(--tpl-gutter);
        color: var(--tpl-text);
        font-size: 14px;
        font-weight: 500;
        letter-spacing: .08em;
        text-transform: uppercase;
        list-style: none;
        cursor: pointer;
    }
    .lk-drawer-a::-webkit-details-marker { display: none; }
    .lk-drawer-a--sleva,
    a.lk-drawer-a--sleva { color: var(--tpl-sale-price); text-decoration: var(--tpl-sale-deco); text-underline-offset: 4px; }
    .lk-drawer-pm { position: relative; width: 12px; height: 12px; flex: 0 0 auto; }
    .lk-drawer-pm::before,
    .lk-drawer-pm::after {
        content: '';
        position: absolute;
        left: 0;
        top: 5.5px;
        width: 12px;
        height: 1px;
        background: currentColor;
    }
    .lk-drawer-pm::after { transform: rotate(90deg); }
    details[open] > .lk-drawer-a .lk-drawer-pm::after { display: none; }
    .lk-drawer-pod { margin: 0; padding: 0 0 12px; list-style: none; }
    .lk-drawer-pod a { display: block; padding: 10px var(--tpl-gutter) 10px calc(var(--tpl-gutter) + 12px); font-size: 15px; color: var(--tpl-text); }
    .lk-drawer-dole {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 20px;
        margin-top: auto;
        padding: 20px var(--tpl-gutter) 28px;
        font-size: 14px;
    }
    .lk-drawer-dole a { display: inline-flex; align-items: center; min-height: 44px; color: var(--tpl-text); }
    .lk-drawer-lm { width: 100%; margin-top: 8px; }
    .lk-lm--drawer .lk-lm-tl {
        opacity: 1;
        min-height: 44px;
        padding: 0 18px;
        border: 1px solid var(--tpl-border);
        border-radius: var(--tpl-pill);
        font-size: 14px;
    }
    .lk-lm--drawer .lk-lm-panel { position: static; margin-top: 8px; }
    body:has(#tpl-menu-toggle:checked) { overflow: hidden; }

    /* sticky na mobilu = cely radek 56 px */
    body.tpl-hd-sticky #hlavicka_obsah.lk-hd-main { min-height: 56px; padding-top: 0; padding-bottom: 0; }
    body.tpl-hd-sticky .lk-logo--hlavicka { font-size: 20px; }
}

/* slovnik eshopu muze mit "kosik" malym pismenem - prvni pismeno vzdy velke */
.lk-hd-kosik-t { display: inline-block; }
.lk-hd-kosik-t::first-letter { text-transform: uppercase; }
@media (max-width: 768px) {
    .lk-hd-pruh { border-bottom: 1px solid var(--tpl-line); }
}

/* ================================================================
   Hlavicka pokladny (hlavicka--checkout.latte)
   ================================================================ */
.lk-hd--checkout .lk-hd-pruh { border-bottom: 1px solid var(--tpl-line); }
#hlavicka_obsah.lk-hdc-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    max-width: calc(var(--tpl-max-width) + 2 * var(--tpl-gutter));
    background: none;
}
.lk-hdc-zpet,
a.lk-hdc-zpet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--tpl-primary);
    font-size: 13px;
    font-weight: 500;
}
.lk-hdc-r {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tpl-text);
}
.lk-hdc-kroky-pas { border-top: 1px solid var(--tpl-line); }
.lk-hdc-kroky {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0 auto;
    padding-top: 12px;
    padding-bottom: 12px;
    list-style: none;
    font-size: 13px;
    color: var(--tpl-text-light);
}
.lk-hdc-krok { display: flex; align-items: center; gap: 16px; }
.lk-hdc-krok + .lk-hdc-krok::before {
    content: '';
    display: block;
    width: 48px;
    height: 1px;
    background: var(--tpl-border);
}
.lk-hdc-krok a { color: var(--tpl-text); }
.lk-hdc-krok--on { color: var(--tpl-primary); font-weight: 600; }
.lk-hdc-krok--hotovo { color: var(--tpl-text); }
@media (max-width: 768px) {
    #hlavicka_obsah.lk-hdc-main { min-height: 56px; gap: 8px; }
    .lk-hdc-zpet-t,
    .lk-hdc-bezpecne { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .lk-hdc-zpet { width: 44px; justify-content: center; margin-left: -12px; }
    .lk-hdc-kroky { gap: 10px; }
    .lk-hdc-krok { gap: 10px; }
    .lk-hdc-krok + .lk-hdc-krok::before { width: 20px; }
    .lk-hdc-krok:not(.lk-hdc-krok--on) .lk-hdc-nazev { display: none; }
}

/* "Dalsi" - polozky navigace, ktere se nevejdou do radku (js/linka.js) */
.lk-nav-li--dalsi { position: relative; }
button.lk-nav-dalsi { border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; font-family: var(--tpl-font); }
.lk-nav-dalsi-ul {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 65;
    min-width: 220px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: var(--tpl-surface);
    border: 1px solid var(--tpl-line);
}
.lk-nav-li--dalsi.is-open > .lk-nav-dalsi-ul { display: block; }
a.lk-nav-dalsi-a {
    display: block;
    padding: 0 20px;
    line-height: 40px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tpl-text);
    white-space: nowrap;
}
