/* ============================================================
   TV KANALI — [mtel_tv_kanali]
   Tokeni preuzeti iz global.css / homepage koncepta
   ============================================================ */

.tvk-sec {
    --tvk-navy-900: var(--navy-900, #050F20);
    --tvk-navy-800: var(--navy-800, #0A1F3D);
    --tvk-navy-700: var(--navy-700, #102949);
    --tvk-red: var(--red, #C80815);
    --tvk-orange: var(--orange, #FFB347);
    --tvk-paper: var(--paper, #F4F6F9);
    --tvk-grey-300: var(--grey-300, #B9C4D4);
    --tvk-grey-200: var(--grey-200, #DDE3EC);
    --tvk-grey-400: var(--grey-400, #8E9BB0);
    --tvk-grey-500: var(--grey-500, #6B7A91);
    --tvk-white: var(--white, #FFFFFF);
    --tvk-r: var(--r, 14px);
    --tvk-ease: var(--ease, cubic-bezier(.22,.61,.36,1));
    --tvk-spectar: var(--spectar, linear-gradient(45deg,#C80815 0%,#C72C48 46%,#FFB347 100%));

    /* probijanje van WP "constrained" (720px) layout kontejnera */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.tvk-head {
    margin-bottom: 36px;
}

/* ── Filter panel — kontejner ── */
.tvk-filters {
    background: var(--tvk-white);
    border: 1px solid var(--tvk-grey-200);
    border-radius: var(--tvk-r);
    padding: 20px;
    box-shadow: 0 24px 48px -32px rgba(10,31,61,.18);
}

.tvk-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tvk-search { flex: 1; }
.tvk-search input {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1.5px solid var(--tvk-grey-200);
    font-size: 15px;
    font-family: inherit;
    color: var(--tvk-navy-800);
    background: var(--tvk-paper);
    transition: border-color .2s var(--tvk-ease), background .2s var(--tvk-ease);
}
.tvk-search input::placeholder { color: var(--tvk-grey-400); }
.tvk-search input:focus {
    outline: none;
    border-color: var(--tvk-red);
    background: var(--tvk-white);
}

/* ── Mobilno "Filteri" dugme (skriveno na desktopu) ── */
.tvk-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    height: 52px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--tvk-navy-800);
    color: var(--tvk-white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}
.tvk-filter-badge {
    background: var(--tvk-red);
    color: var(--tvk-white);
    font-size: 11px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Panel sa filterima — na desktopu je samo deo istog belog panela ── */
.tvk-filters-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}

.tvk-filters-panel-head { display: none; }
.tvk-filters-apply { display: none; }

.tvk-toprow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}

.tvk-type-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--tvk-paper);
    border-radius: 999px;
    width: fit-content;
}
.tvk-type-btn {
    padding: 9px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    color: var(--tvk-grey-500);
    transition: background .25s var(--tvk-ease), color .25s var(--tvk-ease);
}
.tvk-type-btn.is-active {
    background: var(--tvk-navy-800);
    color: var(--tvk-white);
}

.tvk-country select {
    border-radius: 999px;
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid var(--tvk-grey-200);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--tvk-navy-800);
    background: var(--tvk-white);
    max-width: 220px;
    width: 100%;
    cursor: pointer;
    transition: border-color .2s var(--tvk-ease);
}
.tvk-country select:hover,
.tvk-country select:focus {
    border-color: var(--tvk-navy-800);
    outline: none;
}

.tvk-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tvk-chip {
    flex: none;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--tvk-grey-200);
    font-size: 13px;
    font-weight: 600;
    color: var(--tvk-navy-800);
    background: var(--tvk-white);
    white-space: nowrap;
    transition: background .25s var(--tvk-ease), border-color .25s var(--tvk-ease), color .25s var(--tvk-ease), transform .2s var(--tvk-ease);
}
.tvk-chip:hover {
    border-color: var(--tvk-navy-800);
}
.tvk-chip.is-active {
    background: var(--tvk-spectar);
    border-color: transparent;
    color: var(--tvk-white);
    box-shadow: 0 10px 24px -12px rgba(200,8,21,.55);
}

/* ── Meta / brojač ── */
.tvk-meta {
    margin-top: 22px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--tvk-grey-500);
}

/* ── Grid kartica ── */
.tvk-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tvk-card {
    /* kartica je <button>: poništavanje podrazumevanog izgleda dugmeta */
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    text-align: left;
    width: 100%;
    margin: 0;
    cursor: pointer;
    border: 1px solid var(--tvk-grey-200);
    border-radius: var(--tvk-r);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--tvk-white);
    transition: transform .3s var(--tvk-ease), box-shadow .3s var(--tvk-ease), border-color .3s var(--tvk-ease);
}
.tvk-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 48px -28px rgba(10,31,61,.4);
    border-color: transparent;
}

.tvk-card:focus-visible {
    outline: 2px solid var(--tvk-red);
    outline-offset: 2px;
}

.tvk-card-media {
    position: relative;
    aspect-ratio: 300 / 169;
    border-radius: calc(var(--tvk-r) - 6px);
    overflow: hidden;
    background: var(--tvk-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.tvk-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* kanal bez logotipa: naziv umesto slike */
.tvk-card-noimg {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    color: var(--tvk-grey-400);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.tvk-card-media:has(.tvk-card-noimg) {
    border: 1.5px dashed var(--tvk-grey-300);
}

.tvk-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--tvk-navy-800);
    letter-spacing: -.01em;
    line-height: 1.3;
}

.tvk-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tvk-card-country {
    font-size: 11px;
    font-weight: 700;
    color: var(--tvk-grey-500);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tvk-card-packages {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.tvk-pkg-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--tvk-paper);
    color: var(--tvk-red);
}

/* ── Prozor sa detaljima kanala (<dialog>) ── */
.tvk-modal {
    border: 0;
    padding: 0;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    border-radius: 20px;
    background: var(--tvk-white);
    color: var(--tvk-navy-800);
    box-shadow: 0 40px 80px -30px rgba(5,15,32,.7);
}
.tvk-modal[open] {
    animation: tvk-modal-in .28s var(--tvk-ease);
}
.tvk-modal::backdrop {
    background: rgba(5,15,32,.62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.tvk-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--tvk-white);
    color: var(--tvk-navy-800);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px -8px rgba(10,31,61,.45);
    transition: background .2s var(--tvk-ease), color .2s var(--tvk-ease);
}
.tvk-modal-close:hover {
    background: var(--tvk-navy-800);
    color: var(--tvk-white);
}
.tvk-modal-close:focus-visible {
    outline: 2px solid var(--tvk-red);
    outline-offset: 2px;
}

.tvk-modal-media {
    background: var(--tvk-paper);
    padding: 36px 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tvk-modal-media[hidden] { display: none; }
.tvk-modal-media img {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 300 / 169;
    object-fit: contain;
    display: block;
}

.tvk-modal-body {
    padding: 24px 28px 30px;
}
.tvk-modal-pos {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--tvk-navy-800);
    color: var(--tvk-white);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.tvk-modal-pos[hidden] { display: none; }

.tvk-modal-name {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--tvk-navy-800);
}
.tvk-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.tvk-modal-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tvk-paper);
    color: var(--tvk-grey-500);
}
.tvk-modal-desc {
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--tvk-navy-700);
}

@keyframes tvk-modal-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes tvk-sheet-in {
    from { transform: translateY(100%); }
    to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tvk-modal[open] { animation: none; }
}

/* ── Prazno stanje ── */
.tvk-empty {
    margin-top: 56px;
    text-align: center;
    color: var(--tvk-grey-500);
    font-size: 15px;
}

/* ============================================================
   MOBILNO  ≤ 719px  — filter panel postaje fullscreen "bottom sheet"
   ============================================================ */
@media (max-width: 719px) {

    .tvk-filter-toggle { display: flex; }

    /* prozor sa detaljima kanala izlazi odozdo */
    .tvk-modal {
        width: 100vw;
        max-width: 100vw;
        max-height: 85dvh;
        margin: auto 0 0;
        border-radius: 20px 20px 0 0;
    }
    .tvk-modal[open] { animation-name: tvk-sheet-in; }
    .tvk-modal-media { padding: 28px 48px; }
    .tvk-modal-body { padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); }
    .tvk-modal-name { font-size: 21px; }

    .tvk-filters-panel {
        position: fixed;
        inset: 0;
        z-index: 300;
        background: var(--tvk-white);
        margin: 0;
        padding: 20px 20px 100px;
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform .35s var(--tvk-ease);
        gap: 22px;
    }
    .tvk-filters-panel.is-open {
        transform: translateY(0);
    }

    .tvk-filters-panel-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 16px;
        font-weight: 800;
        color: var(--tvk-navy-800);
        padding-bottom: 6px;
        border-bottom: 1px solid var(--tvk-grey-200);
    }
    .tvk-filters-close {
        font-size: 26px;
        line-height: 1;
        color: var(--tvk-grey-500);
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tvk-toprow { flex-direction: column; align-items: stretch; }
    .tvk-country select {
    border-radius: 999px; max-width: none; }

    .tvk-filters-apply {
        display: block;
        position: fixed;
        left: 20px;
        right: 20px;
        bottom: 20px;
        z-index: 301;
        height: 54px;
        border-radius: 999px;
        background: var(--tvk-spectar);
        color: var(--tvk-white);
        font-size: 14px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        box-shadow: 0 16px 32px -12px rgba(200,8,21,.55);
    }
}

/* ── Tablet ── */
@media (min-width: 720px) {
    .tvk-filters {
        padding: 30px 32px;
    }
    .tvk-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Desktop ── */
@media (min-width: 1024px) {
    .tvk-toprow { flex-wrap: nowrap; }
    .tvk-grid { grid-template-columns: repeat(6, 1fr); }
}
