/*
 * WooCommerce Product Catalog Slider Styles (MRV Plugin)
 */

/* ADDED: Hide the theme's default product image wrapper */
/* This rule targets the <figure> element themes add, which is separate from our slider. */
.woocommerce ul.products li.product > figure {
    display: none;
}

/* ADDED: Hide theme's ghost links inside our slider */
/* These empty links are added by some themes and steal button clicks */

/* New rule for Astra theme's wrapper */
.astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link,

.product-image-slider-container > a.woocommerce-LoopProduct-link,
.product-image-slider-wrapper > a.woocommerce-LoopProduct-link,
.product-image-slide > a.woocommerce-LoopProduct-link {
    display: none !important;
}

/* 1. Container */
/* This holds the slider, buttons, and dots */
.product-image-slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 1em; /* Space below the slider */
    overflow: hidden;
    border-radius: 8px; /* Optional: rounded corners */
}

/* 2. Wrapper */
/* This element scrolls horizontally */
.product-image-slider-wrapper {
    display: flex;
    overflow-x: auto; /* Allows swiping on mobile */
    scroll-snap-type: x mandatory; /* Snaps to each slide */
    scroll-behavior: smooth; /* Smooth scroll for button clicks */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar (Firefox) */
}

/* Hide scrollbar (Chrome, Safari, Opera) */
.product-image-slider-wrapper::-webkit-scrollbar {
    display: none;
}

/* 3. Slide */
/* Each individual image container */
.product-image-slide {
    flex: 0 0 100%; /* Each slide takes up 100% of the container width */
    width: 100%;
    scroll-snap-align: start; /* Aligns the slide to the start on snap */
    background-color: #ffffff; /* Light background for images that don't cover */
}

.product-image-slide a {
    display: block;
    line-height: 0; /* Fixes extra space under images */
}

.product-image-slide img,
.product-image-slide .product-img-placeholder,
.product-image-slide .woocommerce-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1; /* Makes all images square. Adjust as needed. */
    object-fit: cover; /* Ensures images fill the space */
    display: block;
}

/* 4. Navigation Buttons (Prev/Next) */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9); /* Made slightly more opaque */
    border: none;
    border-radius: 50%;
    width: 44px; /* Increased size */
    height: 44px; /* Increased size */
    
    /* Use flexbox for perfect centering */
    display: flex;
    align-items: center;
    justify-content: center;

    line-height: 1; /* Reset line-height, flexbox will handle it */
    /* text-align: center;  No longer needed */

    font-size: 28px; /* Increased character size */
    font-weight: 800; /* Made bolder */
    color: #333; /* Set an explicit dark color for contrast */
    cursor: pointer;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Slightly stronger shadow */
    text-shadow: 0 1px 1px rgba(255,255,255,0.2); /* Helps character stand out */
}

/* Show buttons on hover */
.product-image-slider-container:hover .slider-nav {
    opacity: 1;
}

/* Also show on touch devices when slider is focused (less reliable) */
.product-image-slider-container:focus-within .slider-nav {
    opacity: 1;
}

.slider-nav:hover {
    background-color: #fff; /* Kept the same */
    transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev {
    left: 10px;
}

.slider-nav.next {
    right: 10px;
}

.slider-nav.disabled {
    opacity: 0.3 !important; /* Use important to override hover */
    cursor: not-allowed;
    pointer-events: none;
}

/* 5. Pagination Dots */
.slider-pagination {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.slider-dot:hover {
    transform: scale(1.2);
}

.slider-dot.active {
    background-color: #fff;
    transform: scale(1.2);
}