/**
 * Prestaservis Cross-sell - Frontend Styles
 *
 * @author prestaservis.cz
 */

/* Section container */
.prestaservis-crosssell {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
}

/* Title */
.prestaservis-crosssell .crosssell-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #232323;
    text-transform: none;
}

/* Products wrapper */
.crosssell-products-wrapper {
    position: relative;
    padding: 0 40px;
}

/* Swiper container */
.crosssell-products.swiper {
    position: relative;
    overflow: hidden;
}

/* Swiper slide */
.crosssell-products .swiper-slide {
    height: auto;
    box-sizing: border-box;
    padding: 0 10px;
    flex-shrink: 0;
}

/* Product miniature */
.crosssell-products .crosssell-product-miniature {
    text-align: center;
}

/* Thumbnail */
.crosssell-products .crosssell-thumbnail {
    margin-bottom: 10px;
}

.crosssell-products .crosssell-thumbnail img {
    max-width: 100%;
    height: auto;
}

/* Product name */
.crosssell-products .crosssell-product-name {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 10px;
}

.crosssell-products .crosssell-product-name a {
    color: #333;
    text-decoration: none;
}

.crosssell-products .crosssell-product-name a:hover {
    color: #000;
}

/* Price */
.crosssell-products .crosssell-price {
    margin-bottom: 15px;
}

.crosssell-products .crosssell-price .price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.crosssell-products .crosssell-price .old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}

/* Add to cart button */
.crosssell-products .crosssell-add-to-cart {
    margin-top: 10px;
}

.crosssell-products .crosssell-add-to-cart .btn {
    font-size: 13px;
}

/* Navigation arrows */
.crosssell-products .swiper-button-prev,
.crosssell-products .swiper-button-next {
    position: absolute;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    color: #333;
    cursor: pointer;
    z-index: 10;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.crosssell-products .swiper-button-prev:hover,
.crosssell-products .swiper-button-next:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.crosssell-products .swiper-button-prev::after,
.crosssell-products .swiper-button-next::after {
    font-family: 'icomoon';
    font-weight: normal;
    font-size: 14px;
}

.crosssell-products .swiper-button-prev::after {
    content: "\f053";
}

.crosssell-products .swiper-button-next::after {
    content: "\f054";
}

.crosssell-products .swiper-button-prev {
    left: 0;
}

.crosssell-products .swiper-button-next {
    right: 0;
}

.crosssell-products .swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Pagination */
.crosssell-products .swiper-pagination {
    position: relative;
    margin-top: 15px;
    bottom: auto;
    text-align: center;
}

.crosssell-products .swiper-pagination-bullet {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    opacity: 1;
    margin: 0 5px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.crosssell-products .swiper-pagination-bullet-active {
    background-color: #333;
}

/* Wrapper base - flex row, no wrap for slider */
.crosssell-products .swiper-wrapper {
    display: flex;
    flex-wrap: nowrap;
}

/* Fallback grid when slider is not initialized */
.crosssell-products:not(.swiper-initialized) .swiper-wrapper {
    flex-wrap: wrap;
}

.crosssell-products:not(.swiper-initialized) .swiper-slide {
    width: 25%;
    padding: 0 10px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.crosssell-products:not(.swiper-initialized) .swiper-button-prev,
.crosssell-products:not(.swiper-initialized) .swiper-button-next,
.crosssell-products:not(.swiper-initialized) .swiper-pagination {
    display: none;
}

/* Responsive adjustments for non-slider mode */
@media (max-width: 1199px) {
    .crosssell-products:not(.swiper-initialized) .swiper-slide {
        width: 33.333%;
    }
}

@media (max-width: 991px) {
    .crosssell-products:not(.swiper-initialized) .swiper-slide {
        width: 50%;
        max-width: 50%;
        flex: 0 0 50%;
    }
}

/* Mobile - matches theme fragrance breakpoint (767px) */
@media (max-width: 767px) {
    .prestaservis-crosssell {
        margin: 15px 0;
        padding: 15px 15px 60px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .crosssell-products-wrapper {
        padding: 0;
    }

    .crosssell-products.swiper {
        overflow: hidden;
        max-width: 100%;
    }

    /* Hide arrows on mobile - use swipe instead */
    .crosssell-products .swiper-button-prev,
    .crosssell-products .swiper-button-next {
        display: none !important;
    }

    .crosssell-products:not(.swiper-initialized) .swiper-slide {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .crosssell-products .crosssell-thumbnail img {
        max-width: 80%;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    .crosssell-products .crosssell-product-name {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}
