/* Slider Arrow */

.kb-splide {
    position: relative;
}

.kb-splide .splide__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    height: 3em;
    width: 2em;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--splide-nav-background, #333);
    border: var(--splide-nav-border, none);
    border-radius: 3px;
    cursor: pointer;
    opacity: .75;
    padding: 0;
    box-shadow: none;
    transition: opacity .3s ease-in-out;
}

.kb-splide .splide__arrow::after {
    content: "";
    width: 1.2em;
    height: 1.2em;
    background-color: var(--splide-nav-color, #fff);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='m15.5 0.9-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='m15.5 0.9-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z'/%3E%3C/svg%3E");
}

.kb-splide .splide__arrow--prev {
    left: 10px;
}

.kb-splide .splide__arrow--prev::after {
    transform: rotate(180deg);
}

.kb-splide .splide__arrow--next {
    right: 10px;
}

.kb-splide .splide__arrow:hover {
    opacity: 1;
}

/* 1. OVERRIDE KADENCE HIDING SLIDES */
body:not(.no-js) .kadence-splide-slider-init.splide__track.hide-on-js ul > li:nth-child(n) {
    display: block !important;
}

.embla__viewport {
    overflow: hidden;
    width: 100%;

}

body .kadence-splide-slider-init ul.products,
body ul.embla__container {
    display: flex !important;
    column-gap: 0;
    row-gap: 0;
    position: relative;
    left: 1px;

}

.kadence-splide-slider-init ul.products li.entry {
    /*position: relative;*/
    /*min-width: 0;*/
    /*box-sizing: border-box;*/
    /*flex: 0 0 calc((100% - 0px) / 2) !important;*/
    /*transform: translate3d(0, 0, 0);*/
    /*box-sizing: border-box;*/
    /*padding-left: 15px !important;*/
    margin-left: 11px;
    flex: 0 0 calc(50% - 6.5px);
}

/* 544px - 767px: 3 items (2 gaps) */
@media (min-width: 544px) {
    .kadence-splide-slider-init ul.products li.entry {
        flex: 0 0 calc(33.5% - 12.5px);
        margin-left: 15px;
    }
}

/* 768px - 991px: 4 items (3 gaps) */
@media (min-width: 768px) {
    .kadence-splide-slider-init ul.products li.entry {
        flex: 0 0 calc(25% - 12.5px);
    }
}

/* 992px and Above: 5 items (4 gaps) */
@media (min-width: 992px) {
    .kadence-splide-slider-init ul.products li.entry {
        flex: 0 0 calc(20% - 12.5px);
    }

}

body .site-main .woocommerce ul.products > li .d8-product-card,
.woocommerce ul.products > li .d8-product-card {
    border: 1px solid var(--global-palette6, #718096);
    border-radius: 0.4rem;
    height: 100%;
    /* Ensure border doesn't add to width */
    box-sizing: border-box;
    padding-bottom: 0.9rem;
    background: none;
}

body .site-main .woocommerce ul.products > li .d8-product-image-wrap,
.woocommerce ul.products > li .d8-product-image-wrap {
    padding: 5px;
    padding-bottom: 0.9rem;
    overflow: hidden;
}

body .site-main .woocommerce ul.products > li .d8-product-title,
body .site-main .woocommerce ul.products > li .d8-product-reviews,
body .site-main .woocommerce ul.products > li .d8-product-price,
body .site-main .woocommerce ul.products > li .d8-product-cart,
 .woocommerce ul.products > li .d8-product-title,
 .woocommerce ul.products > li .d8-product-reviews,
 .woocommerce ul.products > li .d8-product-price,
 .woocommerce ul.products > li .d8-product-cart {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

body .site-main .woocommerce ul.products > li .d8-product-reviews,
.woocommerce ul.products > li .d8-product-reviews {
    font-size: 12px;
    padding-bottom: 5px;
}

body .site-main .woocommerce ul.products > li .d8-product-title,
.woocommerce ul.products > li .d8-product-title {
    min-height: 60px;
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.2rem;
    margin: 0;
    padding-top: 15px;
}

body .site-main .woocommerce ul.products > li .d8-product-price,
.woocommerce ul.products > li .d8-product-price {
    margin-bottom: 1em;
    background: none;
    font-weight: 700;
    display: inline-block;
    font-size: 1.2rem;
}

body .site-main .woocommerce ul.products > li .d8-product-price del,
.woocommerce ul.products > li .d8-product-price del {
    font-size: 15px;
    font-weight: 400;
    color: inherit;
    opacity: .5;
    display: inline-block;
}

.woocommerce ul.products li.product .d8-product-cart .button,
.woocommerce ul.products li.product .d8-product-cart .button.added {
    display: inline-block;
    border-style: solid;
    font-size: 1rem;
    line-height: 1.2rem;
    background: var(--global-palette1, #3182CE);
    padding: 0.3rem 1.2rem !important;
    border-width: 1px;
    border-radius: 3rem;
    height: auto;
}

/* Layout Base */
.embla-main-wrapper { position: relative; width: 100%; }
.embla, .embla-thumbs { overflow: hidden; position: relative; }

/* Main Carousel */
.embla__container { display: flex; }
.embla__slide { flex: 0 0 100%; min-width: 0; }
.embla__slide img { object-fit: contain;
    height: 100%; display: block; max-height: 480px; }

/* Arrows (Styled like your reference) */
/* Arrow Base Styles */
.embla__arrow, .thumb__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 0;
    background-color: transparent !important; /* Circle color */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    /* SVG Background Properties */
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 16px !important; /* Adjust this to change arrow icon size */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z'/%3E%3C/svg%3E") !important;

    transition: all 0.2s ease;
    box-shadow: none;
}

/* Hover Effect */
.embla__arrow:hover, .thumb__arrow:hover {
    background-color: transparent;
}

/* Directional Logic */
.embla__arrow--next, .thumb__arrow--next {
    right: 10px;
}

.embla__arrow--prev, .thumb__arrow--prev {
    left: 10px;
    transform: translateY(-50%) rotate(180deg); /* Flips the SVG to point left */
}

/* Thumbnail specific adjustments */
.thumb__arrow {
    width: 30px;
    height: 30px;
    background-size: 12px;
}
.thumb__arrow--prev { left: 0; }
.thumb__arrow--next { right: 0; }

/* Disabled state */
.embla__arrow:disabled, .thumb__arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

/* Thumbs Carousel */
.embla-thumbs { padding: 0 45px; margin: 30px auto; } /* Space for thumb arrows */
.embla-thumbs__container { display: flex; gap: 10px; }
.embla-thumbs__viewport { overflow:hidden; }
.embla-thumbs__slide { flex: 0 0 85px; cursor: pointer; transition: 0.3s;     display: flex;
    justify-content: center;
    align-items: center; border: 1px solid #fff;}
.embla-thumbs__slide.is-active { border: 1px solid #ccc; }
.embla-thumbs__slide img { max-height: 80px;  }

/* Thumb Arrows (Smaller) */
.thumb__arrow { width: 30px; height: 30px; }
.thumb__arrow--prev { left: 5px; }
.thumb__arrow--next { right: 5px; }

@media (max-width: 992px) {

body .site-main .woocommerce ul.products > li .d8-product-title a,
.woocommerce ul.products > li .d8-product-title a {
         display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
}
}

/* Hide the inline SVG icons provided by the theme */
.add_to_cart_button .kadence-svg-iconset {
    display: none !important;
}

/* Base button styling to make room for background icon */
.add_to_cart_button {
    position: relative;
    transition: all 0.3s ease;
}

/* Loading Spinner (When AJAX is active) */
.add_to_cart_button.loading span {
    padding-right: 40px;
    background-image: url('assets/img/spinner.svg');
    background-repeat: no-repeat;
    background-position: right 12px center;
    animation: 2s linear 0s infinite normal none running spin;
    width: 20px;
    height: 17px;
    display: inline-flex !important;
    align-self: center;
    margin-bottom: -3px;
}

/* Success Checkmark (When item is added) */
.add_to_cart_button.added span {
    padding-right: 40px;
    background-image: url('assets/img/check.svg');
    background-repeat: no-repeat;
    background-position: right 12px center;
    animation: none; /* Stop spinning if it was loading */
    width: 20px;
    height: 12px;
    display: inline-flex !important;
    align-self: center;
}

/* Animation for the background spinner */
@keyframes kadence-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}