.yvs {
    --yvs-primary: #012495;
    --yvs-primary-dark: #00196c;
    --yvs-accent: #fe810d;
    --yvs-text: #182033;
    --yvs-muted: #667085;
    --yvs-border: #e6eaf2;
    --yvs-surface: #fff;
    --yvs-soft: #f7f9fc;
    --yvs-radius: 16px;

    width: 100%;
    padding: clamp(20px, 3vw, 34px);
    overflow: hidden;
    border: 1px solid var(--yvs-border);
    border-radius: 20px;

    background:
        radial-gradient(
            circle at 100% 0,
            rgba(1, 36, 149, .07),
            transparent 34%
        ),
        linear-gradient(180deg, #fff 0%, #fafbfe 100%);

    box-shadow: 0 14px 40px rgba(17, 35, 78, .05);
}

.yvs *,
.yvs *::before,
.yvs *::after,
.yvs-modal *,
.yvs-modal *::before,
.yvs-modal *::after {
    box-sizing: border-box;
}


/* ================================
   Header
================================ */

.yvs__label {
    display: none !important;
}

.yvs__heading {
    position: relative;
    margin: 0 0 24px;
    padding-inline-start: 18px;

    color: var(--yvs-text);

    font-size: clamp(20px, 1vw, 28px);
    font-weight: 800;
    line-height: 1.6;
}

.yvs__heading::before {
    position: absolute;
    top: .25em;
    right: 0;

    width: 5px;
    height: 1.15em;

    border-radius: 999px;

    background:
        linear-gradient(
            180deg,
            var(--yvs-primary),
            var(--yvs-accent)
        );

    content: "";
}


/* ================================
   Grid
================================ */

.yvs__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.yvs__grid--1 {
    grid-template-columns: minmax(0, 1fr);
}

.yvs__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.yvs__grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.yvs__grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}


/* ================================
   Card
================================ */

.yvs-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    height: 100%;

    overflow: hidden;

    border: 1px solid var(--yvs-border);
    border-radius: var(--yvs-radius);

    background: var(--yvs-surface);

    box-shadow:
        0 7px 24px rgba(25, 42, 84, .07);

    transition:
        transform .25s ease,
        border-color .25s ease,
        box-shadow .25s ease;
}

.yvs-card:hover {
    transform: translateY(-4px);

    border-color: rgba(1, 36, 149, .2);

    box-shadow:
        0 16px 34px rgba(25, 42, 84, .11);
}


/* ================================
   Video Button
================================ */

.yvs-card__button {
    display: flex;
    flex: 1;
    flex-direction: column;

    width: 100%;
    height: auto;

    margin: 0;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;
    outline: 0;

    background: transparent !important;
    color: var(--yvs-text) !important;

    font: inherit;
    text-align: right;

    cursor: pointer;

    box-shadow: none !important;

    appearance: none;
}

.yvs-card__button:hover {
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.yvs-card__button:focus-visible {
    outline: 3px solid rgba(1, 36, 149, .17);
    outline-offset: -3px;
}


/* ================================
   Video Image
================================ */

.yvs-card__media {
    position: relative;

    display: block;

    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #e9edf7;
}


/*
 * Overlay روی تصویر
 * برای اینکه Play و متن کاملاً دیده شوند
 */
.yvs-card__media::after {
    position: absolute;
    inset: 0;
    z-index: 1;

    background:
        linear-gradient(
            180deg,
            rgba(5, 12, 30, .08) 0%,
            rgba(5, 12, 30, .18) 50%,
            rgba(5, 12, 30, .32) 100%
        );

    content: "";

    pointer-events: none;

    transition: background .25s ease;
}


/* Overlay در Hover کمی قوی‌تر */
.yvs-card:hover .yvs-card__media::after {
    background:
        linear-gradient(
            180deg,
            rgba(5, 12, 30, .14) 0%,
            rgba(5, 12, 30, .25) 50%,
            rgba(5, 12, 30, .39) 100%
        );
}


.yvs-card__image,
.yvs-card__placeholder {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .45s ease,
        filter .3s ease;
}

.yvs-card:hover .yvs-card__image {
    transform: scale(1.045);
}


/* ================================
   Placeholder
================================ */

.yvs-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at 20% 18%,
            rgba(255, 255, 255, .18),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            var(--yvs-primary),
            #001354 78%
        );
}

.yvs-card__placeholder-text {
    color: rgba(255, 255, 255, .95);

    font-size: 18px;
    font-weight: 800;
    text-align: center;
}


/* ================================
   Play Button
================================ */

.yvs-card__play {
    position: absolute;

    top: 50%;
    left: 50%;
    z-index: 3;

    display: grid;
    place-items: center;

    width: 60px;
    height: 60px;

    border: 4px solid rgba(255, 255, 255, .88);
    border-radius: 50%;

    background: var(--yvs-primary);
    color: #fff;

    transform: translate(-50%, -60%);

    box-shadow:
        0 8px 28px rgba(0, 0, 0, .32),
        0 0 0 7px rgba(255, 255, 255, .12);

    transition:
        transform .25s ease,
        background-color .25s ease,
        box-shadow .25s ease;
}


/* متن زیر Play */
.yvs-card__play::after {
    position: absolute;

    top: calc(100% + 10px);
    left: 50%;

    width: max-content;

    padding: 4px 10px;

    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;

    background: rgba(5, 12, 30, .5);

    color: #fff;

    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;

    white-space: nowrap;

    content: "مشاهده ویدیو";

    transform: translateX(-50%);

    box-shadow:
        0 5px 15px rgba(0, 0, 0, .16);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


.yvs-card__play svg {
    display: block;

    width: 25px;
    height: 25px;

    margin-left: -4px;

    fill: currentColor;

    transform: translateX(2px);
}


/* بیشترین تمرکز Hover روی ویدیو */
.yvs-card:hover .yvs-card__play {
    background: var(--yvs-accent);

    transform:
        translate(-50%, -60%)
        scale(1.1);

    box-shadow:
        0 12px 32px rgba(0, 0, 0, .32),
        0 0 0 9px rgba(255, 255, 255, .15);
}


/* ================================
   Content
================================ */

.yvs-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;

    gap: 4px;

    width: 100%;

    padding: 13px 14px 14px;
}

.yvs-card__title {
    display: -webkit-box;

    min-height: 0;
    margin: 0;

    overflow: hidden;

    color: var(--yvs-text);

    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.yvs-card__description {
    display: -webkit-box;

    max-height: 3.4em;
    margin: 0;

    overflow: hidden;

    color: var(--yvs-muted);

    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.7;

    text-overflow: ellipsis;
    word-break: break-word;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


/* اکشن قدیمی */
.yvs-card__action {
    display: none !important;
}


/* ================================
   Product Link
   اکشن ثانویه و کم‌رنگ‌تر
================================ */

.yvs .yvs-card__product-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 6px !important;

    width: 100% !important;
    min-height: 42px !important;

    margin: 0 !important;
    padding: 9px 14px !important;

    border: 0 !important;
    border-top: 1px solid var(--yvs-border) !important;
    border-radius: 0 !important;

    background: #fafbfc !important;

    color: #526071 !important;

    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;

    text-align: center !important;
    text-decoration: none !important;

    box-shadow: none !important;

    cursor: pointer;

    /*
     * عمداً بدون انیمیشن و افکت قوی
     * تا تمرکز روی ویدیو بماند
     */
    transition: none !important;
}

.yvs .yvs-card__product-link span {
    display: block;

    text-align: center;

    color: inherit !important;
}

.yvs .yvs-card__product-link svg {
    width: 15px;
    height: 15px;

    flex: 0 0 auto;

    opacity: .65;

    transform: rotate(180deg) !important;

    transition: none !important;
}


/*
 * Hover کاملاً ساده
 * بدون نارنجی شدن
 * بدون حرکت
 * بدون Shadow
 */
.yvs .yvs-card__product-link:hover,
.yvs .yvs-card__product-link:focus {
    border-top-color: var(--yvs-border) !important;

    background: #fafbfc !important;
    color: #526071 !important;

    box-shadow: none !important;
    transform: none !important;
}

.yvs .yvs-card__product-link:hover svg {
    transform: rotate(180deg) !important;
}


/* ================================
   Modal
================================ */

.yvs-modal {
    --yvs-primary: #012495;
    --yvs-primary-dark: #00196c;
    --yvs-accent: #fe810d;
    --yvs-text: #182033;
    --yvs-muted: #667085;

    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;

    isolation: isolate;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    margin: 0 !important;

    padding:
        clamp(12px, 2.5vw, 28px) !important;

    overflow: hidden;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform: none !important;

    transition:
        opacity .2s ease,
        visibility .2s ease;
}

.yvs-modal[hidden] {
    display: none !important;
}

.yvs-modal.is-open {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}

.yvs-modal__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;

    background:
        rgba(5, 10, 24, .86);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.yvs-modal__dialog {
    position: relative;
    z-index: 2;

    width: min(980px, 100%);
    max-height: calc(100dvh - 32px);

    overflow: hidden;

    border: none !important;
    border-radius: 18px;

    background: #fff;

    box-shadow:
        0 30px 100px rgba(0, 0, 0, .5);

    transform:
        translateY(18px)
        scale(.975);

    transition:
        transform .22s ease;
}

.yvs-modal.is-open .yvs-modal__dialog {
    transform:
        translateY(0)
        scale(1);
}


/* ================================
   Modal Close
================================ */

.yvs-modal__close {
    position: absolute !important;

    top: 12px !important;
    left: 12px !important;
    z-index: 10 !important;

    display: grid !important;
    place-items: center !important;

    width: 42px !important;
    min-width: 42px !important;

    height: 42px !important;
    min-height: 42px !important;

    margin: 0 !important;
    padding: 0 !important;

    border:
        1px solid rgba(255, 255, 255, .36) !important;

    border-radius: 50% !important;

    outline: 0;

    background:
        rgba(9, 15, 31, .78) !important;

    color: #fff !important;

    font-size: 0 !important;
    line-height: 0 !important;

    cursor: pointer;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, .28);

    transform: none !important;

    transition:
        background-color .18s ease,
        transform .18s ease;

    appearance: none;
}

.yvs-modal__close:hover {
    background:
        var(--yvs-accent) !important;

    transform:
        rotate(90deg) !important;
}

.yvs-modal__close:focus-visible {
    outline:
        3px solid rgba(255, 255, 255, .45);

    outline-offset: 2px;
}

.yvs-modal__close svg {
    display: block !important;

    width: 18px !important;
    height: 18px !important;

    margin: 0 !important;

    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;

    pointer-events: none;
}


/* ================================
   Modal Player
================================ */

.yvs-modal__player {
    position: relative;

    width: 100%;

    background: #000;
}

.yvs-modal__video {
    display: block;

    width: 100%;
    max-height: 72dvh;

    aspect-ratio: 16 / 9;

    background: #000;

    object-fit: contain;
}

.yvs-modal__content {
    max-height: 24dvh;

    overflow: auto;

    padding: 18px 22px 22px;

    text-align: right;
}

.yvs-modal__title {
    margin: 0;

    color: var(--yvs-text);

    font-size: 18px;
    font-weight: 800;
    line-height: 1.8;
}

.yvs-modal__description {
    margin: 7px 0 0;

    color: var(--yvs-muted);

    font-size: 13px;
    line-height: 1.9;
}

html.yvs-modal-open,
html.yvs-modal-open body {
    overflow: hidden !important;
}


/* ================================
   Tablet
================================ */

@media (max-width: 1024px) {

    .yvs__grid,
    .yvs__grid--3,
    .yvs__grid--4 {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* ================================
   Mobile
================================ */

@media (max-width: 600px) {

    .yvs {
        padding: 18px 14px;

        border-radius: 16px;
    }

    .yvs__heading {
        margin-bottom: 18px;

        font-size: 19px;
    }

    .yvs__grid,
    .yvs__grid--2,
    .yvs__grid--3,
    .yvs__grid--4 {
        grid-template-columns:
            minmax(0, 1fr);

        gap: 14px;
    }

    .yvs-card__media {
        aspect-ratio: 16 / 9;
    }

    .yvs-card__play {
        width: 58px;
        height: 58px;
    }

    .yvs-card__play::after {
        top: calc(100% + 8px);

        padding: 4px 9px;

        font-size: 11px;
    }

    .yvs-card__content {
        padding: 12px 13px 13px;
    }

    .yvs .yvs-card__product-link {
        min-height: 40px !important;

        padding: 8px 12px !important;

        font-size: 12px !important;
    }

    .yvs-modal {
        padding: 10px !important;
    }

    .yvs-modal__dialog {
        max-height:
            calc(100dvh - 20px);

        border: none !important;
        border-radius: 14px;
    }

    .yvs-modal__close {
        top: 8px !important;
        left: 8px !important;

        width: 38px !important;
        min-width: 38px !important;

        height: 38px !important;
        min-height: 38px !important;
    }

    .yvs-modal__content {
        padding: 14px 16px 17px;
    }

    .yvs-modal__title {
        font-size: 15px;
    }

}


/* ================================
   Reduced Motion
================================ */

@media (prefers-reduced-motion: reduce) {

    .yvs-card,
    .yvs-card__button,
    .yvs-card__image,
    .yvs-card__play,
    .yvs-card__media::after,
    .yvs-modal,
    .yvs-modal__dialog,
    .yvs-modal__close {
        transition: none !important;
    }

}