/* WooCommerce Video Gallery Elementor Widget Styles */

.wvg-elementor-gallery {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    gap: 20px;
}

/* Main Display Area */
.wvg-main-display {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
}

.wvg-main-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.wvg-main-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.8;
}

.wvg-main-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.wvg-main-nav.wvg-main-prev {
    left: 15px;
}

.wvg-main-nav.wvg-main-next {
    right: 15px;
}

.wvg-main-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wvg-main-nav.disabled:hover {
    transform: translateY(-50%) scale(1);
}

.wvg-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.wvg-main-image:hover {
    transform: scale(1.02);
}

.wvg-main-video {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.wvg-main-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wvg-main-video:hover img {
    transform: scale(1.05);
}

.wvg-main-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.wvg-main-video:hover .wvg-main-play-button {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

/* Thumbnail Grid */
.wvg-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    width: 100%;
}

.wvg-elementor-gallery.wvg-columns-1 .wvg-thumbnail-grid {
    grid-template-columns: repeat(1, 1fr);
}

.wvg-elementor-gallery.wvg-columns-2 .wvg-thumbnail-grid {
    grid-template-columns: repeat(2, 1fr);
}

.wvg-elementor-gallery.wvg-columns-3 .wvg-thumbnail-grid {
    grid-template-columns: repeat(3, 1fr);
}

.wvg-elementor-gallery.wvg-columns-4 .wvg-thumbnail-grid {
    grid-template-columns: repeat(4, 1fr);
}

.wvg-elementor-gallery.wvg-columns-5 .wvg-thumbnail-grid {
    grid-template-columns: repeat(5, 1fr);
}

.wvg-elementor-gallery.wvg-columns-6 .wvg-thumbnail-grid {
    grid-template-columns: repeat(6, 1fr);
}

.wvg-thumbnail-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    border: 2px solid transparent;
}

.wvg-thumbnail-item:hover {
    transform: scale(1.05);
    border-color: #0073aa;
}

.wvg-thumbnail-item.active {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.wvg-thumbnail-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

.wvg-thumbnail-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wvg-thumbnail-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.wvg-thumbnail-item:hover .wvg-thumbnail-play-button {
    opacity: 0.9;
}

/* Gallery Modal Styles */
.wvg-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.wvg-gallery-modal.active {
    display: block;
}

.wvg-gallery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
}

.wvg-gallery-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wvg-gallery-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100001;
    transition: all 0.3s ease;
    color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wvg-gallery-modal-close:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.wvg-gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 5;
}

.wvg-gallery-modal-nav button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    color: #333;
}

.wvg-gallery-modal-nav button:hover {
    background: white;
    transform: scale(1.1);
}

.wvg-gallery-modal-nav button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wvg-gallery-modal-nav button.disabled:hover {
    transform: scale(1);
}

.wvg-gallery-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
}

.wvg-gallery-modal-media {
    max-width: 90%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.wvg-gallery-modal-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    animation: modalFadeIn 0.4s ease;
}

.wvg-gallery-modal-media video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    animation: modalFadeIn 0.4s ease;
}

.wvg-gallery-modal-info {
    margin-top: 20px;
    text-align: center;
    color: white;
}

.wvg-gallery-modal-counter {
    font-size: 16px;
    opacity: 0.8;
}

/* Main Display Slide Animation */
.wvg-main-content {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.wvg-main-content .wvg-main-image,
.wvg-main-content .wvg-main-video {
    animation: slideInFromRight 0.5s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wvg-main-content.slide-left .wvg-main-image,
.wvg-main-content.slide-left .wvg-main-video {
    animation: slideInFromLeft 0.5s ease;
}

.wvg-main-content.slide-right .wvg-main-image,
.wvg-main-content.slide-right .wvg-main-video {
    animation: slideInFromRight 0.5s ease;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .wvg-main-display {
        height: 300px;
    }
    
    .wvg-main-nav {
        width: 40px;
        height: 40px;
        opacity: 0.9;
    }
    
    .wvg-main-nav.wvg-main-prev {
        left: 10px;
    }
    
    .wvg-main-nav.wvg-main-next {
        right: 10px;
    }
    
    .wvg-gallery-modal-close {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
    }
    
    .wvg-thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .wvg-main-play-button {
        width: 60px;
        height: 60px;
    }
    
    .wvg-gallery-modal-nav {
        padding: 0 10px;
    }
    
    .wvg-gallery-modal-nav button {
        width: 40px;
        height: 40px;
    }
    
    .wvg-gallery-modal-main {
        padding: 60px 15px 15px;
    }
    
    .wvg-gallery-modal-title {
        font-size: 20px;
    }
    
    .wvg-gallery-modal-counter {
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .wvg-main-display {
        height: 250px;
    }
    
    .wvg-main-nav {
        width: 35px;
        height: 35px;
        opacity: 0.9;
    }
    
    .wvg-main-nav.wvg-main-prev {
        left: 8px;
    }
    
    .wvg-main-nav.wvg-main-next {
        right: 8px;
    }
    
    .wvg-gallery-modal-close {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }
    
    .wvg-thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 5px;
    }
    
    .wvg-main-play-button {
        width: 50px;
        height: 50px;
    }
    
    .wvg-elementor-gallery.wvg-columns-4 .wvg-thumbnail-grid,
    .wvg-elementor-gallery.wvg-columns-5 .wvg-thumbnail-grid,
    .wvg-elementor-gallery.wvg-columns-6 .wvg-thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wvg-elementor-gallery.wvg-columns-3 .wvg-thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation Classes */
.wvg-thumbnail-item.loading {
    background: #f0f0f0;
    min-height: 80px;
}

.wvg-thumbnail-item.loaded {
    animation: fadeIn 0.5s ease;
}

.wvg-thumbnail-item.error {
    background: #ffebee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c62828;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Grid Layout */
.wvg-layout-grid {
    grid-template-columns: repeat(var(--columns, 3), 1fr);
}

.wvg-layout-grid.wvg-columns-1 { --columns: 1; }
.wvg-layout-grid.wvg-columns-2 { --columns: 2; }
.wvg-layout-grid.wvg-columns-3 { --columns: 3; }
.wvg-layout-grid.wvg-columns-4 { --columns: 4; }
.wvg-layout-grid.wvg-columns-5 { --columns: 5; }
.wvg-layout-grid.wvg-columns-6 { --columns: 6; }

/* Masonry Layout */
.wvg-layout-masonry {
    column-count: var(--columns, 3);
    column-gap: var(--gap, 10px);
}

.wvg-layout-masonry.wvg-columns-1 { column-count: 1; }
.wvg-layout-masonry.wvg-columns-2 { column-count: 2; }
.wvg-layout-masonry.wvg-columns-3 { column-count: 3; }
.wvg-layout-masonry.wvg-columns-4 { column-count: 4; }
.wvg-layout-masonry.wvg-columns-5 { column-count: 5; }
.wvg-layout-masonry.wvg-columns-6 { column-count: 6; }

.wvg-layout-masonry .wvg-gallery-item {
    break-inside: avoid;
    margin-bottom: var(--gap, 10px);
}

/* Carousel Layout */
.wvg-layout-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--gap, 10px);
    padding: 10px 0;
}

.wvg-layout-carousel .wvg-gallery-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    width: 300px;
}

.wvg-layout-carousel::-webkit-scrollbar {
    height: 8px;
}

.wvg-layout-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.wvg-layout-carousel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.wvg-layout-carousel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Carousel Container and Navigation */
.wvg-carousel-container {
    position: relative;
}

.wvg-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wvg-carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.wvg-carousel-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wvg-carousel-nav.disabled:hover {
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
}

.wvg-carousel-prev {
    left: 20px;
}

.wvg-carousel-next {
    right: 20px;
}

.wvg-carousel-nav svg {
    width: 24px;
    height: 24px;
    color: #333;
}

/* Gallery Items */
.wvg-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f5f5f5;
}

.wvg-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.wvg-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.wvg-gallery-item:hover img {
    transform: scale(1.05);
}

/* Gallery Overlay */
.wvg-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wvg-gallery-item:hover .wvg-gallery-overlay {
    opacity: 1;
}

/* Gallery Icon */
.wvg-gallery-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.wvg-gallery-item:hover .wvg-gallery-icon {
    transform: scale(1.1);
}

/* Play Button */
.wvg-play-button {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.wvg-play-button:hover {
    transform: scale(1.1);
}

.wvg-play-button svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Video Modal */
.wvg-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wvg-video-modal.active {
    opacity: 1;
    visibility: visible;
}

.wvg-video-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.wvg-video-modal video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
}

.wvg-video-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.wvg-video-modal-close:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

/* Responsive Design for Video Modal */
@media screen and (max-width: 768px) {
    .wvg-video-modal-close {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
    }
}

@media screen and (max-width: 480px) {
    .wvg-video-modal-close {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .wvg-layout-grid.wvg-columns-6 { --columns: 5; }
    .wvg-layout-masonry.wvg-columns-6 { column-count: 5; }
}

@media (max-width: 992px) {
    .wvg-layout-grid.wvg-columns-5 { --columns: 4; }
    .wvg-layout-grid.wvg-columns-6 { --columns: 4; }
    .wvg-layout-masonry.wvg-columns-5 { column-count: 4; }
    .wvg-layout-masonry.wvg-columns-6 { column-count: 4; }
    
    .wvg-layout-carousel .wvg-gallery-item {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .wvg-layout-grid.wvg-columns-4 { --columns: 3; }
    .wvg-layout-grid.wvg-columns-5 { --columns: 3; }
    .wvg-layout-grid.wvg-columns-6 { --columns: 3; }
    .wvg-layout-masonry.wvg-columns-4 { column-count: 3; }
    .wvg-layout-masonry.wvg-columns-5 { column-count: 3; }
    .wvg-layout-masonry.wvg-columns-6 { column-count: 3; }
    
    .wvg-layout-carousel .wvg-gallery-item {
        width: 200px;
    }
}

@media (max-width: 576px) {
    .wvg-layout-grid.wvg-columns-3 { --columns: 2; }
    .wvg-layout-grid.wvg-columns-4 { --columns: 2; }
    .wvg-layout-grid.wvg-columns-5 { --columns: 2; }
    .wvg-layout-grid.wvg-columns-6 { --columns: 2; }
    .wvg-layout-masonry.wvg-columns-3 { column-count: 2; }
    
    .wvg-slider-indicators {
        bottom: 10px;
    }
    
    .wvg-slider-caption {
        padding: 15px;
    }
    
    .wvg-slider-caption h3 {
        font-size: 16px;
    }
    
    .wvg-gallery-modal-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .wvg-gallery-modal-nav {
        padding: 0 10px;
    }
    
    .wvg-gallery-modal-nav button {
        width: 40px;
        height: 40px;
    }
    
    .wvg-gallery-modal-main {
        padding: 60px 15px 15px;
    }
    
    .wvg-gallery-modal-title {
        font-size: 20px;
    }
    
    .wvg-gallery-modal-counter {
        font-size: 14px;
    }
    
    .wvg-elementor-gallery.wvg-columns-4 .wvg-gallery-grid,
    .wvg-elementor-gallery.wvg-columns-5 .wvg-gallery-grid,
    .wvg-elementor-gallery.wvg-columns-6 .wvg-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wvg-elementor-gallery.wvg-columns-3 .wvg-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .wvg-elementor-gallery.wvg-columns-2 .wvg-gallery-grid,
    .wvg-elementor-gallery.wvg-columns-3 .wvg-gallery-grid,
    .wvg-elementor-gallery.wvg-columns-4 .wvg-gallery-grid,
    .wvg-elementor-gallery.wvg-columns-5 .wvg-gallery-grid,
    .wvg-elementor-gallery.wvg-columns-6 .wvg-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.wvg-gallery-item.loading {
    background: #f0f0f0;
    min-height: 200px;
}

.wvg-gallery-item.loaded {
    animation: fadeIn 0.5s ease;
}

.wvg-gallery-item.error {
    background: #ffebee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c62828;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Aspect Ratio for Grid Items */
.wvg-layout-grid .wvg-gallery-item {
    aspect-ratio: 1;
}

.wvg-layout-grid .wvg-gallery-item img {
    aspect-ratio: 1;
}

/* Smooth Transitions */
.wvg-elementor-gallery * {
    box-sizing: border-box;
}

/* Focus States */
.wvg-gallery-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.wvg-video-modal-close:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}
