:root {
    --cvi-thumb-size: 76px;
    --cvi-radius: 20px;
    --cvi-nav-size: 38px;
    --cvi-transition: 0.25s ease;
    --cvi-overlay: rgba(41, 41, 41, 0.97);
    --cvi-active-border: #2170e8;
}

.sticky-gallery {
    height: fit-content;
}

.cvi-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    user-select: none;
}

.cvi-main {
    position: relative;
    overflow: hidden;
    border-radius: var(--cvi-radius);
    aspect-ratio: 1 / 1;
    background: #f1f2f6;
}

.cvi-slide {
    display: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.cvi-slide.is-active {
    display: flex;
    animation: cviFadeIn var(--cvi-transition);
}

.cvi-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cvi-video-player {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes cviFadeIn {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cvi-zoom-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--cvi-transition), transform var(--cvi-transition);
    padding: 0;
    color: #353535;
}

.cvi-slide.is-active:hover .cvi-zoom-btn,
.cvi-slide.is-active:focus .cvi-zoom-btn,
.cvi-slide.is-active:active .cvi-zoom-btn {
    opacity: 1;
}

.cvi-zoom-btn:hover,
.cvi-zoom-btn:focus,
.cvi-zoom-btn:active {
    transform: scale(1.1);
    background: #fff;
    color: #2170e8;
}

.cvi-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: var(--cvi-nav-size);
    height: var(--cvi-nav-size);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--cvi-transition), background var(--cvi-transition);
    color: #353535;
    padding: 0;
    z-index: 2;
}

.cvi-main:hover .cvi-nav,
.cvi-main:focus .cvi-nav,
.cvi-main:active .cvi-nav {
    opacity: 1;
}

.cvi-nav:hover,
.cvi-nav:focus,
.cvi-nav:active {
    color: #2170e8;
    background: #fff;
}

.cvi-prev {
    left: 10px;
}

.cvi-next {
    right: 10px;
}

.cvi-thumbs-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cvi-thumbs {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 6px;
    padding: 2px 0;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

button.cvi-thumb {
    width: var(--cvi-thumb-size);
    aspect-ratio: 1;
    border-radius: calc(var(--cvi-radius) + 4px);
    border: 1px solid transparent;
    overflow: hidden;
    padding: 0;
    background: #f1f2f6;
}

button.cvi-thumb:hover, button.cvi-thumb:focus {
    border-color: transparent;
}

button.cvi-thumb.is-active {
    border-color: var(--cvi-active-border);
    opacity: 1;
}

.cvi-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cvi-thumb--video, .cvi-lb-thumb--video {
    position: relative;

    &::before {
        content: '';
        display: block;
        position: absolute;
        inset: 0;
        z-index: 1;
        background-color: rgba(255, 255, 255, 0.5);
    }
}

.cvi-thumb--video, .cvi-lb-thumb--video, .mejs-overlay-button {
    position: relative;

    &::after {
        content: '';
        display: block;
        width: 40px;
        height: 40px;
        position: absolute;
        z-index: 2;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-size: cover;
        background-image: url('data:image/svg+xml,<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="17.5" cy="17.5" r="16.5" stroke="%232170E8" stroke-width="2"/><path d="M13 24.9277L13 11.0723L25 18L13 24.9277Z" stroke="%232170E8" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/></svg>');
    }

    video {
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
}

.cvi-thumb--more {
    position: relative;

    .cvi-more-badge {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        inset: 0;
        background: rgb(32 112 232 / 40%);
        color: var(--light);
        font-size: 32px;
        font-weight: 500;
        text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    }
}

.cvi-lightbox {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    background: var(--cvi-overlay);
    border: none;
    padding: 0;
    margin: 0;
    inset: 0;
    overflow: hidden;
    z-index: 100000;
}

.cvi-lightbox[open] {
    display: grid;
    grid-template-columns: 80px 662px;
    grid-template-rows: 40px auto 40px;
    gap: 8px 24px;
    padding: 40px 60px 40px 40px;
    align-items: center;
    align-content: center;
    justify-items: center;
    justify-content: center;
}

.cvi-lb-track {
    max-height: 648px;
    aspect-ratio: 662 / 648;
    grid-column: 2;
    grid-row: 1 / 4;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


.cvi-lb-slide {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.cvi-lb-slide.is-active {
    display: flex;
    animation: cviFadeIn 0.2s ease;
}

.cvi-lb-slide img, .cvi-lb-slide video {
    object-fit: contain;
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cvi-lb-thumbs-wrap {
    max-height: 568px;
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.cvi-lb-thumbs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cvi-lb-thumbs::-webkit-scrollbar {
    display: none;
}

.cvi-lb-thumb {
    border: 2px solid transparent;
    padding: 0;
    background: transparent;
    border-radius: 14px;
    width: 74px;
    height: 74px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: all var(--cvi-transition);
    cursor: pointer;
    overflow: hidden;
}

.cvi-lb-thumb:hover {
    opacity: 0.8;
    border-color: var(--light);
}

.cvi-lb-thumb.is-active {
    opacity: 1;
    border-color: var(--accent);
}

.cvi-lb-thumb img, .cvi-lb-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

button.cvi-lb-nav {
    width: 28px;
    height: 28px;
    color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    border: 2px solid var(--light);
    border-radius: 50%;
    transition: color var(--cvi-transition), transform var(--cvi-transition);
}

button.cvi-lb-nav:hover, button.cvi-lb-nav:focus, button.cvi-lb-nav:active {
    background: var(--accent);
}

.cvi-lb-prev {
    grid-column: 1;
    grid-row: 1;
    transform: rotate(90deg);
}

.cvi-lb-prev:hover {
    transform: rotate(90deg) scale(1.1);
}

.cvi-lb-next {
    grid-column: 1;
    grid-row: 3;
    transform: rotate(90deg);
}

.cvi-lb-next:hover {
    transform: rotate(90deg) scale(1.1);
}

button.cvi-lb-close {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    color: var(--light);
    border: 1px solid var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background var(--cvi-transition), transform var(--cvi-transition);
    padding: 0;
}

button.cvi-lb-close:hover, button.cvi-lb-close:focus, button.cvi-lb-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.cvi-lb-counter {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    letter-spacing: 0.05em;
    z-index: 10;
}

.cvi-spoilers {
    border-top: 2px solid #ced4da;
    padding-top: 6px;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.15s;
}

.cvi-spoilers:empty {
    display: none;
}

.cvi-spoiler {
    padding-inline: 14px 48px;

    &:not(:last-child) {
        border-bottom: 2px solid #ced4da;
    }
}

button.cvi-spoiler-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    background: none !important;
    border-radius: 0 !important;
    border: none !important;

    .cvi-spoiler-title {
        text-align: left;
        font-weight: 400;
        font-size: 17px !important;
        color: #353535 !important;
    }
}

.cvi-spoiler-trigger:hover {
    opacity: 0.7;
}

.cvi-spoiler-icon {
    flex-shrink: 0;
    width: 17px;
    height: 12px;
    position: relative;
    transition: transform 0.25s ease;
    background: url('data:image/svg+xml,<svg width="17" height="12" viewBox="0 0 17 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.4746 3.36133L8.26758 11.8115L0.0224608 3.36133L0.0224609 0.0517571L8.25195 8.56738L8.2666 8.58301L8.28223 8.56738L16.4746 0.0527344L16.4746 3.36133Z" fill="%23353535" stroke="white" stroke-width="0.0422928" /></svg>')
}

.cvi-spoiler.is-open .cvi-spoiler-icon {
    transform: rotate(180deg);
}

#cvi-spoilers .cvi-spoiler-body {
    position: relative;
    overflow: hidden;
    max-height: 0;
    font-weight: 300;
    font-size: 13px;
    color: #353535;
    line-height: 1.5;
    transition: max-height 0.3s ease;

    h1, h2, h3, h4, h5, h6 {
        font-weight: 500;
        margin-bottom: 0.5em;
        line-height: 1.3;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 16px;
    }

    h5 {
        font-size: 14px;
    }

    h6 {
        font-size: 13px;
        font-weight: 600;
    }

    p {
        margin-top: 0;
        margin-bottom: 1em;
        font-weight: inherit;
        font-size: inherit;
        color: inherit;
        line-height: inherit;
    }

    a {
        color: #2170E8;
        text-decoration: underline;
        text-underline-offset: 2px;
        transition: color 0.2s ease;
    }

    a:hover, a:focus {
        text-decoration: underline;
    }

    hr {
        margin: 1.5em 0;
        border: 0;
        height: 1px;
        background-color: #CED4DA;
    }

    ul,
    ol {
        margin-top: 0;
        margin-bottom: 1em;
        padding-left: 1.5em;
    }

    li {
        margin-bottom: 0.25em;
    }

    blockquote {
        margin: 1em 0;
        padding-left: 1em;
        border-left: 3px solid #CED4DA;
        color: #8392A1;
        font-style: italic;
    }

    img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 1em 0;
    }

    strong,
    b {
        font-weight: 500;
    }

    em,
    i {
        font-style: italic;
    }

    code {
        font-family: monospace;
        background-color: #CED4DA;
        padding: 0.2em 0.4em;
        border-radius: 3px;
        font-size: 0.9em;
    }

    pre {
        background-color: #CED4DA;
        padding: 1em;
        border-radius: 4px;
        overflow-x: auto;
        font-family: monospace;
        font-size: 0.9em;
        margin: 1em 0;
    }

    .cvi-spoiler-body > :first-child {
        margin-top: 0;
    }

    .cvi-spoiler-body > :last-child {
        margin-bottom: 0;
    }
}

#cvi-spoilers .cvi-spoiler.is-open .cvi-spoiler-body {
    max-height: var(--cvi-body-max, 300px);
}

.cvi-spoiler-body::before {
    content: '';
    width: 100%;
    height: 0;
    position: absolute;
    z-index: 1;
    bottom: 0;
    background: linear-gradient(to top, #fff, transparent);
}

.cvi-spoiler-body:has(.cvi-show-more[aria-expanded="false"]):not(:has(.cvi-show-more[hidden]))::before {
    height: 200px;
}

button.cvi-show-more {
    position: absolute;
    bottom: 16px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: none !important;
    border: none !important;
    padding: 0;

    .cvi-show-more-label {
        font-weight: 400;
        font-size: 12px !important;
        color: #2170e8 !important;
        letter-spacing: 0.03em;
    }

    &[hidden] {
        display: none;
    }
}

.cvi-show-more-icon {
    width: 10px;
    height: 7px;
    background: url('data:image/svg+xml,<svg width="10" height="7" viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.2832 1.91699L4.66309 6.73535L0.0214843 1.91699L0.0214844 0.0537105L4.64746 4.90234L4.66211 4.91797L4.67773 4.90234L9.2832 0.0537109L9.2832 1.91699Z" fill="%232170E8" stroke="white" stroke-width="0.0422928" /></svg>');
    transition: transform 0.2s ease;
}

.is-expanded .cvi-show-more-icon {
    transform: rotate(180deg);
}

.cvi-spoiler-content {
    padding: 0 0 32px;
    font-size: 14px;
    line-height: 1.6;
    color: inherit;
    opacity: 0.8;
}

.cvi-amazon-btn {
    position: absolute;
    bottom: 52px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff url(../img/product/amazon-logo.png) center/26px no-repeat;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s;
    z-index: 3;
}

.cvi-amazon-btn:hover {
    border-radius: 100px;
    width: 88px;
    background: #fff url("../img/product/amazon-logo-full.png") 14px 7px/64px no-repeat;
}

.product-images-container:has(.cvi-thumbs-wrap.hidden) + .cvi-cross-reference {
    bottom: 24px
}

.cvi-cross-reference.light, .cvi-amazon-btn.light {
    opacity: 0.7;
}

@media (max-width: 1024px) {
    .sticky-gallery {
        position: static;
    }

    .cvi-cross-reference {
        bottom: auto !important;
        top: 12px;
        left: 19px !important;
    }

    .cvi-amazon-btn {
        bottom: 12px;
    }
}

@media screen and (max-width: 768px) {
    .cvi-spoiler {
        padding-inline: 0;
    }

    .cvi-lightbox[open] {
        grid-template-columns: 32px 1fr 32px;
        grid-template-rows: 1fr 80px;
        padding: 20px 10px;
    }

    .cvi-lb-track {
        grid-column: 1 / 4;
        grid-row: 1;
    }

    .cvi-lb-slide img, .cvi-lb-slide video {
        max-height: 75vh;
    }

    .cvi-lb-thumbs-wrap {
        grid-column: 2;
        grid-row: 2;
    }

    .cvi-lb-thumbs {
        flex-direction: row;
    }

    .cvi-lb-prev {
        grid-column: 1;
        grid-row: 2;
        transform: none;
    }

    .cvi-lb-prev:hover {
        transform: scale(1.2);
    }

    .cvi-lb-next {
        grid-column: 3;
        grid-row: 2;
        transform: none;
    }

    .cvi-lb-next:hover {
        transform: scale(1.2);
    }

    .cvi-lb-counter {
        bottom: auto;
        top: 36px;
    }
}


@media (max-width: 480px) {
    :root {
        --cvi-thumb-size: 58px;
        --cvi-nav-size: 32px;
    }

    .cvi-lb-slide {
        padding: 16px;
    }
}