/**
 * 2026 panariga.com
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 *
 * @author    panariga <contact@panariga.com>
 * @copyright 2026 panariga.com
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
 */

/* ---------- Gallery thumbnails ---------- */

.richmedia-video-thumb {
    position: relative !important;
    cursor: pointer;
}

.richmedia-video-thumb .richmedia-thumb-inner {
    position: relative;
    display: block;
    overflow: hidden;
}

/* Sizing, object-fit and the active (goldenrod) border come from the theme's
   .owl-item / .item rules, so video tiles look like the image tiles. */
.richmedia-video-thumb img {
    cursor: pointer;
}

/* Standard PrestaShop thumbnails list (themes without the owl gallery) */
.thumb-container.richmedia-video-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Play badge overlay */
.richmedia-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, background 0.2s ease;
    pointer-events: none;
}

.richmedia-play-badge svg {
    width: 14px;
    height: 14px;
    fill: #ffffff;
    margin-left: 2px; /* optical center */
}

.richmedia-video-thumb:hover .richmedia-play-badge,
.richmedia-embed-facade:hover .richmedia-play-badge,
.richmedia-embed-facade:focus-visible .richmedia-play-badge {
    transform: translate(-50%, -50%) scale(1.15);
    background: var(--color-main, #faaa21);
}

/* ---------- Player inside the product cover (.product-cover .gallery-container) ---------- */

/* The theme applies `all: inherit` to `.product-cover video`; reset it for our player. */
.product-cover .gallery-container video.richmedia-embedded-player {
    all: unset;
    display: block;
    width: 100%;
    height: auto;
    max-height: 35rem;
    margin: 0 auto;
    background: #000000;
    object-fit: contain;
}

.product-cover .gallery-container .richmedia-embed--landscape {
    width: 100%;
    max-height: 35rem;
    margin: 0 auto;
}

.product-cover .gallery-container .richmedia-embed--portrait {
    height: 35rem;
    width: calc(35rem * 9 / 16);
    max-width: 100%;
    margin: 0 auto;
}

@media screen and (max-width: 600px) {
    .product-cover .gallery-container video.richmedia-embedded-player,
    .product-cover .gallery-container .richmedia-embed--landscape {
        max-height: 20rem;
    }

    .product-cover .gallery-container .richmedia-embed--portrait {
        height: 20rem;
        width: calc(20rem * 9 / 16);
    }
}

/* ---------- Embedded platform players (YouTube, TikTok, Facebook, Instagram) ---------- */

.richmedia-embed {
    position: relative;
    width: 100%;
    max-width: 720px;
    overflow: hidden;
    background: #000000;
    border-radius: 0.8rem;
}

.richmedia-embed--landscape {
    aspect-ratio: 16 / 9;
}

.richmedia-embed--portrait {
    aspect-ratio: 9 / 16;
    max-width: 340px;
}

/* Instagram's embed adds a header and footer around the media */
.richmedia-embed--instagram {
    aspect-ratio: auto;
    height: 640px;
    max-width: 400px;
    background: #ffffff;
}

.richmedia-embed iframe,
.richmedia-embed .richmedia-embed-facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.richmedia-embed-facade {
    display: block;
    cursor: pointer;
    background: #000000;
}

.richmedia-embed-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.richmedia-embed-facade .richmedia-play-badge {
    width: 64px;
    height: 64px;
}

.richmedia-embed-facade .richmedia-play-badge svg {
    width: 26px;
    height: 26px;
    margin-left: 4px;
}

.richmedia-embed-provider {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.5;
}

.richmedia-embed-notice {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: #7a7a7a;
}

/* ---------- Videos section on the product page ---------- */

/* Themes with a real tab bar already show the tab title */
.nav-tabs ~ .tab-content .richmedia-tab-heading {
    display: none;
}

.richmedia-product-tab-content {
    padding-top: 1.25rem;
}

.richmedia-video-wrapper {
    max-width: 720px;
    margin: 15px 0;
}

.richmedia-video-wrapper video.richmedia-embedded-player {
    display: block;
    width: 100%;
    height: auto;
    background: #000000;
    border-radius: 0.8rem;
}

.richmedia-product-tab-video {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ebebeb;
}

.richmedia-product-tab-video:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.richmedia-tab-video-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #232323;
}

.richmedia-tab-video-desc {
    color: #666666;
    font-size: 0.95rem;
    margin-top: 10px;
    line-height: 1.5;
}
