/**
 * Related Products Carousel – Frontend Styles
 *
 * Mirrors the chrome of blocks/new-products-carousel for visual consistency,
 * but lays slides out as one card per slide so the carousel snaps card-by-card.
 * The cards themselves are rendered by ims_render_product_card() and inherit
 * styles from the shared product listing card stylesheet.
 */

.ims-related-products-carousel-section {
    background: transparent;
    padding: 2rem 0 1rem;
    margin: 0;
    position: relative;
}

.ims-related-products-carousel-section .splide__pagination {
    display: none !important;
}

/* ── Header ─────────────────────────────────────────────── */

.ims-related-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto 1rem;
    gap: 1rem;
}

.ims-related-products-header .header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
}

.ims-related-products-header .carousel-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-dark, #1a1a1a);
    margin: 0;
    letter-spacing: -0.3px;
}

.ims-related-products-header .header-right {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Nav Buttons ────────────────────────────────────────── */

.ims-related-products-carousel-section .carousel-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-border, #ccc);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--color-dark, #1a1a1a);
    padding: 0;
}

.ims-related-products-carousel-section .carousel-nav-btn:hover:not(:disabled) {
    background: var(--color-dark, #1a1a1a);
    border-color: var(--color-dark, #1a1a1a);
    color: #fff;
}

.ims-related-products-carousel-section .carousel-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.ims-related-products-carousel-section .carousel-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Subtitle ───────────────────────────────────────────── */

.ims-related-products-carousel-section .carousel-subtitle {
    max-width: 1400px;
    margin: 0 auto 1rem;
    color: #555;
    font-size: 0.95rem;
}

/* ── Splide track ───────────────────────────────────────── */

.ims-related-products-splide {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 0 !important;
}

.ims-related-products-splide .splide__track {
    overflow: hidden;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.ims-related-products-splide .splide__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ims-related-products-slide {
    list-style: none !important;
    height: auto !important;
    box-sizing: border-box;
    display: flex;
}

/*
 * Each slide hosts a single card wrapped in .ims-products-grid so the card
 * inherits the polished listing-page card design defined in
 * blocks/product-listing-grid/style.css. .ims-products-grid alone does NOT
 * trigger the grid layout (that's scoped to .ims-products-container.ims-products-grid),
 * so this gives us the card visuals without the listing-page grid behavior.
 * The wrap stretches to the full slide so neighboring cards line up.
 */
.ims-related-products-slide__card-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ims-related-products-slide__card-wrap > .ims-product-card,
.ims-related-products-slide__card-wrap > article.ims-product-card {
    width: 100%;
    height: 100%;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
    .ims-related-products-carousel-section {
        padding: 1.5rem 0 0.5rem;
    }

    .ims-related-products-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .ims-related-products-header .carousel-title {
        font-size: 1.25rem;
    }

    .ims-related-products-carousel-section .carousel-nav-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .ims-related-products-header .header-left {
        gap: 0.75rem;
    }
}
