/* ========================================
   Product Card Carousel / Image Slider
   ======================================== */

/* === كاروسيل الصور داخل كارت المنتج === */
.product-carousel {
    position: relative;
    overflow: hidden;
}

.product-carousel .carousel-inner {
    border-radius: 0;
}

.product-carousel .carousel-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* أسهم التنقل */
.product-carousel .carousel-control-prev,
.product-carousel .carousel-control-next {
    width: 32px;
    height: 32px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-carousel:hover .carousel-control-prev,
.product-carousel:hover .carousel-control-next {
    opacity: 1;
}

.carousel-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    color: #333;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.carousel-nav-btn:hover {
    background: #0d6efd;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.product-carousel .carousel-control-prev {
    right: 6px;
    left: auto;
}

.product-carousel .carousel-control-next {
    left: 6px;
    right: auto;
}

/* نقاط التنقل (dots) */
.carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 3;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: #0d6efd;
    width: 18px;
    border-radius: 4px;
    border-color: #0d6efd;
}

/* الكاروسيل داخل Grid المنتجات */
.products-grid .product-carousel .carousel-item img {
    height: 200px;
}

/* الكاروسيل في القسم المميز (h-scroll) */
.h-row .product-carousel .carousel-item img {
    height: 140px;
}

/* الكاروسيل في صفحة الفئات */
.product-card-cat .product-carousel {
    border-radius: 0.375rem 0.375rem 0 0;
    overflow: hidden;
}

.product-card-cat .product-carousel .carousel-item img {
    height: 200px;
    border-radius: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .product-carousel .carousel-control-prev,
    .product-carousel .carousel-control-next {
        opacity: 1;  /* دائماً ظاهرة على الجوال */
    }
    
    .carousel-nav-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .carousel-dot {
        width: 6px;
        height: 6px;
    }
    
    .carousel-dot.active {
        width: 14px;
    }
}

/* === تحسين الـ Swipe على الجوال === */
.product-carousel .carousel-item {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* === Image count badge === */
.product-carousel .image-count-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    z-index: 3;
    backdrop-filter: blur(4px);
}
