/* Ocultamos la galería original de WooCommerce mientras cargamos */
.woocommerce-product-gallery {
    display: none !important;
}

/* Anulamos la sombra, bordes y fondos que Elementor inyecta en el contenedor padre */
.elementor-widget-container:has(.rotar-carrusel-wrapper) {
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Contenedor principal de nuestro carrusel */
.rotar-carrusel-wrapper {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: none !important;
    background: transparent !important;
}

.rotar-carrusel-wrapper.initialized {
    opacity: 1;
}

/* Carrusel Principal (Imagen Grande) */
.rotar-swiper-main {
    width: 100%;
    overflow: hidden;
    background: transparent;
    border: none;
}

.rotar-swiper-main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.rotar-swiper-main .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mostrar imagen completa sin cortar */
    cursor: zoom-in;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.3s ease; /* Transición suave para el zoom */
}

.rotar-carrusel-wrapper img:hover,
.rotar-carrusel-wrapper .swiper-slide:hover {
    box-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
}

/* Carrusel de Miniaturas */
.rotar-swiper-thumbs {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 0;
}

.rotar-swiper-thumbs .swiper-slide {
    height: auto;
    opacity: 0.6;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent !important;
    border-radius: 6px;
    box-sizing: border-box;
    padding: 2px;
}

.rotar-swiper-thumbs .swiper-slide.swiper-slide-thumb-active {
    opacity: 1;
    border-color: #333333 !important; /* Gris oscuro para que se vea claramente */
}

.rotar-swiper-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Evita que la imagen se corte */
    display: block;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 4px;
}

/* Navegación (Flechas) */
.rotar-swiper-main .swiper-button-next,
.rotar-swiper-main .swiper-button-prev {
    color: #333;
    background: transparent !important;
    box-shadow: none !important;
    width: 40px;
    height: 40px;
}

.rotar-swiper-main .swiper-button-next:after,
.rotar-swiper-main .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

.rotar-swiper-main .swiper-button-next:hover,
.rotar-swiper-main .swiper-button-prev:hover {
    color: #000;
}

/* Flechas de las miniaturas */
.rotar-thumbs-wrapper .swiper-thumb-next,
.rotar-thumbs-wrapper .swiper-thumb-prev {
    color: #333;
    background: transparent !important;
    box-shadow: none !important;
    width: 25px;
    height: 100%;
    top: 0;
    margin-top: 0;
    border-radius: 0;
}

.rotar-thumbs-wrapper .swiper-thumb-next:after,
.rotar-thumbs-wrapper .swiper-thumb-prev:after {
    font-size: 14px;
    font-weight: bold;
}

.rotar-thumbs-wrapper .swiper-thumb-next { right: -15px; }
.rotar-thumbs-wrapper .swiper-thumb-prev { left: -15px; }

/* Contador de Fotos (ej. 1 / 5) */
.rotar-pagination-custom {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    width: auto !important;
    left: auto !important;
    z-index: 10;
    pointer-events: none;
    letter-spacing: 1px;
}
