.similar-products-container {
    .similar-products-inner-container {
        position: relative;
        width: 100%;
    }

    /* Static layout (3 or fewer items) */
    .similar-products-grid {
        display: flex;
        column-gap: 30px;
        row-gap: 30px;
        justify-content: flex-start;
        align-items: stretch;

        @media(max-width:1024px) {
            flex-wrap: wrap;
        }
    }

    /* Carousel layout (more than 3 items) */
    &.has-carousel {
        .similar-products-wrapper {
            overflow: hidden;
        }

        .swiper-wrapper {
            align-items: stretch;
        }
    }

    .similar-product-item {
        flex: 0 0 30%;
        height: 100%;
        background-color: #fff;
        border: 1px solid #959d99;
        padding: 27px 32px;
        position: relative;
        box-sizing: border-box;

        @media(max-width:1024px) {
            padding: 18px;
        }

        @media(max-width:768px) {
            flex: 0 0 40%;
        }

        @media(max-width:500px) {
            flex: 0 0 100%;
        }

        .product-image {
            display: block;
            text-align: center;
            position: relative;
            margin-bottom: 30px;
            height: 220px;

            @media (min-width:500px) and (max-width:1024px) {
                height: 160px;
            }

            img {
                max-width: 100%;
                width: 100%;
                height: 100%;
                object-fit: contain;
            }
        }

        h4 {
            color: #262e50;
            font-size: 24px;
            text-align: left;
            margin-bottom: 30px;
            margin-top: 0;

            @media(max-width:1024px) {
                font-size: 18px;
            }
        }

        a {
            text-decoration: none;
            color: #004fff;
            font-weight: 700;
            font-size: 16px;
            text-align: left;
            display: block;

            @media(max-width:1024px) {
                font-size: 14px;
            }

            &:hover {
                color: #000;
            }
        }
    }

    .similar-products-controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        margin-top: 30px;

        &.similar-products-controls-hidden {
            display: none !important;
        }
    }

    .similar-products-button-prev,
    .similar-products-button-next {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid #ccc;
        background: #fff;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        padding: 0 !important;
        flex: 0 0 40px;

        i {
            color: #333;
            font-size: 14px;
        }

        &:hover {
            border-color: #004fff;

            i {
                color: #004fff;
            }
        }

        &:disabled,
        &.swiper-button-disabled {
            opacity: 0.4;
            cursor: not-allowed;

            &:hover {
                border-color: #ccc;

                i {
                    color: #333;
                }
            }
        }
    }

    .similar-products-pagination {
        display: flex;
        gap: 8px;
        align-items: center;
        width: auto !important;

        .swiper-pagination-bullet {
            width: 10px;
            height: 10px;
            border-radius: 5px;
            background: #ccc;
            opacity: 1;
            transition: all 0.3s ease;
            cursor: pointer;

            &.swiper-pagination-bullet-active {
                background: #004fff;
                width: 40px;
            }
        }
    }
}