.cel-product-carousel-wrapper {
    margin: 20px 0 !important;
    position: relative !important;
    width: 100% !important;
    display: block !important;
}

/* Section Header Styles */
.cel-block-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-bottom: 30px !important;
    gap: 30px !important;
}

.cel-block-header__content {
    flex: 1 !important;
}

.cel-block-header__title {
    margin: 0 !important;
    font-size: clamp(24px, 4vw, 32px) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #111 !important;
}

.cel-block-header__subtitle {
    margin: 8px 0 0 !important;
    font-size: 16px !important;
    color: #666 !important;
    max-width: 600px !important;
}

.cel-block-header__actions {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

.cel-block-header__link {
    text-decoration: none !important;
    font-weight: 600 !important;
    color: var(--celeste-primary_color, #111) !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.cel-block-header__link:hover {
    text-decoration: underline !important;
}

/* Base card styles */
.cel-product-carousel-wrapper .cel-product-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.3s ease !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    /* Reset any defaults that might cause stretching */
    flex: 0 0 auto !important;
}

/* Handle layout when Swiper is NOT initialized (single item case) */
.cel-product-carousel-wrapper:not(.swiper-initialized) .swiper-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 24px !important;
    width: 100% !important;
}

.cel-product-carousel-wrapper:not(.swiper-initialized) .cel-product-card {
    /* Explicitly use the column variable with a fallback to 4 */
    width: calc((100% - (var(--cel-columns, 4) - 1) * 24px) / var(--cel-columns, 4)) !important;
    max-width: calc((100% - (var(--cel-columns, 4) - 1) * 24px) / var(--cel-columns, 4)) !important;
    min-width: 250px !important;
}

@media (max-width: 768px) {
    .cel-product-carousel-wrapper:not(.swiper-initialized) .cel-product-card {
        width: 85% !important;
        max-width: 85% !important;
        margin: 0 auto !important;
    }
    
    .cel-product-carousel-wrapper:not(.swiper-initialized) .swiper-wrapper {
        justify-content: center !important;
    }
}

/* Image Wrapper */
.cel-product-carousel-wrapper .cel-product-card__img-wrap {
    position: relative !important;
    aspect-ratio: 1 !important;
    overflow: hidden !important;
    background: transparent !important;
    border-radius: 20px !important;
    z-index: 1 !important;
}

.cel-product-carousel-wrapper .cel-product-card__img-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.6s cubic-bezier(0.2, 0, 0.2, 1) !important;
}

.cel-product-carousel-wrapper .cel-product-card:hover .cel-product-card__img-wrap img {
    transform: scale(1.05) !important;
}

/* Actions (Add to Cart) */
.cel-product-carousel-wrapper .cel-product-card__actions {
    position: absolute !important;
    bottom: 15px !important;
    left: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    opacity: 0 !important;
    transform: translateY(20px) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    z-index: 10 !important;
}

.cel-product-carousel-wrapper .cel-product-card:hover .cel-product-card__actions {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.cel-product-carousel-wrapper .cel-product-card__add-btn {
    width: 90% !important;
    height: 44px !important;
    background: var(--celeste-button_bg, #111) !important;
    color: var(--celeste-button_text, #fff) !important;
    border-radius: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 25px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    transition: all 0.3s ease !important;
    border: none !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
}

/* Fix: Cuando se añade al carrito, ocultamos el botón original y estilizamos el link de "Ver carrito" */
.cel-product-carousel-wrapper .cel-product-card__actions .add_to_cart_button.added {
    display: none !important;
}

.cel-product-carousel-wrapper .cel-product-card__actions .added_to_cart {
    width: 90% !important;
    height: 44px !important;
    background: var(--celeste-primary_color, #111) !important;
    color: #fff !important;
    border-radius: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 25px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
}

.cel-product-carousel-wrapper .cel-product-card__actions .added_to_cart:hover {
    opacity: 0.9 !important;
    transform: translateY(-2px) !important;
}

/* Info Section */
.cel-product-carousel-wrapper .cel-product-card__info {
    padding: 15px 0 !important;
}

.cel-product-carousel-wrapper .cel-product-card__header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 15px !important;
    width: 100% !important;
    margin-top: 5px !important;
}

.cel-product-carousel-wrapper .cel-product-card__title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    flex: 1 !important;
}

.cel-product-carousel-wrapper .cel-product-card__title a {
    text-decoration: none !important;
    color: var(--celeste-text_color, #111) !important;
    transition: color 0.2s ease !important;
}

.cel-product-carousel-wrapper .cel-product-card:hover .cel-product-card__title a {
    color: var(--celeste-link_color, #2563eb) !important;
}

.cel-product-carousel-wrapper .cel-product-card__category a {
    color: var(--celeste-text_color, #111) !important;
    transition: color 0.2s ease !important;
    text-decoration: none !important;
}

.cel-product-carousel-wrapper .cel-product-card__price {
    font-size: 18px !important;
    font-weight: 900 !important;
    color: var(--celeste-primary_color, #111) !important;
    white-space: nowrap !important;
}

/* Navigation */
.cel-product-nav {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
}

.cel-product-nav__btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    border: none !important;
    background: var(--celeste-button_bg, #111) !important;
    color: var(--celeste-button_text, #fff) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}
.cel-product-nav__btn:hover {
    opacity: 0.9 !important;
    transform: scale(1.05) !important;
}

/* Mobile Adjustments for Header */
@media (max-width: 768px) {
    .cel-block-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        margin-bottom: 20px !important;
    }

    .cel-block-header__actions {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .cel-product-nav {
        display: none !important;
    }
}
