/**
 * WooCommerce Product Groups - Slider Styles
 */

/* Related Products Section */
.wcpg-related-products {
    margin: 40px 0;
    padding: 20px 0;
    clear: both;
}

.wcpg-related-products h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: right;
}

/* Slider Container */
.wcpg-slider-container {
    position: relative;
    padding: 0 50px;
    overflow: hidden;
}

/* Slider */
.wcpg-slider {
    display: flex;
    transition: transform 0.4s ease-in-out;
    gap: 20px;
}

/* Individual Slide */
.wcpg-slide {
    flex: 0 0 calc(25% - 15px);
    min-width: calc(25% - 15px);
    box-sizing: border-box;
}

/* Product Card */
.wcpg-product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wcpg-product-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

/* Product Link */
.wcpg-product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Product Image */
.wcpg-product-image {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
}

.wcpg-product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.wcpg-product-card:hover .wcpg-product-image img {
    transform: scale(1.05);
}

/* Product Title */
.wcpg-product-title {
    font-size: 14px;
    font-weight: 500;
    margin: 12px 15px 8px;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

/* Product Price */
.wcpg-product-price {
    padding: 0 15px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wcpg-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
    margin-left: 8px;
}

.wcpg-product-price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* Product Actions */
.wcpg-product-actions {
    padding: 10px 15px 15px;
    margin-top: auto;
}

.wcpg-add-to-cart {
    display: block;
    width: 100%;
    padding: 10px 15px;
    background: #333;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.wcpg-add-to-cart:hover {
    background: #555;
}

.wcpg-add-to-cart.added::after {
    content: ' ✓';
}

/* Navigation Arrows */
.wcpg-slider-prev,
.wcpg-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.wcpg-slider-prev:hover,
.wcpg-slider-next:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.wcpg-slider-prev {
    left: 0;
}

.wcpg-slider-next {
    right: 0;
}

.wcpg-slider-prev:disabled,
.wcpg-slider-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wcpg-slider-prev:disabled:hover,
.wcpg-slider-next:disabled:hover {
    background: #fff;
    color: inherit;
    border-color: #ddd;
}

/* Dots Pagination */
.wcpg-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.wcpg-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    padding: 0;
}

.wcpg-slider-dot:hover {
    background: #999;
}

.wcpg-slider-dot.active {
    background: #333;
    transform: scale(1.2);
}

/* Responsive Styles */
@media screen and (max-width: 1200px) {
    .wcpg-slide {
        flex: 0 0 calc(33.333% - 14px);
        min-width: calc(33.333% - 14px);
    }
}

@media screen and (max-width: 900px) {
    .wcpg-slide {
        flex: 0 0 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
    
    .wcpg-slider-container {
        padding: 0 40px;
    }
}

@media screen and (max-width: 600px) {
    .wcpg-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
    
    .wcpg-slider-container {
        padding: 0 35px;
    }
    
    .wcpg-slider-prev,
    .wcpg-slider-next {
        width: 30px;
        height: 30px;
    }
    
    .wcpg-slider-prev svg,
    .wcpg-slider-next svg {
        width: 18px;
        height: 18px;
    }
}

/* RTL Support */
[dir="rtl"] .wcpg-slider-prev {
    left: auto;
    right: 0;
}

[dir="rtl"] .wcpg-slider-next {
    right: auto;
    left: 0;
}

[dir="rtl"] .wcpg-slider-prev svg {
    transform: rotate(180deg);
}

[dir="rtl"] .wcpg-slider-next svg {
    transform: rotate(180deg);
}

[dir="rtl"] .wcpg-product-price del {
    margin-left: 0;
    margin-right: 8px;
}

/* Sale Badge */
.wcpg-product-image .onsale {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    z-index: 5;
}

[dir="rtl"] .wcpg-product-image .onsale {
    right: auto;
    left: 10px;
}

/* Out of Stock */
.wcpg-product-card.outofstock .wcpg-product-image::after {
    content: 'אזל מהמלאי';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
}
