/* ==========================================================================
   Trofejovo — filter produktov a stránky tém
   Farby berie z astra-child (--tfl-*), záložné hodnoty sú tie isté.
   Pod 921 px Astra sidebar skryje — panel sa vtedy presunie do šuplíka (filter.js).
   ========================================================================== */

.tff,
.tff-bar,
.tff-empty,
.tff-themes,
.tff-tournament,
.tff-section,
.tff-jump {
    --tff-primary: var(--tfl-primary, #2f196e);
    --tff-primary-dark: var(--tfl-primary-dark, #1e1048);
    --tff-accent: var(--tfl-accent, #00e5a0);
    --tff-text: var(--tfl-text, #1a1a1a);
    --tff-muted: var(--tfl-muted, #666);
    --tff-border: var(--tfl-border, #d8dbe0);
    --tff-bg: var(--tfl-bg, #f5f5f5);
    --tff-tint: #f3f0fb;
}

/* ---------------------------------------------------------------- panel
   Plochý vzhľad ako pôvodné menu kategórií v sidebari (astra-child):
   tenká fialová linka navrchu, žiadna karta, aktívna položka = ľavý mätový
   prúžok. Hlavné sekcie otvorené, doplnkové zbalené (šetrí výšku). */

.tff {
    border-top: 2px solid var(--tff-primary);
    margin-bottom: 24px;
    color: var(--tff-text);
    font-size: 13px;
    transition: opacity .15s;
}

.tff.is-loading,
#primary.tff-loading {
    opacity: .55;
    pointer-events: none;
}

.tff__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 4px 8px;
}

.tff__title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--tff-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tff__n,
.tff-facet__sel {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--tff-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.tff__head .tff__reset {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--tff-primary);
    text-decoration: underline !important;
}

.tff__close,
.tff__close:hover,
.tff__close:focus {
    background: none !important;
    color: var(--tff-text) !important;
    box-shadow: none !important;
}

.tff__close {
    display: none;
    margin-left: auto;
    border: 0;
    font-size: 30px;
    line-height: 1;
    padding: 0 4px !important;
    cursor: pointer;
}

.tff__none {
    color: var(--tff-muted);
    margin: 4px 4px 12px;
    font-size: 12.5px;
}

/* ---- sekcia (akordeón) */

.tff-facet {
    border-top: 1px solid #eee;
}

.tff .tff-facet__head,
.tff .tff-facet__head:hover,
.tff .tff-facet__head:focus {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 9px 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--tff-text) !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-align: left;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}

.tff .tff-facet__head:hover .tff-facet__title {
    color: var(--tff-primary);
}

.tff .tff-facet__head:focus-visible {
    outline: 2px solid var(--tff-primary);
    outline-offset: -2px;
}

.tff-facet__chev {
    margin-left: auto;
    width: 7px;
    height: 7px;
    border: solid #999;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .15s;
    flex: 0 0 auto;
}

.tff-facet.is-open .tff-facet__chev {
    transform: rotate(-135deg) translate(-2px, -2px);
}

.tff-facet__body {
    padding: 0 0 10px;
}

/* zbalené len keď beží JS — bez neho je všetko otvorené a funkčné */
.tff--js .tff-facet:not(.is-open) .tff-facet__body {
    display: none;
}

.tff-facet__list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.tff-li {
    margin: 0;
}

.tff-opt--more {
    display: none;
}

.tff-facet.is-expanded .tff-opt--more {
    display: list-item;
}

/* ---- zoznam (checkbox) */

.tff-opt--check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 29px;
    padding: 4px 6px 4px 10px;
    border-left: 2px solid transparent;
    color: #454545;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background .15s, border-color .15s, color .15s;
}

.tff-opt--check:hover,
.tff-opt--check:focus-visible {
    background: #faf9fd;
    border-left-color: rgba(47, 25, 110, .3);
    color: var(--tff-primary);
}

.tff-opt--check.is-active {
    background: #f6f4fb;
    border-left-color: var(--tff-accent);
    color: var(--tff-primary);
    font-weight: 700;
}

.tff-opt__box {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    border: 1.5px solid #c3c6cc;
    border-radius: 3px;
    background: #fff;
    position: relative;
    transition: border-color .15s, background .15s;
}

.tff-opt--check:hover .tff-opt__box {
    border-color: var(--tff-primary);
}

.tff-opt--check.is-active .tff-opt__box {
    border-color: var(--tff-primary);
    background: var(--tff-primary);
}

.tff-opt--check.is-active .tff-opt__box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.tff-opt__label {
    flex: 1 1 auto;
    min-width: 0;
}

.tff-opt__count {
    flex: 0 0 auto;
    padding-left: 6px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #aaa;
}

.tff-opt--check.is-active .tff-opt__count {
    color: var(--tff-primary);
    opacity: .6;
}

.tff .tff-more,
.tff .tff-more:hover,
.tff .tff-more:focus {
    display: inline-block;
    margin: 2px 0 0 10px;
    padding: 2px 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--tff-primary) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.tff .tff-more:hover {
    text-decoration: underline;
}

/* ---- navigácia kategóriami (zbalená sekcia na vrchu) */

.tff-facet__cur {
    min-width: 0;
    margin-left: auto;
    padding-left: 8px;
    overflow: hidden;
    color: var(--tff-muted);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tff-facet__cur + .tff-facet__chev {
    margin-left: 8px;
}

.tff-opt--nav {
    padding-left: 10px;
}

.tff-opt--nav .tff-opt__label {
    flex: 1 1 auto;
}

.tff-opt--back {
    color: var(--tff-primary);
    font-weight: 600;
}

/* ---- pilulky (cena, rozmery, farba) */

.tff-facet--pills .tff-facet__list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 2px !important;
}

.tff-opt--pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border: 1px solid var(--tff-border);
    border-radius: 999px;
    background: #fff;
    color: #454545;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none !important;
    transition: border-color .15s, color .15s, background .15s;
}

.tff-opt--pill .tff-opt__count {
    padding-left: 0;
    font-size: 10.5px;
}

.tff-opt--pill:hover,
.tff-opt--pill:focus-visible {
    border-color: var(--tff-primary);
    color: var(--tff-primary);
}

.tff-opt--pill.is-active {
    background: var(--tff-primary);
    border-color: var(--tff-primary);
    color: #fff;
    font-weight: 700;
}

.tff-opt--pill.is-active .tff-opt__count {
    color: rgba(255, 255, 255, .7);
}

.tff-swatch {
    flex: 0 0 11px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .18);
}

.tff-swatch--zlata      { background: linear-gradient(135deg, #f7e08a, #c9a227); }
.tff-swatch--strieborna { background: linear-gradient(135deg, #f2f2f2, #a9a9a9); }
.tff-swatch--bronzova   { background: linear-gradient(135deg, #e0a36b, #9a5b2a); }
.tff-swatch--cierna     { background: #1d1d1d; }
.tff-swatch--biela      { background: #fff; }
.tff-swatch--modra      { background: #1f5fbf; }
.tff-swatch--cervena    { background: #c62828; }
.tff-swatch--zelena     { background: #2e7d32; }
.tff-swatch--zlta       { background: #f5d100; }
.tff-swatch--oranzova   { background: #ef7d00; }
.tff-swatch--ruzova     { background: #ec6aa6; }
.tff-swatch--fialova    { background: #7b3fa0; }
.tff-swatch--siva       { background: #8d8d8d; }
.tff-swatch--hneda      { background: #6d4726; }

/* ---- vlastné rozpätie ceny */

.tff-price {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 8px 2px 0;
}

.tff .tff-price input {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: 30px;
    min-height: 30px;
    padding: 3px 8px !important;
    border: 1px solid var(--tff-border);
    border-radius: 6px;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    box-shadow: none;
}

.tff .tff-price input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.tff .tff-price input::-webkit-outer-spin-button,
.tff .tff-price input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tff .tff-price input::placeholder {
    font-size: 12px;
    color: #999;
}

.tff-price__dash {
    color: #aaa;
}

.tff .tff-price button {
    flex: 0 0 auto;
    height: 30px;
    min-height: 30px;
    padding: 0 10px !important;
    border: 1px solid var(--tff-primary) !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: var(--tff-primary) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer;
}

.tff .tff-price button:hover {
    background: var(--tff-primary) !important;
    color: #fff !important;
}

.tff__foot,
.tff__apply {
    display: none;
}

.tff__foot .tff__reset {
    flex: 0 0 auto;
    padding: 12px 14px;
    border: 1px solid var(--tff-border);
    border-radius: 8px;
    background: #fff;
    color: var(--tff-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
}

/* ---- na počítači ostáva filter pri scrollovaní na očiach
   Sticky musí byť obal .sidebar-main — ten je v #secondary, ktorý Astra
   naťahuje na výšku výpisu; samotný panel by sa nemal kam posúvať. */
@media (min-width: 922px) {
    /* --tff-header = výška pripnutej hlavičky (meria filter.js), aby filter
       nezaliezol pod ňu */
    .sidebar-main:has(> .tff) {
        position: sticky;
        top: calc(var(--tff-header, 0px) + 16px);
    }

    .tff {
        max-height: calc(100vh - var(--tff-header, 0px) - 32px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #ddd transparent;
        padding-right: 2px;
    }
}

/* ---------------------------------------------------------------- lišta nad výpisom */

.tff-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.tff-bar:not(:has(.tff-chips)) {
    margin: 0;
}

.tff-open {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--tff-primary);
    border-radius: 999px;
    background: #fff;
    color: var(--tff-primary);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}

.tff-open:hover,
.tff-open:focus {
    background: var(--tff-tint);
    color: var(--tff-primary);
}

.tff-open__icon {
    width: 16px;
    height: 12px;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 70% 2px no-repeat,
        linear-gradient(currentColor, currentColor) bottom / 40% 2px no-repeat;
}

.tff-open__n {
    background: var(--tff-primary);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    padding: 0 6px;
}

.tff-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tff-chips li {
    margin: 0;
}

.tff-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 12px;
    border-radius: 999px;
    background: var(--tff-tint);
    color: var(--tff-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.tff-chip:hover {
    border-color: var(--tff-primary);
    color: var(--tff-primary);
}

.tff-chip__x {
    font-size: 16px;
    line-height: 1;
}

.tff-chip--reset {
    background: #fff;
    border: 1px solid var(--tff-primary);
    font-weight: 700;
}

/* ---------------------------------------------------------------- prázdny výsledok */

.tff-empty {
    background: #fff;
    border: 1px dashed var(--tff-border);
    border-radius: 10px;
    padding: 20px;
    margin: 10px 0 30px;
}

.tff-empty__lead {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
}

/* ---------------------------------------------------------------- mobil: šuplík */

@media (max-width: 921px) {
    .tff-open {
        display: inline-flex;
    }

    .tff-bar {
        margin: 0 0 14px;
    }

    .tff.tff--drawer {
        background: #fff;
        border-top: 0;
        font-size: 14px;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(88vw, 380px);
        margin: 0;
        border: 0;
        border-radius: 0 12px 12px 0;
        z-index: 100000;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 14px 16px 0;
        transform: translateX(-105%);
        transition: transform .22s ease-out, opacity .15s;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .18);
        display: flex;
        flex-direction: column;
    }

    .tff.tff--drawer.is-open {
        transform: none;
    }

    .tff--drawer .tff__close {
        display: block;
        margin-left: 0;
    }

    .tff--drawer .tff__head > .tff__close:only-of-type,
    .tff--drawer .tff__head:not(:has(.tff__reset)) .tff__close {
        margin-left: auto;
    }

    .tff--drawer .tff__head {
        position: sticky;
        top: -14px;
        background: #fff;
        padding: 6px 0;
        z-index: 1;
    }

    .tff--drawer .tff__head {
        gap: 10px;
    }

    .tff--drawer .tff__head .tff__reset {
        margin-left: auto;
        margin-right: 6px;
        padding: 6px 4px;
        font-size: 13.5px;
    }

    .tff--drawer .tff__foot {
        position: sticky;
        bottom: 0;
        margin-top: auto;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 0 16px;
        box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, .12);
    }

    .tff--drawer .tff__apply {
        display: block;
        flex: 1 1 auto;
        padding: 12px 14px;
        border: 0;
        border-radius: 8px;
        background: var(--tff-primary);
        color: #fff;
        font-weight: 700;
        font-size: 15px;
        cursor: pointer;
    }

    .tff-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .4);
        z-index: 99999;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s;
    }

    .tff-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    html.tff-lock,
    html.tff-lock body {
        overflow: hidden;
    }

    .tff-opt--check {
        min-height: 40px;
        font-size: 14px;
    }

    .tff-opt--pill {
        padding: 7px 12px;
        font-size: 13.5px;
    }
}

/* ---------------------------------------------------------------- stránka témy */

.tff-theme-intro {
    max-width: 780px;
    color: var(--tfl-muted, #555);
    font-size: 15px;
}

.tff-tournament {
    background: linear-gradient(135deg, #f3f0fb, #effcf7);
    border: 1px solid #e4def5;
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 22px;
}

.tff-tournament__title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--tff-primary);
}

.tff-tournament__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: tff-step;
}

.tff-tournament__list li {
    margin: 0;
    counter-increment: tff-step;
}

.tff-tournament__list a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
    padding: 10px 12px 10px 44px;
    background: #fff;
    border: 1px solid var(--tff-border);
    border-radius: 10px;
    color: var(--tff-text);
    text-decoration: none;
    position: relative;
}

.tff-tournament__list a::before {
    content: counter(tff-step);
    position: absolute;
    left: 12px;
    top: 11px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tff-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 22px;
}

.tff-tournament__list a:hover {
    border-color: var(--tff-primary);
    box-shadow: 0 4px 14px rgba(47, 25, 110, .12);
}

.tff-tournament__list strong {
    color: var(--tff-primary);
}

.tff-tournament__list span {
    font-size: 13px;
    color: var(--tff-muted);
}

.tff-jump ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.tff-jump li {
    margin: 0;
}

.tff-jump a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--tff-border);
    color: var(--tff-text);
    font-size: 13px;
    text-decoration: none;
}

.tff-jump a span {
    color: var(--tff-muted);
    margin-left: 2px;
}

.tff-jump a:hover {
    border-color: var(--tff-primary);
    color: var(--tff-primary);
}

.tff-section {
    margin: 0 0 34px;
    scroll-margin-top: 90px;
}

.tff-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 2px solid var(--tff-tint);
    margin-bottom: 14px;
    padding-bottom: 6px;
}

.tff-section__title {
    margin: 0;
    font-size: 22px;
}

.tff-section__title span {
    font-size: 14px;
    font-weight: 500;
    color: var(--tff-muted);
    margin-left: 4px;
}

.tff-section__all {
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
}

.tff-section__lead {
    color: var(--tff-muted);
    margin: -4px 0 14px;
}

.tff-section__more {
    text-align: center;
    margin: 4px 0 0;
}

/* ---------------------------------------------------------------- prehľad tém */

.tff-themes__group {
    margin: 28px 0 12px;
    font-size: 22px;
}

/* Astra dáva zoznamom v obsahu stránky ľavý okraj 3em — tu by posunul mriežku mimo */
.tff-themes .tff-themes__grid,
.tff-tournament .tff-tournament__list,
.tff-jump ul {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
}

.tff-themes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tff-themes__grid li {
    margin: 0;
}

.tff-theme {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--tff-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--tff-text);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}

.tff-theme,
.tff-theme *,
.tff-tournament__list a,
.tff-tournament__list a *,
.tff-jump a,
.tff-chip {
    text-decoration: none !important;
}

.tff-theme:hover {
    border-color: var(--tff-primary);
    box-shadow: 0 4px 14px rgba(47, 25, 110, .13);
    transform: translateY(-2px);
    color: var(--tff-text);
}

.tff-theme__img {
    display: block;
    aspect-ratio: 1 / 1;
    background: #fafafa;
}

.tff-theme__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.tff-theme__name {
    padding: 8px 10px 0;
    font-weight: 700;
    color: var(--tff-primary);
}

.tff-theme__count {
    padding: 0 10px 10px;
    font-size: 13px;
    color: var(--tff-muted);
}

@media (max-width: 600px) {
    .tff-tournament {
        padding: 12px;
    }

    .tff-tournament__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .tff-tournament__list a {
        padding: 8px 10px 8px 38px;
    }

    .tff-tournament__list a::before {
        left: 9px;
        top: 9px;
    }

    .tff-themes__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tff-section__title {
        font-size: 19px;
    }

    .tff-section__all {
        font-size: 13px;
    }
}
