/* Estilos para la galería */
.vg-video-gallery {
    margin: 20px 0;
}

.vg-video-item {
    border: 1px solid;
    border-radius: 10px;
    position: relative;
}

.vg-video-item video,
.vg-video-item img {
    border-radius: 10px;
    width: 100%;
    height: 100%;
    aspect-ratio: 9/16;
    display: block;
    object-fit: cover;
}

.vg-video-item img {
    border-radius: 10px;
    width: 100%;
    height: 100%;
    aspect-ratio: 9/16;
    display: block;
    object-fit: cover;
}

.vg-play-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 0px;
}


.vg-play-video svg {
    width: 40px;
    height: 40px;
    fill: #FFF;
}

.vg-play-video:focus {
    outline: none;
}

/* Estilos para el modal */
.vg-modal {
    display: flex;
    position: fixed;
    z-index: 9999999999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgb(0 0 0 / .7);
    align-content: center;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.vg-modal-content {
    margin: auto;
    width: 100%;
    height: 100dvh;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.vg-close {
    color: #fff;
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    z-index: 1;
}

.vg-products-caret {
    color: #fff;
    position: absolute;
    left: 3px;
    top: -28px;
    font-size: 17px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    background-color: rgb(255, 0, 0);
    padding: 3px 11px;
    z-index: 1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

.vg-products-caret svg {
    width: 20px;
    height: 20px;
    fill: #FFF;
}

.vg-products-caret:hover,
.vg-products-caret:focus,
.vg-close:hover,
.vg-close:focus {
    background-color: rgba(0, 0, 0, 0.8);
}

.vg-video-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    height: 100dvh;
}

.vg-video-container iframe,
.vg-video-container video {
    width: auto!important;
    margin: auto;
    height: 100%;
    border: none;
    border-radius: 8px;
    aspect-ratio: 9 / 16;
}

.vg-view-products {
    position: absolute;
    bottom: 95px;
    right: 8px;
    padding: 10px 20px;
    background-color: rgba(255, 0, 0, 1);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 0px;
    z-index: 2;
}

.vg-view-products:focus {
    outline: 2px solid #005f5f;
}

.vg-product-list {
    padding: 0;
    position: absolute;
    display: flex;
    width: 100%;
    z-index: 3;
}

.vg-product-list h3 {
    margin-bottom: 15px;
}

.vg-products {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
}

.vg-product-item {
    width: calc(33.333% - 14px);
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.vg-product-item img {
    width: auto;
    height: auto;
    max-height: 150px;
    border-radius: 8px;
}

.vg-product-item h4 {
    margin-top: 10px;
    font-size: 17px;
}

.vg-product-item p {
    margin: 5px 0;
}

.vg-product-item .button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: red;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
}

.vg-product-item .button:hover {
    background-color: #d60000;
}

/* Estilos para los botones de navegación */
.vg-nav {
    position: absolute;
    background-color: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    font-size: 20px;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 20px;
    z-index: 3;
    left: 20px;
}

.vg-nav-prev {
    top: calc(50% - 85px);
    transform: translateY(50%);
}

.vg-nav-next {
    bottom: calc(50% - 10px);
    transform: translateY(50%);
}

/* Asegurar que el botón de cerrar esté por encima */
.vg-close {
    z-index: 10;
}

/* Animaciones */
@keyframes slide-in-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-out-up {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes slide-in-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-out-down {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.slide-in-up {
    animation: slide-in-up 0.5s forwards;
    -webkit-animation: slide-in-up 0.5s forwards;
}

.slide-out-up {
    animation: slide-out-up 0.5s forwards;
    -webkit-animation: slide-out-up 0.5s forwards;
}

.slide-in-down {
    animation: slide-in-down 0.5s forwards;
}

.slide-out-down {
    animation: slide-out-down 0.5s forwards;
}

.swipe-area {
    position: absolute;
    z-index: 1;
    left: 0;
    width: 100%;
    height: 87dvh;
}

/* Responsive Design */
@media (max-width: 1025px) {

    .vg-modal-content {
        width: 95%;
    }

    .vg-product-item {
        min-width: 85%;
        max-width: 85%;
        height: 85px;
        overflow: hidden;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 1fr;
        grid-column-gap: 5px;
        grid-row-gap: 2px;
        align-items: center;
        align-content: center;
        justify-content: center;
        justify-items: center;
    }

    .vg-product-item h4 {
        font-size: 13px;
        margin: 0;
        text-align: left;
        line-height: 14px;
        word-break: break-all;
    }
    .vg-product-item p {
        font-size: 12px;
        margin: 0;
        text-align: left;
        line-height: 15px;
    }

    .vg-product-item img {
        width: auto;
        height: auto;
        max-height: 70px;
        border-radius: 8px;
    }

    .vg-product-item .button {
        margin-top: 0px;
        margin-right: 0px;
        padding: 5px 8px;
        font-size: 10px;
        min-width: 87px;
        display: block;
    }

    .vg-video-container iframe,
    .vg-video-container video {
        height: auto;
        max-height: 100dvh;
    }

    .vg-nav {
        display: none;
    }

    .vg-products {
        padding-bottom: 5px;
        padding-left: 3px;
    }

    .vg-product-list {
        top: auto;
        bottom: 0;
        padding: 5px 0 0 0;
    }

    .vg-product-list {
        background: transparent;
    }
}

/* Responsive Design */
@media (min-width: 480px) {
    .vg-product-item {
        min-width: auto;
        max-width: 350´px;
    }
    .vg-video-container iframe,
    .vg-video-container video {
        height: 100dvh!important;
        max-height: 100dvh;
    }
}

@media (min-width: 1025px) {

    .vg-products-caret {
        display: none;
    }

    .vg-product-list {
        width: 300px;
        right: 15px;
        top: 15px;
    }

    .vg-products {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 100dvh;
    }

    .vg-product-item {
        width: 100%;
    }
}