/* AVSYS Video Gallery v1.1.0 */
.avvg-gallery {
    --avvg-blue: #009DDD;
    --avvg-sky: #52BDED;
    --avvg-night: #0B1F3A;
    --avvg-deep: #0078A8;
    --avvg-graphite: #1F2937;
    --avvg-line: #DCE8F0;
    --avvg-ice: #EAF7FC;
    --avvg-white: #FFFFFF;
    --avvg-gap: 18px;
    --avvg-cols-desktop: 6;
    --avvg-cols-tablet: 4;
    --avvg-cols-mobile: 2;
    --avvg-button-bg: #0B1F3A;
    --avvg-button-text: #FFFFFF;
    --avvg-button-hover-bg: #009DDD;
    --avvg-button-hover-text: #FFFFFF;
    --avvg-play-bg: #009DDD;
    --avvg-play-icon: #FFFFFF;
    width: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.avvg-gallery *,
.avvg-gallery *::before,
.avvg-gallery *::after {
    box-sizing: border-box;
}

.avvg-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 0 34px;
}

.avvg-filter,
.avvg-more {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--avvg-button-bg);
    border-radius: 8px;
    background: var(--avvg-button-bg);
    color: var(--avvg-button-text);
    cursor: pointer;
    font-family: Sora, Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.15;
    padding: 11px 16px;
    transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.avvg-filter:hover,
.avvg-filter:focus-visible,
.avvg-filter.is-active,
.avvg-more:hover,
.avvg-more:focus-visible {
    background: var(--avvg-button-hover-bg);
    border-color: var(--avvg-button-hover-bg);
    color: var(--avvg-button-hover-text);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(11,31,58,.14);
    outline: none;
}

.avvg-filter.is-active {
    transform: none;
}

.avvg-grid {
    display: grid;
    grid-template-columns: repeat(var(--avvg-cols-desktop), minmax(0, 1fr));
    grid-auto-rows: 8px;
    grid-auto-flow: dense;
    column-gap: var(--avvg-gap);
    row-gap: 0;
    align-items: start;
}

.avvg-item {
    min-width: 0;
    margin: 0 0 var(--avvg-gap);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .25s ease, transform .25s ease;
}

.avvg-item.is-hiding {
    opacity: 0;
    transform: translateY(10px);
}

.avvg-item[hidden] {
    display: none !important;
}

.avvg-item-video {
    grid-column: span 2;
}

.avvg-item-short {
    grid-column: span 1;
}

.avvg-media {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: var(--avvg-night);
    padding: 0;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(11,31,58,.10);
    isolation: isolate;
}

.avvg-item-video .avvg-media {
    aspect-ratio: 16 / 9;
}

.avvg-item-short .avvg-media {
    aspect-ratio: 9 / 16;
}

.avvg-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(11,31,58,.38) 100%);
    pointer-events: none;
    z-index: 1;
}

.avvg-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.001);
    transition: transform .35s ease, filter .35s ease;
}

.avvg-media:hover img,
.avvg-media:focus-visible img {
    transform: scale(1.035);
    filter: brightness(.92);
}

.avvg-media:focus-visible {
    outline: 3px solid var(--avvg-sky);
    outline-offset: 3px;
}

.avvg-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: var(--avvg-play-bg);
    box-shadow: 0 10px 28px rgba(11,31,58,.30);
    transform: translate(-50%, -50%);
    transition: transform .25s ease;
}

.avvg-play span {
    position: absolute;
    left: 23px;
    top: 18px;
    width: 0;
    height: 0;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid var(--avvg-play-icon);
}

.avvg-media:hover .avvg-play,
.avvg-media:focus-visible .avvg-play {
    transform: translate(-50%, -50%) scale(1.08);
}

.avvg-item-short .avvg-play {
    width: 50px;
    height: 50px;
}

.avvg-item-short .avvg-play span {
    left: 20px;
    top: 15px;
    border-top-width: 10px;
    border-bottom-width: 10px;
    border-left-width: 15px;
}

.avvg-kind {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    border-radius: 999px;
    background: rgba(11,31,58,.86);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 6px 8px;
}

.avvg-title {
    margin: 10px 2px 0 !important;
    padding: 0 !important;
    color: var(--avvg-graphite);
    font-family: Sora, Inter, system-ui, sans-serif;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.avvg-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.avvg-more {
    min-width: 170px;
}

.avvg-more[hidden] {
    display: none !important;
}

.avvg-empty {
    padding: 18px 20px;
    border: 1px solid #DCE8F0;
    border-radius: 10px;
    background: #F4F8FB;
    color: #1F2937;
}

/* Lightbox con navegación */
.avvg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 46px 82px 32px;
    background: rgba(7,18,34,.92);
}

.avvg-lightbox[hidden] {
    display: none !important;
}

.avvg-lightbox-dialog {
    position: relative;
    width: min(1100px, calc(100vw - 164px));
    max-height: 90vh;
}

.avvg-lightbox-dialog.is-short {
    width: min(520px, calc(100vw - 164px));
}

.avvg-lightbox-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

.avvg-lightbox-frame.is-short {
    width: min(460px, 100%);
    max-height: 82vh;
    margin: 0 auto;
    aspect-ratio: 9 / 16;
}

.avvg-lightbox-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.avvg-lightbox-close,
.avvg-lightbox-nav {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    z-index: 4;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0B1F3A;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,0,0,.22);
}

.avvg-lightbox-close {
    top: -44px;
    right: 0;
    width: 38px;
    height: 38px;
    font-size: 28px;
    line-height: 1;
}

.avvg-lightbox-nav {
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    font-size: 38px;
    line-height: 1;
    transition: transform .2s ease, background-color .2s ease;
}

.avvg-lightbox-nav:hover,
.avvg-lightbox-nav:focus-visible,
.avvg-lightbox-close:hover,
.avvg-lightbox-close:focus-visible {
    background: #EAF7FC;
    outline: 3px solid rgba(82,189,237,.55);
    outline-offset: 2px;
}

.avvg-lightbox-nav:hover,
.avvg-lightbox-nav:focus-visible {
    transform: translateY(-50%) scale(1.06);
}

.avvg-lightbox-prev {
    left: -64px;
}

.avvg-lightbox-next {
    right: -64px;
}

.avvg-lightbox-nav[hidden] {
    display: none !important;
}

.avvg-lightbox-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 30px;
    padding: 10px 2px 0;
    color: #fff;
    font-family: Inter, system-ui, sans-serif;
}

.avvg-lightbox-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

.avvg-lightbox-counter {
    flex: 0 0 auto;
    color: rgba(255,255,255,.72);
    font-size: 12px;
}

body.avvg-lock-scroll {
    overflow: hidden !important;
}

/* Marcador liviano para Divi Builder: no renderiza la galería completa. */
.avvg-builder-placeholder {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 74px;
    padding: 16px 18px;
    border: 1px dashed #52BDED;
    border-radius: 10px;
    background: #EAF7FC;
    color: #0B1F3A;
    font-family: Inter, system-ui, sans-serif;
}

.avvg-builder-placeholder-icon {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #009DDD;
    color: #fff;
    font-size: 16px;
}

.avvg-builder-placeholder strong,
.avvg-builder-placeholder span {
    display: block;
}

.avvg-builder-placeholder strong {
    margin-bottom: 3px;
    font-family: Sora, Inter, system-ui, sans-serif;
}

.avvg-builder-placeholder div > span {
    color: #667085;
    font-size: 13px;
}

@media (max-width: 980px) {
    .avvg-grid {
        grid-template-columns: repeat(var(--avvg-cols-tablet), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .avvg-mobile-filters-scroll .avvg-filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 2px 2px 10px;
        margin-bottom: 26px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .avvg-mobile-filters-scroll .avvg-filter {
        flex: 0 0 auto;
    }

    .avvg-mobile-filters-wrap .avvg-filters {
        justify-content: center;
        flex-wrap: wrap;
        overflow: visible;
        padding: 0;
        margin-bottom: 26px;
    }

    .avvg-mobile-filters-wrap .avvg-filter {
        flex: 0 1 auto;
        white-space: normal;
        text-align: center;
    }

    .avvg-lightbox {
        padding: 54px 54px 28px;
    }

    .avvg-lightbox-dialog,
    .avvg-lightbox-dialog.is-short {
        width: min(100%, calc(100vw - 108px));
    }

    .avvg-lightbox-prev {
        left: -48px;
    }

    .avvg-lightbox-next {
        right: -48px;
    }

    .avvg-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 32px;
    }
}

@media (max-width: 600px) {
    .avvg-grid {
        grid-template-columns: repeat(var(--avvg-cols-mobile), minmax(0, 1fr));
    }

    .avvg-item-video {
        grid-column: 1 / -1;
    }

    .avvg-item-short {
        grid-column: span 1;
    }

    .avvg-play {
        width: 50px;
        height: 50px;
    }

    .avvg-play span {
        left: 20px;
        top: 15px;
        border-top-width: 10px;
        border-bottom-width: 10px;
        border-left-width: 15px;
    }

    .avvg-title {
        font-size: 14px !important;
    }

    .avvg-lightbox {
        padding: 58px 42px 24px;
    }

    .avvg-lightbox-dialog,
    .avvg-lightbox-dialog.is-short {
        width: min(100%, calc(100vw - 84px));
    }

    .avvg-lightbox-prev {
        left: -38px;
    }

    .avvg-lightbox-next {
        right: -38px;
    }

    .avvg-lightbox-nav {
        width: 34px;
        height: 34px;
        font-size: 28px;
    }

    .avvg-lightbox-close {
        top: -42px;
    }

    .avvg-lightbox-meta {
        gap: 10px;
    }

    .avvg-lightbox-title {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .avvg-gallery *,
    .avvg-gallery *::before,
    .avvg-gallery *::after,
    .avvg-lightbox *,
    .avvg-lightbox *::before,
    .avvg-lightbox *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
