/* Products Swiper Block Styles */

.products-swiper-block {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.products-swiper-block .swiper-container {
    width: 100%;
    overflow: hidden;
}

/* Swiper Slides */
.products-swiper-block .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: auto;
}

.products-swiper-block .swiper-wrapper {
    align-items: flex-start;
}

/* Product Card Styles */
.products-swiper-block .product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.products-swiper-block .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Product Image */
.products-swiper-block .product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.products-swiper-block .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.products-swiper-block .product-card:hover .product-image img {
    transform: scale(1.05);
}

.products-swiper-block .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

/* Product Info */
.products-swiper-block .product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-swiper-block .product-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-swiper-block .product-price {
    font-size: 18px;
    font-weight: 700;
    color: #e74c3c;
    margin: 8px 0;
}

.products-swiper-block .product-price del {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
    margin-right: 8px;
}

/* Product Rating */
.products-swiper-block .product-rating {
    font-size: 12px;
    color: #ffc107;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.products-swiper-block .rating-stars {
    display: flex;
    gap: 2px;
}

.products-swiper-block .rating-stars .star {
    color: #ffc107;
}

.products-swiper-block .rating-stars .star.empty {
    color: #ddd;
}

.products-swiper-block .rating-count {
    color: #999;
    font-size: 11px;
}

/* Product Description */
.products-swiper-block .product-description {
    font-size: 13px;
    color: #666;
    margin: 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Add to Cart Button */
.product-actions {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-align: center;
    position: absolute;
    bottom: 120px;
    width: 100%;
    left: 0;
    pointer-events: none; /* عشان ما يكون قابل للنقر قبل ما يظهر */
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* يرجع قابل للنقر */
}


.products-swiper-block .add-to-cart-btn {
    display: block;
    text-align: center;
    background: #dc2626;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: 8px;
}

.products-swiper-block .add-to-cart-btn:hover {
    background: #dc6026;
}

.products-swiper-block .add-to-cart-btn:active {
    transform: scale(0.98);
}

/* Card Style Variations */
.products-swiper-block .product-card.card-style-elevated {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.products-swiper-block .product-card.card-style-minimal {
    width: 100%;
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.products-swiper-block .product-card.card-style-modern {
    border-radius: 12px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Swiper Navigation (Arrows) */
.products-swiper-block .swiper-prev,
.products-swiper-block .swiper-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #dc2626;
    color: #fff;
    height: 80px;
    border-radius: 0;
    font-size: 51px;
}

.products-swiper-block .swiper-prev:hover,
.products-swiper-block .swiper-next:hover {
    background: #e48080;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.products-swiper-block .swiper-prev {
    left: -50px;
}

.products-swiper-block .swiper-next {
    right: -50px;
}

.products-swiper-block .swiper-prev:disabled,
.products-swiper-block .swiper-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Swiper Pagination (Dots) */
.products-swiper-block .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.products-swiper-block .swiper-pagination-bullet {
    background: #faa1a1;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.products-swiper-block .swiper-pagination-bullet-active {
    background: #dc2626;
    width: 24px;
    border-radius: 4px;
}

.products-swiper-block .swiper-pagination-bullet:hover {
    background: #bbb;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    .products-swiper-block .swiper-prev,
    .products-swiper-block .swiper-next {
        width: 35px;
        height: 35px;
        font-size: 16px;
        left: auto;
        right: auto;
    }

    .products-swiper-block .swiper-prev {
        background: #ffffff2e;
        color: brown;
        height: 80px;
        border-radius: 0;
        font-size: 51px;
        left: -40px;
    }

    .products-swiper-block .swiper-next {
        right: -40px;
    }

    .products-swiper-block .product-info {
        padding: 12px;
    }

    .products-swiper-block .product-title {
        font-size: 14px;
    }

    .products-swiper-block .product-price {
        font-size: 16px;
    }
}

@media (max-width: 480px) {

    .products-swiper-block .swiper-prev,
    .products-swiper-block .swiper-next {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .products-swiper-block .swiper-prev {
        left: -30px;
    }

    .products-swiper-block .swiper-next {
        right: -30px;
    }

    .products-swiper-block .product-info {
        padding: 10px;
    }

    .products-swiper-block .product-title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .products-swiper-block .product-price {
        font-size: 14px;

    }

    .products-swiper-block .add-to-cart-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Editor Preview Styles */
.products-swiper-block-editor .preview-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.products-swiper-block-editor .swiper-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.products-swiper-block-editor .swiper-preview.columns-1 {
    grid-template-columns: 1fr;
}

.products-swiper-block-editor .swiper-preview.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.products-swiper-block-editor .swiper-preview.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.products-swiper-block-editor .swiper-preview.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.products-swiper-block-editor .slider-controls-preview {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.products-swiper-block-editor .slider-arrows {
    display: flex;
    gap: 10px;
}

.products-swiper-block-editor .arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.products-swiper-block-editor .arrow:hover {
    border-color: #3498db;
    color: #3498db;
}

.products-swiper-block-editor .slider-dots {
    display: flex;
    gap: 6px;
}

.products-swiper-block-editor .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
}

.products-swiper-block-editor .dot.active {
    background: #3498db;
}