/* PRODUCT MEDIA TABS */
.product-media-tabs {
    margin-top: 20px;
}

/* TABS HEADER */
.product-media-tabs .tabs-header {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* TAB BUTTON */
.product-media-tabs .tab-btn {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    color: var(--text-muted-color);
    transition: color 0.25s ease;
}


.product-media-tabs .tab-btn.active {
    color: var(--color-black);
}

.product-media-tabs .tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-main);
}

/* TAB PANEL */
.product-media-tabs .tab-panel {
    display: none;
    padding-top: 20px;
}

.product-media-tabs .tab-panel.active {
    display: block;
}

/* PHOTO GRID DESKTOP - 5 ẢNH */
.product-media-tabs .photo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

/* PHOTO ITEM */
.product-media-tabs .photo-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: pointer;
}

/* PHOTO IMAGE */
.product-media-tabs .photo-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.product-media-tabs .photo-item:hover img {
    transform: scale(1.05);
}

/* PHOTO LIGHTBOX */
.photo-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    box-sizing: border-box;
}

.photo-lightbox.active {
    display: flex;
}

/* IMAGE WRAPPER */
.photo-lightbox-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* LIGHTBOX IMAGE */
.photo-lightbox-image-wrap img {
    display: block;
    max-width: min(90vw, 1200px);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    transition: opacity 0.2s ease;
}

/* CLOSE BUTTON */
.photo-lightbox-close {
    position: absolute;
    top: 18px;
    right: 25px;
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    font-size: 19px;
    cursor: pointer;
    z-index: 30;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.photo-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.08);
}

/* PREVIOUS / NEXT BUTTON */
.photo-lightbox-prev, .photo-lightbox-next {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-white);
    cursor: pointer;
    z-index: 30;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

/* PREVIOUS */
.photo-lightbox-prev {
    left: 25px;
    transform: translateY(-50%);
}

/* NEXT */
.photo-lightbox-next {
    right: 25px;
    transform: translateY(-50%);
}

/* ICON */
.photo-lightbox-prev i, .photo-lightbox-next i {
    font-size: 17px;
    line-height: 1;
    transition: transform 0.25s ease;
}

/* HOVER */
.photo-lightbox-prev:hover, .photo-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
}

.photo-lightbox-prev:hover {
    transform: translateY(-50%) scale(1.08);
}

.photo-lightbox-next:hover {
    transform: translateY(-50%) scale(1.08);
}

/* VIDEO GRID */
.product-media-tabs .video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

/* VIDEO ITEM */
.product-media-tabs .video-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: var(--color-black);
    aspect-ratio: 16 / 9;
}

/* VIDEO IMAGE */
.product-media-tabs .video-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* VIDEO PLAY */
.product-media-tabs .video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-media-tabs .video-play i {
    font-size: 45px;
}

.product-media-tabs .video-item:hover .video-play {
    opacity: 1;
}

/* VIDEO LIGHTBOX */
.video-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-sizing: border-box;
}

.video-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* VIDEO WRAPPER */
.video-wrapper {
    position: relative;
    width: 90%;
    max-width: 900px;
    background: var(--color-black);
    border-radius: 12px;
    overflow: hidden;
}

/* CLOSE VIDEO */
.close-video {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 34px;
    color: var(--color-white);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

/* VIDEO CONTAINER */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

.video-container iframe, .video-container video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* TABLET */
@media (max-width: 1024px) {
    .product-media-tabs .photo-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-media-tabs .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .product-media-tabs {
        margin-top: 15px;
    }

    /* Tabs */
    .product-media-tabs .tabs-header {
        gap: 20px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .product-media-tabs .tabs-header::-webkit-scrollbar {
        display: none;
    }

    .product-media-tabs .tab-btn {
        flex: 0 0 auto;
        font-size: 15px;
        padding: 10px 0;
    }

    /* Photo */
    .product-media-tabs .photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .product-media-tabs .photo-item {
        border-radius: 6px;
    }

    .product-media-tabs .photo-item img {
        border-radius: 6px;
    }

    /* Photo Lightbox */
    .photo-lightbox {
        padding: 15px;
    }

    .photo-lightbox-image-wrap img {
        max-width: 92vw;
        max-height: 80vh;
        border-radius: 7px;
    }

    /* Close */
    .photo-lightbox-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    /* Navigation */
    .photo-lightbox-prev, .photo-lightbox-next {
        width: 42px;
        height: 42px;
    }

    .photo-lightbox-prev {
        left: 10px;
    }

    .photo-lightbox-next {
        right: 10px;
    }

    .photo-lightbox-prev i, .photo-lightbox-next i {
        font-size: 14px;
    }

    /* Video */
    .product-media-tabs .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-media-tabs .video-item {
        border-radius: 8px;
    }

    .product-media-tabs .video-play i {
        font-size: 35px;
    }

    .video-wrapper {
        width: 95%;
    }
}

/* SMALL MOBILE */
@media (max-width: 480px) {
    .product-media-tabs .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 8px;
    }

    .product-media-tabs .video-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));

        gap: 12px;
    }


    .photo-lightbox-prev, .photo-lightbox-next {
        width: 38px;
        height: 38px;
    }

    .photo-lightbox-prev {
        left: 6px;
    }

    .photo-lightbox-next {
        right: 6px;
    }

    .photo-lightbox-prev i, .photo-lightbox-next i {
        font-size: 13px;
    }
}

.related .product-section {
	border-top: none;
}