/* General styling for the Product Gallery widget */
.dm-product-gallery {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.dm-product-gallery .swiper-pagination {
        bottom: -54px!important;

}


.dm-product-gallery .swiper-container {
    width: 100%;
    overflow: visible; /* Allow hovered slides to expand */
}

/* Base styles for the swiper slide */
.dm-product-gallery .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: z-index 0.3s ease; /* Only transition z-index */
    position: relative;
    z-index: 1; /* Default stacking order */
    width: auto !important;
}

/* Inner wrapper for scaling width */
.dm-product-gallery-wrapper {
    width: 190px; /* Initial width */
    height: 380px; /* Match slide height */
    transition: width 0.3s ease, transform 0.3s ease; /* Smooth width and content scaling */
    overflow: hidden;
}

/* Hover effect to expand width */
.dm-product-gallery .swiper-slide:hover .dm-product-gallery-wrapper {
    width: 410px; /* Expanded width */
    z-index: 10; /* Bring hovered slide to the front */
}

/* Content-specific styles */
.dm-product-gallery-content {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content to the top */
    text-align: center;
    height: 100%;
    width: 100%; /* Fill the wrapper */
    position: relative;
    border-radius: 30px;
    overflow: hidden;
}

/* Image styling */
.swiper-slide img {
    display: block;
    width: 100%; /* Make image fill wrapper */
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover;
}

@media (max-width: 768px) {
    .swiper-slide img {
        width: 28px;
        height: 28px;
    }
}

.swiper-slide  .dm-product-gallery-content > a {
    display: block;
    width:100%;
}

/* Label box styles */
.swiper-label-box {
    position: absolute;
    bottom: 31px;
    transform: translate(-50%, 200%);
    left: 50%;
    width: 337px;
    color: #333333;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    font-size: 1.375rem;
    font-weight: 700 !important;
    /* From https://css.glass */
    background: rgba(255, 255, 255, 0.72);
    border-radius: 30px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6.5px);
    -webkit-backdrop-filter: blur(6.5px);
    border: 1px solid rgba(255, 255, 255, 1);
}

/* Show the label box on hover */
.dm-product-gallery .swiper-slide:hover .swiper-label-box {
    transform: translate(-50%, 0);
}

/* Adjust spacing between slides */
.dm-product-gallery .swiper-wrapper {
    justify-content: center;
}

/* Mobile-specific override */
@media (max-width: 768px) {
    
    .swiper-container.dm-product-gallery{
        overflow: visible !important;
    }
    
    
    .dm-product-gallery .swiper-slide{
        width:unset;
    }
    
    .dm-product-gallery .swiper-wrapper {
    justify-content: flex-start;
}
    
    .dm-product-gallery-wrapper {
    width: 290px; 
        height: 490px;

    transition: width 0.3s ease, transform 0.3s ease; /* Smooth width and content scaling */
    overflow: hidden;
}

.dm-product-gallery .swiper-slide:hover .dm-product-gallery-wrapper {
    width: 290px; 
    z-index: 10; /* Bring hovered slide to the front */
}

    
    
    .dm-product-gallery .swiper-label-box {
        transform: translate(-50%, 0) !important; /* Always visible on mobile */
        transition: none; /* Disable transition for better performance */
        padding: 0px 20px;
        width: 193px;

    }

    .dm-product-gallery .swiper-slide:hover .swiper-label-box {
        transform: translate(-50%, 0); /* Ensure consistent behavior */
    }

    .dm-product-gallery .swiper-slide:hover .dm-product-gallery-wrapper {
        transform: none;
    }
}

.dm-swiper-button-next {
    right: 10px; /* Adjust as per your design */
}

.dm-swiper-button-prev {
    left: 10px;
}

.dm-swiper-button-next:hover,
.dm-swiper-button-prev:hover {
    opacity: 0.9; /* Optional hover effect */
}

.dm-swiper-button-next.swiper-button-disabled,
.dm-swiper-button-prev.swiper-button-disabled {
    opacity: 0;
}

.dm-product-gallery .swiper-pagination {
    bottom: 5px;
}

.dm-product-gallery .swiper-pagination-bullet {
    background-color: #333;
    opacity: 0.7;
}

.dm-product-gallery .swiper-pagination-bullet-active {
    background-color: #000;
    opacity: 1;
}
