/* کانتینر کارت محصول */
.custom_product_card {
    position: relative; /* الزامی برای پوشش لینک سرتاسری */
    cursor: pointer;
    background-color: #ebf0ec;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding-bottom: 15px;
    direction: rtl;
}

/* لینک نامرئی که کل ابعاد کارت را می‌پوشاند */
.custom_product_card .card_full_link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    cursor: pointer;
}

.custom_product_card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

/* بخش تصویر */
.custom_product_card .product_img_wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
}

.custom_product_card .product_thumb_img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.15;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.custom_product_card:hover .product_thumb_img {
    transform: scale(1.03);
}

/* بج تخفیف */
.custom_product_card .sale_badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background-color: #d92d20;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6; /* بالاتر از لینک نامرئی */
    pointer-events: none; /* تا تداخلی با کلیک ایجاد نکند */
    direction: ltr;
    box-shadow: 0 3px 8px rgba(217, 45, 32, 0.35);
}

/* مشخصات متنی */
.custom_product_card .product_details {
    padding: 16px 12px 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none; /* کلیک‌ها مستقیماً به کارت هدایت شوند */
}

/* عنوان محصول */
.custom_product_card .product_title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: #2b332c;
    transition: color 0.2s ease;
}

.custom_product_card:hover .product_title {
    color: #1e6b37;
}

/* دسته‌بندی */
.custom_product_card .product_category {
    font-size: 13px;
    color: #8c968f;
    font-weight: 400;
}

/* قیمت‌ها */
.custom_product_card .product_price_box {
    margin-top: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.custom_product_card .product_price_box ins,
.custom_product_card .product_price_box .woocommerce-Price-amount {
    text-decoration: none;
    color: #2f6946;
    font-weight: 700;
}

.custom_product_card .product_price_box del {
    color: #a4afa7;
    font-size: 13px;
    font-weight: 400;
}

.custom_product_card .product_price_box del .woocommerce-Price-amount {
    color: #a4afa7;
    font-weight: 400;
}

/* ---------- دکمه سبد خرید هاور ---------- */
.custom_product_card .hover_cart_btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2b332c;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.3s ease;
    z-index: 8;
}

/* اگر بج تخفیف وجود دارد، دکمه زیر آن قرار بگیرد */
.custom_product_card.has_sale .hover_cart_btn {
    top: 70px;
}

.custom_product_card:hover .hover_cart_btn {
    opacity: 1;
    transform: translateY(0);
}

.custom_product_card .hover_cart_btn:hover {
    background: #2f6946;
    color: #fff;
}

/* ---------- گالری هاور ---------- */
.custom_product_card .hover_gallery {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 7;
    direction: ltr;
}

.custom_product_card:hover .hover_gallery {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.custom_product_card .gallery_thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.custom_product_card .gallery_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom_product_card .gallery_thumb.active {
    border-color: #2f6946;
}

/* ---------- کلاس کمکی برای کارت حراجی ---------- */
.custom_product_card.has_sale .sale_badge {
    /* بج تخفیف از قبل تعریف شده */
}

