/**
Theme Name: Tienda La Fallera
Author: Jesús Marqués
Author URI: https://jesusmarques.com
Description: Tema hijo Astra para \"Tienda La Fallera\"
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tienda-la-fallera
Template: astra
*/

/* ==========================================================================
   CARRUSEL SWIPER - ESTILOS COMPLETOS (UNIFICADO Y CORREGIDO)
   ========================================================================== */

/* 1. Contenedor principal con reserva de altura */
.custom-wc-carousel {
    position: relative !important;
    min-height: 350px; /* Reserva espacio mientras carga */
}

    .custom-wc-carousel .woocommerce {
        position: relative !important;
        padding: 10px 45px 50px 45px !important;
    }

        /* 2. Cargador (Spinner) - Visible solo antes de inicializar */
        .custom-wc-carousel .woocommerce:not(.swiper-initialized)::before {
            content: "";
            position: absolute;
            top: 120px;
            left: 50%;
            width: 40px;
            height: 40px;
            margin-left: -20px;
            border: 3px solid #e2e8f0;
            border-top-color: #222222; /* Color de tu marca */
            border-radius: 50%;
            animation: wc-swiper-spin 0.8s linear infinite;
            z-index: 20;
        }

@keyframes wc-swiper-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 3. Control de opacidad y transiciones */
.custom-wc-carousel .woocommerce ul.products {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.custom-wc-carousel .woocommerce.swiper-initialized ul.products {
    opacity: 1 !important;
}

/* 4. Reset del Grid / Flex de Astra */
.custom-wc-carousel .woocommerce ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

    .custom-wc-carousel .woocommerce ul.products::before,
    .custom-wc-carousel .woocommerce ul.products::after {
        display: none !important;
        content: none !important;
    }

/* 5. Pre-maquetación FOUC (solo cuando NO está inicializado) */
.custom-wc-carousel .woocommerce:not(.swiper-initialized) ul.products {
    gap: 20px;
    overflow: hidden;
}

    .custom-wc-carousel .woocommerce:not(.swiper-initialized) ul.products li.product {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

@media (min-width: 768px) {
    .custom-wc-carousel .woocommerce:not(.swiper-initialized) ul.products li.product {
        flex: 0 0 calc((100% - 40px) / 3) !important;
        max-width: calc((100% - 40px) / 3) !important;
    }
}

@media (min-width: 1024px) {
    .custom-wc-carousel .woocommerce:not(.swiper-initialized) ul.products li.product {
        flex: 0 0 calc((100% - 80px) / 5) !important;
        max-width: calc((100% - 80px) / 5) !important;
    }
}

/* 6. Ajustes de tarjetas con Swiper activo */
.custom-wc-carousel .woocommerce.swiper-initialized ul.products li.product.swiper-slide {
    flex-shrink: 0 !important;
    float: none !important;
    clear: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    max-width: none !important;
}

/* 7. Personalización Astra (Resumen centrado y limpia de elementos) */
.custom-wc-carousel .woocommerce .listStars,
.custom-wc-carousel .woocommerce .ast-woo-product-category {
    display: none !important;
}

.custom-wc-carousel .woocommerce .astra-shop-summary-wrap {
    text-align: center;
}

/* 8. Flechas de navegación */
.custom-wc-carousel .swiper-button-next,
.custom-wc-carousel .swiper-button-prev {
    width: 42px !important;
    height: 42px !important;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #222222 !important;
    top: 42% !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

    .custom-wc-carousel .swiper-button-next::after,
    .custom-wc-carousel .swiper-button-prev::after {
        font-size: 15px !important;
        font-weight: bold;
    }

.custom-wc-carousel .swiper-button-prev {
    left: 0px !important;
}

.custom-wc-carousel .swiper-button-next {
    right: 0px !important;
}

    .custom-wc-carousel .swiper-button-next:hover,
    .custom-wc-carousel .swiper-button-prev:hover {
        background-color: #222222;
        color: #ffffff !important;
        border-color: #222222;
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

.custom-wc-carousel .swiper-button-disabled {
    opacity: 0.35 !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* 9. Paginación (Bullets) */
.custom-wc-carousel .swiper-pagination {
    bottom: 12px !important;
}

.custom-wc-carousel .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background-color: #a0aec0;
    opacity: 0.6;
    margin: 0 5px !important;
    transition: all 0.3s ease;
}

.custom-wc-carousel .swiper-pagination-bullet-active {
    background-color: #222222 !important;
    opacity: 1;
    width: 22px;
    border-radius: 4px;
}

/* 10. Responsive Móvil */
@media (max-width: 767px) {
    .custom-wc-carousel .woocommerce {
        padding: 10px 5px 45px 5px !important;
    }

    .custom-wc-carousel .swiper-button-next,
    .custom-wc-carousel .swiper-button-prev {
        display: none !important;
    }
}