/**
 * Mika Luxury Store - Wishlist Stylesheet
 * File: 09-wishlist.css
 * Path: assets/css/09-wishlist.css
 * Scope: Wishlist Page Only (Loaded conditionally)
 * Version: 1.6.0
 * Created By Pixit-ACHTUNg
 */

/* ====================================================================================================
   ------------------ #40: Wishlist Page - Layout, Native Elements & Luxury Empty State -----------------
   ==================================================================================================== */

/* ۱. انهدام تایتل پیش‌فرض وودمارت و تنظیم فواصل دسکتاپ */
.woocommerce-wishlist .wd-page-title,
body:has(.wd-wishlist-content) .wd-page-title,
.page-id-9424 .wd-page-title {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-wishlist .main-page-wrapper,
body:has(.wd-wishlist-content) .main-page-wrapper {
    margin-top: -15px !important;
    padding-top: 0 !important;
}

.woocommerce-wishlist .site-content,
body:has(.wd-wishlist-content) .site-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* جانمایی اختصاصی در تبلت و موبایل */
@media (max-width: 1024px) {
    .woocommerce-wishlist .main-page-wrapper,
    body:has(.wd-wishlist-content) .main-page-wrapper {
        margin-top: -5px !important;
        margin-bottom: -25px !important;
        padding-top: 0 !important;
    }
}

/* ==========================================================================
   ۲. سربرگ اصلی (حفظ کامل حالت دسکتاپ + سنتر ریاضی متن در موبایل)
   ========================================================================== */

/* صفر کردن کامل تمام فواصل پیش‌فرض سربرگ و گرید وودمارت */
.wd-wishlist-head,
.wd-wishlist-content,
.wd-wishlist-content .products,
.wd-wishlist-content .elements-grid,
.wd-wishlist-content .wd-products-holder {
    border-top: none !important;
    border-bottom: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* عنوان اصلی در دسکتاپ (کاملاً دست‌نخورده و هماهنگ با نسخه پایدار) */
.wd-wishlist-content > .title,
.wd-wishlist-content > h4,
.wd-wishlist-content > h2,
.wd-wishlist-head .title,
.wd-wishlist-title {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    font-family: "Vazirmatn", sans-serif !important;
    font-size: 15.5px !important;
    font-weight: 850 !important;
    color: #1e293b !important;
    padding-bottom: 6px !important;
    margin-bottom: -15px !important; /* حداقل فاصله استاندارد زیر خط جداکننده */
    border-bottom: 1.5px solid #e2e8f0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* آیکون قلب سرخابی پیش از عنوان */
.wd-wishlist-content > .title::before,
.wd-wishlist-content > h4::before,
.wd-wishlist-content > h2::before,
.wd-wishlist-head .title::before,
.wd-wishlist-title::before {
    content: '' !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-block !important;
    background-color: #C01157 !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") no-repeat center / contain !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") no-repeat center / contain !important;
    flex-shrink: 0 !important;
}

/* 👈 سنتر دقیق متن بر روی محور ۵۰٪ ردیف صرفاً در رسپانسیو (موبایل و تبلت) */
@media (max-width: 768px) {
    .wd-wishlist-content > .title,
    .wd-wishlist-content > h4,
    .wd-wishlist-content > h2,
    .wd-wishlist-head .title,
    .wd-wishlist-title {
        justify-content: center !important;
        text-align: center !important;
    }

    /* بالانسر نامرئی متقارن جهت استقرار قطعی خود عبارت در مرکز ریاضی ردیف */
    .wd-wishlist-content > .title::after,
    .wd-wishlist-content > h4::after,
    .wd-wishlist-content > h2::after,
    .wd-wishlist-head .title::after,
    .wd-wishlist-title::after {
        content: '' !important;
        width: 18px !important;
        height: 18px !important;
        display: inline-block !important;
        visibility: hidden !important;
        pointer-events: none !important;
        flex-shrink: 0 !important;
    }
}

/* ==========================================================================
   ۳. ردیف ابزار بالای هر کارت (استایل چک‌باکس لوکس با label - حل قطعی باگ لمس ۱۰۰٪ با CSS)
   ========================================================================== */

/* کانتینر والد ردیف ابزار */
.wd-wishlist-content .wd-wishlist-product-actions,
.wd-wishlist-content .product-grid-item > .wd-wishlist-remove,
.wd-wishlist-content .wd-wishlist-action-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 15px !important;
    margin-top: 15px !important;
    margin-bottom: 25px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 5 !important;
}

/* کانتینر چک‌باکس */
.wd-wishlist-content .wd-wishlist-checkbox {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 18px !important;
    height: 18px !important;
}

/* ۱. مخفی‌سازی کامل اینپوت خام جهت مهار کلیک دوگانه */
.wd-wishlist-content .wd-wishlist-checkbox input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ۲. طراحی مربع چک‌باکس روی تگ label (تنها عنصر کلیک‌پذیر استاندارد وودمارت) */
.wd-wishlist-content .wd-wishlist-checkbox label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* حالت تیک‌خورده: پر شدن با رنگ سرخابی سازمانی و نمایش تیک سفید */
.wd-wishlist-content .wd-wishlist-checkbox input[type="checkbox"]:checked ~ label,
.wd-wishlist-content .wd-wishlist-checkbox input[type="checkbox"]:checked + label {
    background-color: #C01157 !important;
    border-color: #C01157 !important;
}

/* ساخت تیک سفید یکدست داخل کادر */
.wd-wishlist-content .wd-wishlist-checkbox input[type="checkbox"]:checked ~ label::after,
.wd-wishlist-content .wd-wishlist-checkbox input[type="checkbox"]:checked + label::after {
    content: "" !important;
    display: block !important;
    width: 5px !important;
    height: 9px !important;
    border: solid #ffffff !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) translate(-1px, -1px) !important;
    box-sizing: border-box !important;
}

/* ضربدر حذف تک‌محصول */
.wd-wishlist-content .wd-wishlist-remove,
.wd-wishlist-content .wd-wishlist-remove-text {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
}

.wd-wishlist-content a.wd-wishlist-remove,
.wd-wishlist-content .wd-wishlist-remove a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    touch-action: manipulation !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.wd-wishlist-content a.wd-wishlist-remove::before,
.wd-wishlist-content .wd-wishlist-remove a::before {
    content: "✕" !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #94a3b8 !important;
    line-height: 1 !important;
    display: block !important;
    transition: color 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.wd-wishlist-content a.wd-wishlist-remove:hover::before,
.wd-wishlist-content .wd-wishlist-remove a:hover::before {
    color: #C01157 !important;
    transform: scale(1.15) !important;
}

/* 👈 سنتر دقیق متن بر روی محور ۵۰٪ ردیف صرفاً در رسپانسیو (موبایل و تبلت) */
@media (max-width: 1024px) {
    
    /* کانتینر والد ردیف ابزار */
    .wd-wishlist-content .wd-wishlist-product-actions,
    .wd-wishlist-content .product-grid-item > .wd-wishlist-remove,
    .wd-wishlist-content .wd-wishlist-action-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 15px !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 5 !important;
}

}


/* ==========================================================================
   ۴. کپسول عملیات گروهی («حذف» و «انتخاب همه») - منطق پایدار وودمارت بدون باگ تاچ
   ========================================================================== */

/* عدم نمایش در حالت عادی (کنترل ۱۰۰٪ توسط کلاس .wd-visible وودمارت بدون تداخل لمسی) */
.wd-wishlist-bulk-action:not(.wd-visible),
.wd-wishlist-bulk-action[style*="display: none"],
.wd-wishlist-bulk-action[style*="display:none"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* کپسول فعال در دسکتاپ فقط پس از ثبت قطعی کلیک و اعمال .wd-visible توسط قالب */
.wd-wishlist-bulk-action.wd-visible {
    display: inline-flex !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin: 2px 0 10px 0 !important;
    background: #ffffff !important;
    border: 1px solid rgba(192, 17, 87, 0.18) !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 14px rgba(192, 17, 87, 0.06) !important;
    padding: 4px 14px !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    animation: mkBulkFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes mkBulkFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* صفر کردن بوردرها از روی تمام عناصر داخلی */
.wd-wishlist-bulk-action *,
.wd-wishlist-bulk-action a,
.wd-wishlist-bulk-action div {
    border: none !important;
    box-shadow: none !important;
}

/* استایل دکمه‌های دوگانه داخل کپسول */
.wd-wishlist-bulk-action .wd-action-btn a {
    background: transparent !important;
    font-family: "Vazirmatn", sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #334155 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 3px 4px !important;
    line-height: 1 !important;
    transform-origin: center center !important;
    transform: scale(1) translateZ(0) !important;
    transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 👈 فقط و فقط ۱ خط جداکننده تمیز در سمت چپ دکمه حذف */
.wd-wishlist-bulk-action .wd-wishlist-remove-action {
    border-left: 1px solid rgba(192, 17, 87, 0.2) !important;
    padding-left: 12px !important;
    margin-left: 2px !important;
}

/* حذف هرگونه خط احتمالی روی گزینه دوم */
.wd-wishlist-bulk-action .wd-wishlist-select-all {
    border: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* رنگ سرخابی آیکون در هر دو حالت عادی و هاور */
.wd-wishlist-bulk-action .wd-action-icon,
.wd-wishlist-bulk-action .wd-action-icon:before,
.wd-wishlist-bulk-action .wd-action-icon:after,
.wd-wishlist-bulk-action a:before,
.wd-wishlist-bulk-action a:after,
.wd-wishlist-bulk-action a i,
.wd-wishlist-bulk-action a svg {
    color: #C01157 !important;
    fill: #C01157 !important;
    stroke: #C01157 !important;
    font-size: 13.5px !important;
    font-weight: 900 !important;
    transition: color 0.2s ease !important;
}

/* Scale هماهنگ کل دکمه حین هاور */
.wd-wishlist-bulk-action .wd-action-btn a:hover {
    color: #C01157 !important;
    transform: scale(1.06) translateZ(0) !important;
}

/* حذف اسکیل مستقل و ثانویه آیکون جهت هماهنگی حرکت */
.wd-wishlist-bulk-action .wd-action-btn a:hover .wd-action-icon,
.wd-wishlist-bulk-action .wd-action-btn a:hover:before,
.wd-wishlist-bulk-action .wd-action-btn a:hover:after,
.wd-wishlist-bulk-action a:hover svg {
    transform: none !important;
}

/* اصلاح هوشمند متن «حذف همه» به «رها کردن همه» در CSS */
.wd-wishlist-bulk-action .wd-wishlist-text-deselect {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
}

.wd-wishlist-bulk-action .wd-wishlist-text-deselect::after {
    content: 'رها کردن همه' !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    color: #334155 !important;
    display: inline-block !important;
    transition: color 0.2s ease !important;
}

.wd-wishlist-bulk-action .wd-action-btn a:hover .wd-wishlist-text-deselect::after,
.wd-wishlist-bulk-action .wd-action-btn a:hover .wd-action-text {
    color: #C01157 !important;
}

/* سنتر دقیق و پهنای شکیل در موبایل بدون باگ تاچ */
@media (max-width: 768px) {
    .wd-wishlist-bulk-action.wd-visible {
        display: flex !important;
        margin: 2px auto 10px auto !important;
        justify-content: center !important;
        min-width: 220px !important;
        padding: 5px 18px !important;
    }
}

/* ==========================================================================
   ۵. حالت خالی لوکس (Empty State) با متن کوتاه و تراز Justify
   ========================================================================== */

.wd-empty-wishlist,
.wd-empty-block.wd-empty-wishlist {
    background: #ffffff !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 28px 6px 28px 6px !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.04) !important;
    padding: 55px 24px !important;
    max-width: 580px !important;
    margin: 20px auto 45px auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* قلب متحرک با هاله یاقوتی */
.wd-empty-wishlist .wd-empty-block-title::before {
    content: '' !important;
    display: block !important;
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto 20px auto !important;
    background-color: #C01157 !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E") no-repeat center / contain !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E") no-repeat center / contain !important;
    filter: drop-shadow(0 6px 14px rgba(192, 17, 87, 0.25)) !important;
}

.wd-empty-wishlist .wd-empty-block-title {
    font-family: "Vazirmatn", sans-serif !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3 !important;
}

/* پنهان‌سازی متن طولانی پیش‌فرض */
.wd-empty-wishlist .wd-empty-block-text {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    margin: 0 auto 26px auto !important;
}

/* جایگزینی با متن کوتاه، متین و تراز Justify */
.wd-empty-wishlist .wd-empty-block-text::after {
    content: "لیست علاقه‌مندی‌های شما در حال حاضر خالی است. برای ذخیره و مشاهده دوباره کالاهای موردپسندتان، از بخش فروشگاه دیدن فرمایید." !important;
    font-family: "Vazirmatn", sans-serif !important;
    font-size: 13.5px !important;
    font-weight: 550 !important;
    color: #64748b !important;
    line-height: 1.8 !important;
    display: block !important;
    max-width: 440px !important;
    text-align: justify !important;
    text-align-last: center !important;
    text-justify: inter-word !important;
}

/* دکمه بازگشت به فروشگاه */
.wd-empty-wishlist a.button,
.wd-empty-wishlist .wd-empty-block-btn {
    background: linear-gradient(135deg, #C01157 0%, #9e0c45 100%) !important;
    color: #ffffff !important;
    font-family: "Vazirmatn", sans-serif !important;
    font-size: 14.5px !important;
    font-weight: 850 !important;
    padding: 12px 36px !important;
    border-radius: 50px !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(192, 17, 87, 0.28) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease !important;
}

.wd-empty-wishlist a.button:hover,
.wd-empty-wishlist .wd-empty-block-btn:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 10px 25px rgba(192, 17, 87, 0.38) !important;
}