/* Video Gallery Thumbnails */
.dmn-video-thumb {
    position: relative;
    cursor: pointer;
}

.dmn-video-thumb a {
    display: block;
    position: relative;
}

.dmn-video-thumb img {
    opacity: 0.8 !important;
    transition: opacity 0.2s ease;
}

.dmn-video-thumb:hover img {
    opacity: 1 !important;
}

.dmn-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.dmn-video-thumb img,
.dmn-thumb-wrapper img {
    opacity: 0.8;
    transition: opacity 0.2s ease;
    width: 100%;
    height: auto;
    display: block;
}

.dmn-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.2s;
}

.dmn-video-thumb:hover .dmn-play-icon {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Main Video Overlay */
.dmn-main-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: rgb(0 0 0 / 0%);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    /* backdrop-filter: blur(0px); */
}

.woocommerce-product-gallery {
    position: relative;
    /* Ensure relative positioning for absolute overlay */
}

.dmn-video-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Add padding so video doesn't touch edges */
    box-sizing: border-box;
}

.dmn-product-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    /* Allow width to adjust based on height */
    height: auto;
    /* Allow height to adjust */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Add shadow for depth */
    border-radius: 4px;
}

.dmn-embed-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
}

.dmn-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dmn-close-video {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.dmn-close-video:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Ensure slider arrows are visible */
.flex-direction-nav a,
.swiper-button-prev,
.swiper-button-next {
    z-index: 50 !important;
    /* Ensure on top of content but below video overlay (z=100) */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure hidden container doesn't block interactions */
.dmn-main-video-container:not(:visible) {
    pointer-events: none;
    z-index: -1;
}

/* Custom Navigation Arrows */
.dmn-custom-nav {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dmn-custom-nav li a {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    text-indent: -9999px;
    /* Hide text "Previous" */
    overflow: hidden;
    z-index: 90;
    /* High z-index but below video overlay (100) */
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.dmn-custom-nav li a:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.dmn-custom-nav li a:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    display: block;
}

.dmn-custom-nav .flex-prev {
    left: 10px;
}

.dmn-custom-nav .flex-prev:before {
    transform: translate(-35%, -50%) rotate(-135deg);
}

.dmn-custom-nav .flex-next {
    right: 10px;
}

.dmn-custom-nav .flex-next:before {
    transform: translate(-65%, -50%) rotate(45deg);
}

/* THUMBNAIL SLIDER STYLING */
/* Make the thumbnail list scrollable horizontally */
.flex-control-nav.flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 10px 0 !important;
    width: 100%;
    scrollbar-width: thin;
    /* Firefox */
}

/* Ensure consistent item sizing */
.flex-control-nav.flex-control-thumbs li {
    flex: 0 0 16% !important;
    /* Show roughly 5-6 items */
    max-width: 80px !important;
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    /* Override standard float */
}

.flex-control-nav.flex-control-thumbs li img {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1/1;
    /* Ensure square thumbs */
    display: block;
}

.flex-control-nav.flex-control-thumbs li img.flex-active,
.flex-control-nav.flex-control-thumbs li img:hover {
    opacity: 1;
}

/* Scrollbar Styling */
.flex-control-nav.flex-control-thumbs::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar, use arrows */
}

.flex-control-nav.flex-control-thumbs {
    scrollbar-width: none;
    /* Firefox */
    margin: 0 5px !important;
    flex: 1;
    /* Take remaining space */
}

/* Thumbnail wrapper with arrows */
.dmn-thumbs-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

/* Nav Arrows */
.dmn-thumb-nav {
    background: var(--dmn-tertiary) !important;
    border: none;
    cursor: pointer;
    font-size: 0;
    width: 36px;
    /* Slightly larger */
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0.8;
    /* More visible by default */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    /* Subtle shadow */
    border-radius: 50%;
    z-index: 10;
}

.dmn-thumb-nav:hover {
    opacity: 1;
    transform: scale(1.1);
    /* Zoom effect */
    background: #fff;
    /* Highlight on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.dmn-thumb-prev {
    margin-right: 8px;
    /* Space from thumbnails */
}

.dmn-thumb-next {
    margin-left: 8px;
    /* Space from thumbnails */
}

.dmn-thumb-nav.disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
    box-shadow: none !important;
    transform: none;
}

/* Chevron icons using pure CSS */
.dmn-thumb-nav:before {
    content: '';
    width: 8px;
    height: 8px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    display: block;
}

.dmn-thumb-prev:before {
    transform: rotate(-135deg);
    margin-left: 2px;
}

.dmn-thumb-next:before {
    transform: rotate(45deg);
    margin-right: 2px;
}