.shop-product-card {
    background: #fff;
    border: 1px solid #e0e0e0; /* بردر خاکستری نازک */
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

/* هاور کارت */
.shop-product-card:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: var(--c-gold); /* تغییر رنگ بردر به طلایی */
}

/* 2. قاب تصویر (مربعی) */
.shop-product-card .img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100% !important; /* نسبت 1:1 (مربع) */
    background: #f9f9f9;
    overflow: hidden;
    border-bottom: 1px solid #f5f5f5;
}

.shop-product-card .img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.shop-product-card:hover .img-wrapper img {
    transform: scale(1.08); /* زوم ملایم */
}

.shop-product-card.unavailable .product-footer {
    justify-content: flex-end;
}

/* -------------------------------- */

/* 3. بج‌ها (تخفیف و ناموجود) */
.badge-discount, .badge-stock-out {
    position: absolute;
    top: 10px;
    right: 10px; /* گوشه بالا راست */
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    line-height: 1;
}

.badge-discount {
    background-color: #ef394e; /* قرمز */
}

.badge-stock-out {
    background-color: #888; /* طوسی */
    font-size: 11px;
}

/* 4. دکمه علاقه‌مندی */
.btn-wishlist {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s;
}

.btn-wishlist:hover {
    background: #BE7241;
    color: #fff;
    border-color: #BE7241;
}

/* 5. بدنه کارت */
.shop-product-card .card-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

/* عنوان محصول */
.shop-product-card .product-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 10px;
    min-height: 45px;
}

.shop-product-card .product-title a {
    color: var(--c-dark-blue);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: 0.3s;
}

.shop-product-card .product-title a:hover {
    color: var(--c-primary);
}

/* 6. فوتر (قیمت و دکمه) */
.product-footer {
    display: flex;
    align-items: end;
    justify-content: space-between; /* فاصله بین قیمت و دکمه */
    padding-top: 12px;
    border-top: 1px dashed #eee;
    margin-top: auto;
}

/* استایل قیمت‌ها */
.price-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.old-price-wrapper del {
    color: #999;
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-left: 5px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--c-dark-blue);
}

.current-price.text-danger {
    color: #ef394e !important;
}

.current-price small {
    font-size: 0.75rem;
    font-weight: 400;
    color: #777;
}

/* دکمه خرید فعال */
.btn-add-to-cart {
    background-color: #fff;
    color: var(--c-dark-blue);
    border: 1px solid var(--c-dark-blue);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.btn-add-to-cart:hover {
    background-color: var(--c-dark-blue);
    color: #fff;
}

/* دکمه خرید غیرفعال (برای ناموجود) */
.btn-add-to-cart.disabled {
    background-color: #f8f9fa;
    color: #aaa;
    border-color: #eee;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 576px) {
    .shop-product-card .img-wrapper {
        padding-top: 100% !important;
    }

    .shop-product-card .card-info {
        padding: 10px 8px;
    }

    .shop-product-card .product-title {
        font-size: 0.85rem;
        min-height: 38px;
        margin-bottom: 8px;
    }

    .current-price {
        font-size: 0.95rem;
    }

    .btn-add-to-cart {
        padding: 5px 8px;
        border-radius: 6px;
    }

    .btn-add-to-cart:not(.disabled) span {
        display: none;
    }

    .btn-add-to-cart.disabled span {
        display: inline !important;
        font-size: 0.7rem !important;
    }

    .btn-add-to-cart i {
        font-size: 1.1rem;
    }

    .btn-wishlist {
        width: 30px;
        height: 30px;
        font-size: 16px;
        top: 6px;
        left: 6px;
    }
}

/* اصلاح مشکل اسکرول افقی بخش مرتب‌سازی */
.listing-products-filter-container {
    width: 100%;
    overflow-x: auto; /* فعال سازی اسکرول افقی */
    overflow-y: hidden;
    white-space: nowrap; /* جلوگیری از شکستن خط */
    -webkit-overflow-scrolling: touch; /* اسکرول نرم در iOS */
    padding-bottom: 5px; /* فضا برای دیده نشدن لبه اسکرول */
}

/* مخفی کردن نوار اسکرول برای زیبایی (اختیاری) */
.listing-products-filter-container::-webkit-scrollbar {
    display: none;
}

.listing-products-filter-container {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* اصلاح لیست داخل کانتینر */
#sort-tab {
    display: flex;
    flex-wrap: nowrap !important; /* جلوگیری اجباری از رفتن به خط بعد */
    margin-bottom: 0;
}

#sort-tab .nav-item {
    flex: 0 0 auto; /* جلوگیری از جمع شدن آیتم‌ها */
}
