/* ==========================================================================
   1. کانتینر اصلی کارت محصول
   ========================================================================== */
.custom_product_card {
    position: relative;
    cursor: pointer;
    background-color: #fff; /* تغییر به سفید */
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 10px;
    direction: rtl;
}

.custom_product_card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.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;
}

/* ==========================================================================
   2. بخش تصویر و بج‌ها
   ========================================================================== */
.custom_product_card .product_img_wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    margin-bottom: 10px;
}

.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);
}

/* ==========================================================================
   3. جزئیات متن (عنوان و قیمت) - اصلاح شده
   ========================================================================== */
.custom_product_card .product_details {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important; /* تراز کردن همه آیتم‌ها به راست */
    padding: 10px 5px !important;
    pointer-events: auto !important;
}


.custom_product_card .product_title {
    width: 100% !important;
    text-align: right !important;
    font-size: 14px !important;
    font-weight: 700;
    color: #2b332c;
    margin-bottom: 8px !important;
    transition: color 0.2s ease;
}

/* قیمت را کاملاً به چپ می‌فرستیم */
.custom_product_card .product_price_box {
    width: 100% !important; 
    margin-right: auto !important; /* این ترفندِ اصلی است */
    text-align: left !important;   /* متن قیمت را چپ‌چین می‌کند */
    display: flex !important;
    justify-content: flex-end !important; /* تراز کردن المان‌های داخلی قیمت به سمت شروع (چپ) */
    font-size: 13px !important;
    color: #2f6946;
    font-weight: 700;
}

/* استایل قیمت حراجی و معمولی */
.custom_product_card .product_price_box ins,
.custom_product_card .product_price_box .woocommerce-Price-amount {
    text-decoration: none;
    color: #2f6946;
}

.custom_product_card .product_price_box del {
    color: #a4afa7;
    font-size: 12px;
    font-weight: 400;
}

/* ==========================================================================
   4. دکمه‌ها و گالری هاور
   ========================================================================== */
.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;
    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_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;
    border: 2px solid transparent;
}

.custom_product_card .gallery_thumb.active { border-color: #2f6946; }
