﻿.tp4-home-banner {
    position: relative;
    overflow: hidden;
}

.tp4-banner-content {
    position: relative;
}

.tp4-banner-box {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 var(--tp4-radius-lg) var(--tp4-radius-lg);
}

.tp4-main-swiper-img {
    width: 100%;
    height: 45vw;
    max-height: 500px;
    object-fit: cover;
}

.tp4-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--tp4-bg-primary));
    pointer-events: none;
    z-index: 2;
}

.tp4-start-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: var(--tp4-gradient-primary);
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
}

.tp4-start-btn::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent white;
    margin-left: 3px;
}

.swiper-slide:hover .tp4-start-btn {
    opacity: 1;
}

/* Thumbs */
.tp4-thumbs-box {
    padding: 12px 40px;
    position: relative;
}

.tp4-thumbs-img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: var(--tp4-radius-sm);
    opacity: 0.5;
    transition: opacity 0.3s;
}

.swiper-slide-thumb-active .tp4-thumbs-img {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--tp4-accent-alt);
}

.tp4-thumbs-mark {
    display: none;
}

.thumbs-prev,
.thumbs-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--tp4-bg-glass);
    border: 1px solid var(--tp4-border);
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tp4-transition);
}

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

.thumbs-prev:hover,
.thumbs-next:hover {
    background: rgba(102, 126, 234, 0.3);
}

/* Swiper pagination */
.tp4-home-banner .swiper-pagination {
    position: absolute;
    bottom: 16px;
    z-index: 5;
}

.tp4-home-banner .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

.tp4-home-banner .swiper-pagination-bullet-active {
    background: var(--tp4-accent);
    width: 20px;
    border-radius: 4px;
}

/* Home sections */
.tp4-home-sections {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px 24px;
}

.tp4-home-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tp4-text-muted);
    padding: 16px 0 8px;
    margin: 0;
    text-align: center;
    opacity: 0.7;
}

/* Section header (category title + more btn) */
.tp4-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 12px;
}

.tp4-section-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    position: relative;
    padding-left: 14px;
}

.tp4-section-header h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--tp4-gradient-primary);
    border-radius: 2px;
}

/* Section content wrap (video grid) */
.tp4-section-content-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.tp4-section-content {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.tp4-section-content__item {
    background: var(--tp4-bg-card);
    border-radius: var(--tp4-radius);
    border: 1px solid var(--tp4-border);
    overflow: hidden;
    transition: var(--tp4-transition);
}

.tp4-section-content__item:hover {
    background: var(--tp4-bg-card-hover);
    border-color: var(--tp4-border-hover);
    box-shadow: var(--tp4-shadow-hover);
    transform: translateY(-2px);
}

.tp4-section-content__item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tp4-section-content__item .tp4-item-cover {
    border-radius: var(--tp4-radius) var(--tp4-radius) 0 0;
}

.tp4-section-content__item .tp4-item-texts {
    padding: 8px 10px 10px;
}

.tp4-section-content-wrap--js-ready .tp4-toggle {
    display: flex;
}

/* Module ad variant */
.tp4-module-ad .tp4-item-cover {
    padding-top: 20%;
}

.tp4-module-ad .tp4-item-cover img {
    object-fit: fill;
}

.tp4-module-ad {
    grid-column: span 2;
}

@media screen and (max-width: 824px) {
    .tp4-section-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .tp4-module-ad {
        grid-column: 1 / -1;
    }

    .tp4-toggle {
        display: none;
    }

    .tp4-section-content-wrap--js-ready {
        display: block;
    }

    .tp4-section-content-wrap--js-ready .tp4-section-content {
        width: 100%;
    }

    .tp4-section-content-wrap--js-ready .tp4-toggle {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
    }

    .tp4-section-content-wrap--js-ready .tp4-toggle.prev {
        left: max(6px, env(safe-area-inset-left, 0px));
    }

    .tp4-section-content-wrap--js-ready .tp4-toggle.next {
        right: max(6px, env(safe-area-inset-right, 0px));
    }

    .tp4-section-header h2 {
        font-size: 16px;
    }

    .tp4-home-sections {
        padding: 0 8px 16px;
    }

    .tp4-main-swiper-img {
        height: 55vw;
    }
}

@media screen and (min-width: 825px) {
    .tp4-section-content {
        grid-template-columns: repeat(4, 1fr);
    }

    .tp4-main-swiper-img {
        height: 45vw;
        max-height: 550px;
        object-fit: fill;
        object-position: center;
    }
}
