/* Swiper Stability */
.swiper,
.swiper-container {
    min-height: 200px;
    height: auto !important;
    position: relative;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
}

.swiper-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column;
}

.swiper-slide figure,
.swiper-slide .wp-block-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Specific targeting for standard Swiper buttons (Theme Primary Colors) */
.cel-carousel-nav .swiper-button-prev,
.cel-carousel-nav .swiper-button-next {
    position: relative !important;
    /* Reset Swiper default absolute */
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: var(--celeste-button_bg, #111) !important;
    color: var(--celeste-button_text, #fff) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure Swiper icons are visible and sized correctly */
.cel-carousel-nav .swiper-button-prev::after,
.cel-carousel-nav .swiper-button-next::after {
    font-size: 16px !important;
    font-weight: bold !important;
    font-family: swiper-icons;
    /* Swiper default */
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-variant: normal !important;
    line-height: 1 !important;
}

.cel-carousel-nav .swiper-button-prev:hover,
.cel-carousel-nav .swiper-button-next:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important;
    opacity: 0.9 !important;
}

/* Icon style for the buttons */
.cel-products-carousel .swiper-button-prev::after,
.cel-products-carousel .swiper-button-next::after {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #111 !important;
}

.cel-custom-categories.swiper-initialized .wc-block-product-categories-list.swiper-wrapper {
    display: flex !important;
    gap: 0 !important;
    height: auto !important;
}

.cel-custom-categories.swiper-initialized .wc-block-product-categories-list-item.swiper-slide,
.cel-custom-categories .wc-block-product-categories-list-item {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    width: 280px; /* Base width before Swiper takes over */
}

.cel-custom-categories .cel-categories-nav__btn.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

/* Safer mobile behavior for category cards when Swiper classes are injected */
@media (max-width: 768px) {
    .cel-custom-categories.cel-categories-swiper.swiper {
        overflow: visible !important;
    }

    .cel-custom-categories .wc-block-product-categories-list.swiper-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
    }
    .cel-custom-categories .wc-block-product-categories-list-item.swiper-slide,
    .cel-custom-categories .wc-block-product-categories-list-item {
        width: 240px; /* Robust fallback width for mobile */
        flex-shrink: 0 !important;
        height: auto !important;
    }

    .cel-custom-categories .wc-block-product-categories-list-item__image {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .cel-custom-categories .wc-block-product-categories-list-item__image img {
        position: static !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .cel-custom-categories .cel-categories-nav {
        display: none !important;
    }
}