.product-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
}

.product-slider .slides-container {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.product-slider .slide {
    flex: 0 0 100%;
    text-align: center;
}

.product-slider .slide img {
    max-width: 100%;
    height: auto;
}

.product-slider .prev,
.product-slider .next {
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease-in-out;
    outline: none;
    box-shadow: none;
}

.product-slider .prev:focus,
.product-slider .next:focus,
.product-slider .prev:active,
.product-slider .next:active {
    outline: none;
    box-shadow: none;
}

.product-slider:hover .prev,
.product-slider:hover .next {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
}

.product-slider .prev {
    left: 0px;
    transform: translate3d(-20px, 0, 0);
}

.product-slider .next {
    right: 0px;
    transform: translate3d(20px, 0, 0);
}

/* Custom sizes for listing tiles and widgets - reduce arrow 30%, button width 50% */
/* Restore full height clickable area and slide-in animation specifically for product listing */

body:not(.catalog-product-view) .fotorama__arr {
    width: 40px !important;
    /* 50% of original interaction area */
    height: 100% !important;
    /* Full height interaction area */
    top: 0 !important;
    bottom: 0 !important;
    margin-top: 0 !important;
    z-index: 100 !important;
    overflow: visible !important;
    background: rgba(255, 255, 255, 0.3) !important;
    /* Restored semi-transparency */
    opacity: 0 !important;
    visibility: hidden !important;
    /* transition must include transform for the slide effect */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease-in-out, background 0.3s ease-in-out !important;
}

body:not(.catalog-product-view) .fotorama__arr--prev {
    left: 3px !important;
    /* Move inward slightly so the 56px (80*0.7) icon tip isn't clipped by tile overflow */
    right: auto !important;
    transform: translate3d(-20px, 0, 0) !important;
    /* Start slightly to the left */
}

body:not(.catalog-product-view) .widget .fotorama__arr--prev {
    left: 0px !important;
}

body:not(.catalog-product-view) .fotorama__arr--next {
    right: 3px !important;
    left: auto !important;
    transform: translate3d(20px, 0, 0) !important;
    /* Start slightly to the right */
}

body:not(.catalog-product-view) .widget .fotorama__arr--next {
    right: 0px !important;
}

/* Hover trigger on the whole product tile (category list) or the slider container */
body:not(.catalog-product-view) .product-item-info:hover .fotorama__arr--prev,
body:not(.catalog-product-view) .product-slider:hover .fotorama__arr--prev {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate3d(0, 0, 0) !important;
    /* Slide into position */
}

body:not(.catalog-product-view) .product-item-info:hover .fotorama__arr--next,
body:not(.catalog-product-view) .product-slider:hover .fotorama__arr--next {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate3d(0, 0, 0) !important;
    /* Slide into position */
}

/* Icon centering and 30% reduction (Scale 80px to 56px) */
body:not(.catalog-product-view) .fotorama__arr__arr {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 80px !important;
    height: 80px !important;
    /* translate(-50%, -50%) ensures vertical centering within the 100% height parent */
    transform: translate(-50%, -50%) scale(0.7) !important;
    margin: 0 !important;
    background-size: auto !important;
}

/* Correct background positions for 'gallery.png' sprite on listing pages */
body:not(.catalog-product-view) .fotorama__arr--prev .fotorama__arr__arr {
    background-position: -80px -80px !important;
}

body:not(.catalog-product-view) .fotorama__arr--next .fotorama__arr__arr {
    background-position: -160px -80px !important;
}

/* Remove blue focus/clicked states */
body:not(.catalog-product-view) .fotorama__arr:focus:after,
body:not(.catalog-product-view) .fotorama__arr:active:after {
    box-shadow: none !important;
    display: none !important;
}

body:not(.catalog-product-view) .fotorama__arr,
body:not(.catalog-product-view) .fotorama__arr:focus,
body:not(.catalog-product-view) .fotorama__arr:active {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}
