﻿/* product-widget.css */

.product-widget {
/*    border: 1px solid #ddd;*/
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
    transition: box-shadow 0.3s;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-img {
    width: 100%;
    aspect-ratio: 4 / 3; /* ✅ نسبت ۴:۳ مثلاً 300×400 */
    object-fit: cover; /* ✅ پر کردن قاب بدون کشیدگی */
    border-radius: 6px;
    margin-bottom: 10px;
    display: block;
}



    .product-widget:hover {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }

    .product-widget a {
        color: inherit;
        text-decoration: none;
        display: block;
        height: 100%;
    }

    .product-widget figure {
        /*        max-height: 180px;*/
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
    }




.product-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-height: 40px;
    margin-bottom: 10px;
}

.price {
    font-size: 14px;
    color: #444;
}

.price-number {
    font-weight: bold;
    font-size: 15px;
}

.product-price {
    color: #2b7a78;
    font-weight: bold;
}

.product-price-currency {
    font-size: 13px;
    margin-right: 2px;
}

.product-status {
    display: inline-block;
    margin-top: 5px;
    font-size: 13px;
    padding: 2px 6px;
}

@media (max-width: 768px) {
/*    .product-img {
        height: 140px;
        object-fit: cover;
    }*/

    .product-name {
        font-size: 14px;
    }

    .price-number,
    .product-price {
        font-size: 14px;
    }
}

/* === محصول تکی (product-page) === */
.product-section {
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
}



#productImagesCarousel .carousel-inner img {
    width: 100%;
    height: 150px;
    object-fit: contain; /* تصویر کامل دیده می‌شود بدون کشیدگی */
    object-position: center; /* مرکز تصویر */
    background-color: #f9f9f9; /* فضای خالی اطراف تصویر */
    border-radius: 6px;
    display: block;
}

/* مخصوص موبایل */
@media (max-width: 768px) {
    #productImagesCarousel .carousel-inner img {
        height: 100px; /* ارتفاع کوچکتر در موبایل */
    }
}


.product-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 350px;
    border-radius: 10px;
    display: block;
}



.scroll-x-outer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-inline: 10px;
    cursor: grab;
}

.scroll-x-container {
    display: flex;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 8px;
    scroll-behavior: smooth;
    user-select: none;
}



.scroll-x-outer.active {
    cursor: grabbing;
}

.scroll-x-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Optional effect while dragging */
.scroll-x-outer.active .scroll-x-item {
    transform: scale(0.99);
    transition: transform 0.2s;
}

/* Responsive widths */
@media (min-width: 992px) {
    .scroll-x-item {
        width: calc(100% / 3 - 16px);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .scroll-x-item {
        width: calc(100% / 2 - 16px);
    }
}

@media (max-width: 767px) {
    .scroll-x-item {
        width: 100%;
    }
}

.scroll-x-outer::-webkit-scrollbar {
    display: none;
}

.scroll-wrapper {
    position: relative;
}

.scroll-hint-arrow {
    opacity: 0;
    transition: opacity 0.3s;
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%) rotate(180deg);
    font-size: 22px;
    color: #bbb;
    pointer-events: none;
    animation: bounce-arrow 1.2s infinite;
    z-index: 10;
}

@keyframes bounce-arrow {
    0%, 100% {
        transform: translateY(-50%) rotate(180deg) translateX(0);
    }

    50% {
        transform: translateY(-50%) rotate(180deg) translateX(-5px);
    }
}

@media (max-width: 768px) {
    .scroll-hint-arrow {
        font-size: 18px;
        left: 4px;
    }
}
