/* Recently Viewed Products Carousel - Match Martfury's Style */
.mf-product-recently-viewed-carousel {
    position: relative;
    margin: 0 -15px;
    padding: 0 15px;
}

.mf-product-recently-viewed-carousel .recently-carousel-container {
    position: relative;
}

/* Products list styling - match Martfury's product carousels */
.mf-product-recently-viewed-carousel .products.slick-slider {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.mf-product-recently-viewed-carousel .products.slick-slider:not(.slick-initialized) {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
}

.mf-product-recently-viewed-carousel .products.slick-slider li.product {
    float: none !important;
    margin-bottom: 0 !important;
    padding: 0 15px !important;
    width: 100% !important;
}

/* Slick slider overrides to match Martfury */
.mf-product-recently-viewed-carousel .slick-list {
    margin: 0 -15px !important;
    padding: 0 !important;
}

.mf-product-recently-viewed-carousel .slick-track {
    display: flex !important;
}

.mf-product-recently-viewed-carousel .slick-slide {
    height: auto !important;
    float: none !important;
}

.mf-product-recently-viewed-carousel .slick-slide > div {
    height: 100% !important;
}

/* Navigation arrows - match Martfury's style */
.mf-product-recently-viewed-carousel .slick-prev-arrow,
.mf-product-recently-viewed-carousel .slick-next-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    font-size: 0;
    line-height: 0;
    padding: 0;
}

.mf-product-recently-viewed-carousel .slick-prev-arrow:hover,
.mf-product-recently-viewed-carousel .slick-next-arrow:hover {
    background: var(--mf-background-primary-color);
    border-color: var(--mf-border-primary-color);
    color: #fff;
}

.mf-product-recently-viewed-carousel .slick-prev-arrow.slick-disabled,
.mf-product-recently-viewed-carousel .slick-next-arrow.slick-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.mf-product-recently-viewed-carousel .slick-prev-arrow {
    left: -20px;
}

.mf-product-recently-viewed-carousel .slick-next-arrow {
    right: -20px;
}

.mf-product-recently-viewed-carousel .slick-prev-arrow i,
.mf-product-recently-viewed-carousel .slick-next-arrow i {
    font-size: 18px;
    line-height: 1;
    color: inherit;
}

/* Product item styling - ensure consistency */
.mf-product-recently-viewed-carousel .product-inner {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    padding: 15px;
    height: 100%;
    transition: all 0.3s ease;
}

.mf-product-recently-viewed-carousel .product-inner:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #ddd;
}

/* Ensure all product elements match Martfury's style */
.mf-product-recently-viewed-carousel .woocommerce-loop-product__title {
    font-size: 16px;
    margin: 10px 0 5px;
    line-height: 1.4;
    font-weight: 500;
}

.mf-product-recently-viewed-carousel .woocommerce-loop-product__title a {
    color: #333;
    text-decoration: none;
}

.mf-product-recently-viewed-carousel .woocommerce-loop-product__title a:hover {
    color: var(--mf-primary-color);
}

.mf-product-recently-viewed-carousel .price {
    color: #333;
    font-weight: 600;
    margin: 8px 0;
    font-size: 18px;
}

.mf-product-recently-viewed-carousel .price del {
    color: #999;
    font-size: 14px;
    margin-right: 5px;
}

.mf-product-recently-viewed-carousel .price ins {
    text-decoration: none;
    color: #e74c3c;
}

.mf-product-recently-viewed-carousel .star-rating {
    margin: 8px 0;
    font-size: 12px;
    color: #ffb300;
}

.mf-product-recently-viewed-carousel .button.add_to_cart_button {
    margin-top: 10px;
    display: inline-block;
    padding: 10px 20px !important;
    background: var(--mf-background-primary-color) !important;
    color: #fff !important;
    border-radius: 3px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border: none !important;
    font-weight: 500 !important;
}

.mf-product-recently-viewed-carousel .button.add_to_cart_button:hover {
    background: var(--mf-border-primary-color) !important;
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .mf-product-recently-viewed-carousel .slick-prev-arrow {
        left: -15px;
    }
    
    .mf-product-recently-viewed-carousel .slick-next-arrow {
        right: -15px;
    }
}

@media (max-width: 992px) {
    .mf-product-recently-viewed-carousel {
        margin: 0 -10px;
        padding: 0 10px;
    }
    
    .mf-product-recently-viewed-carousel .products.slick-slider li.product {
        padding: 0 10px !important;
    }
    
    .mf-product-recently-viewed-carousel .slick-list {
        margin: 0 -10px !important;
    }
    
    .mf-product-recently-viewed-carousel .slick-prev-arrow,
    .mf-product-recently-viewed-carousel .slick-next-arrow {
        width: 35px;
        height: 35px;
    }
    
    .mf-product-recently-viewed-carousel .slick-prev-arrow {
        left: -10px;
    }
    
    .mf-product-recently-viewed-carousel .slick-next-arrow {
        right: -10px;
    }
}

@media (max-width: 768px) {
    .mf-product-recently-viewed-carousel {
        margin: 0 -5px;
        padding: 0 5px;
    }
    
    .mf-product-recently-viewed-carousel .products.slick-slider li.product {
        padding: 0 5px !important;
    }
    
    .mf-product-recently-viewed-carousel .slick-list {
        margin: 0 -5px !important;
    }
    
    .mf-product-recently-viewed-carousel .slick-prev-arrow,
    .mf-product-recently-viewed-carousel .slick-next-arrow {
        width: 30px;
        height: 30px;
        display: none !important; /* Hide arrows on mobile like Martfury */
    }
    
    .mf-product-recently-viewed-carousel .slick-prev-arrow i,
    .mf-product-recently-viewed-carousel .slick-next-arrow i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .mf-product-recently-viewed-carousel .product-inner {
        padding: 10px;
    }
    
    .mf-product-recently-viewed-carousel .woocommerce-loop-product__title {
        font-size: 14px;
    }
    
    .mf-product-recently-viewed-carousel .price {
        font-size: 16px;
    }
}

/* Touch swipe improvements */
.mf-product-recently-viewed-carousel .slick-list {
    touch-action: pan-y;
}

/* Focus styles for accessibility */
.mf-product-recently-viewed-carousel .slick-slide:focus {
    outline: 2px solid var(--mf-primary-color);
    outline-offset: 2px;
}

.mf-product-recently-viewed-carousel .slick-prev-arrow:focus,
.mf-product-recently-viewed-carousel .slick-next-arrow:focus {
    outline: 2px solid var(--mf-primary-color);
    outline-offset: 2px;
}

/* Loading state */
.mf-product-recently-viewed-carousel .mf-loading {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

/* No products message */
.mf-product-recently-viewed-carousel .no-products {
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-style: italic;
}

/* Match Martfury's header recently viewed style */
.site-header .mf-product-recently-viewed-carousel {
    margin: 0;
    padding: 0;
}

.site-header .mf-product-recently-viewed-carousel .products.slick-slider li.product {
    padding: 0 10px !important;
}

.site-header .mf-product-recently-viewed-carousel .slick-list {
    margin: 0 -10px !important;
}

/* Match Martfury's footer recently viewed style */
.footer-recently-viewed .mf-product-recently-viewed-carousel {
    background-color: #f4f5f5;
    padding: 30px 0;
    margin: 0;
}

.footer-recently-viewed .mf-product-recently-viewed-carousel .recently-carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}