/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* ================================
   ساختار کلی کارت
================================ */
.custom-product-card {
    background: #ffffff;
    border-radius: 22px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* افکت هاور */
.custom-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 6px 18px rgba(0, 0, 0, 0.05);
}

/* ================================
   بخش تصویر
================================ */
.card-image-section {
    position: relative;
    margin-bottom: 15px;
}

.card-image-section img {
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

/* ================================
   دکمه علاقه‌مندی (قلب)
================================ */
.wishlist-overlay {
    position: absolute;
    top: 2px;
    left: 6px;
    z-index: 5;
}

.wishlist-overlay a,
.wishlist-overlay button {
    background: rgba(255, 255, 255, 0.20) !important;
    backdrop-filter: blur(7px);
    border-radius: 50%;
    padding: 6px 8px !important;
    color: #7a9c59 !important;   /* سبز برگ مطابق عکس */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease;
}

.wishlist-overlay a:hover,
.wishlist-overlay button:hover {
    background: #ffffff !important;
}

/* ================================
   متون (عنوان، دسته، برند، قیمت)
================================ */
.card-content-section {
    flex-grow: 1;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    min-height:3em;
    margin-bottom: 6px !important;
    text-align: right;
}

.product-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #7a9c59;
}

.product-cat, .product-brand {
    font-size: 13px;
    color: #777;
    margin-bottom: 2px;
    text-align: right;
}

.product-cat a, .product-brand a {
    color: #777;
    transition: color 0.2s ease;
}

.product-cat a:hover,
.product-brand a:hover {
    color: #7a9c59;
}

/* ================================
   قیمت
================================ */
.product-price {
    margin-top: 10px;
    margin-bottom: 8px;
    text-align: right;
    font-size: 14px;
    font-weight: bold;
    color: #000;
}

/* ================================
   دکمه افزودن به سبد خرید
================================ */
.card-action-section {
    margin-top: auto;
    text-align: center;
}

.card-action-section .button {
    width: 100%;
    background: #F3F3F3 !important;
    border-radius: 12px !important;
    padding: 4px 0 !important;
    font-size: 15px !important;
    font-weight: 600;
    color: #000 !important;
    transition: background 0.3s ease, transform 0.25s ease;
}

.card-action-section .button:hover {
    background: #E0E0E0 !important;
}

/* ================================
   ریسپانسیو
================================ */
@media (max-width: 480px) {
    .custom-product-card {
        padding: 10px;
        border-radius: 18px;
    }

    .product-price {
        font-size: 20px;
    }

    .product-title {
        font-size: 14px;
    }
}

.custom-product-card .added_to_cart.wc-forward {
    display: none !important;
}

.card-swatch-section {
    margin: 0px 0 10px;
    display: flex;
    gap: 6px;
}

.card-swatch-section .wd-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-swatch-section .wd-swatch:hover {
    transform: scale(1.12);
    border-color: #7a9c59;
}

.card-swatch-section{
margin:0px 0 4px;
padding-bottom:8px;
display:flex;
gap:6px;
min-height:28px;
}


/* =====================================
   YITH Wishlist – Custom SVG Version
   ===================================== */

/* حذف متن */
.yith-wcwl-add-to-wishlist-button__label{
display:none !important;
}

/* حذف SVG پیشفرض افزونه */
.yith-wcwl-add-to-wishlist-button svg{
display:none !important;
}

/* دکمه اصلی */
.yith-wcwl-add-to-wishlist-button{

display:flex;
align-items:center;
justify-content:center;

width:38px;
height:38px;

background:#ffffff1b;
border-radius:50%;
transition:all .25s ease;
cursor:pointer;
}

/* افکت هاور */
.yith-wcwl-add-to-wishlist-button:hover{
transform:scale(1.08);
}

/* =====================
   حالت عادی (خالی)
   ===================== */
.yith-wcwl-add-to-wishlist-button::before{
content:"";
width:20px;
height:20px;
display:block;
background:url("https://yasminehshop.com/wp-content/uploads/2026/05/wishlist_default.svg") center/contain no-repeat;
transition:all .25s ease;
}

/* =====================
   حالت اضافه شده
   ===================== */
.yith-wcwl-add-to-wishlist-button--added::before{
background:url("https://yasminehshop.com/wp-content/uploads/2026/05/wishlist_active.svg") center/contain no-repeat;
transform:scale(1.1);
}

/* انیمیشن پاپ بعد از افزودن */
.yith-wcwl-add-to-wishlist-button--added{
animation:heartPop .3s ease;
}

@keyframes heartPop{
0%{transform:scale(1);}
50%{transform:scale(1.25);}
100%{transform:scale(1);}
}

.product-card{
  display:flex;
  flex-direction:column;
  height:100%;           /* داخل گرید/کالوم برابر می‌شود */
}

.product-card .card-bottom{
  margin-top:auto;       /* هل دادن به پایین */
}
/* =====================
اندازه کارت‌ها در محصولات مشابه 
   ===================== */
.archive .product-card{
display:flex;
flex-direction:column;
height:100%;
}

.related .product-card,
.up-sells .product-card{
display:block;
height:auto;
}

.related .product,
.up-sells .product{
width:auto !important;
}

.related .product,
.up-sells .product{
display:flex;
}

.related .product .product-card,
.up-sells .product .product-card{
display:flex;
flex-direction:column;
height:100%;
width:100%;
}

.product-card .card-action-section{
margin-top:auto;
}

.button.checkout.wc-forward{
background-color:#6A9145 !important;
border-color:#6A9145 !important;
color:#fff !important;
}

.button.checkout.wc-forward:hover{
background-color:#5a7c39 !important; /* کمی تیره‌تر برای هاور */
border-color:#5a7c39 !important;
}

.marquee-wrapper,
.marquee-container{
    margin:0 !important;
    padding:0 !important;
    line-height:0;
}

.marquee-wrapper iframe,
.marquee-container iframe{
    display:block;
    width:100%;
    height:40px;
    border:0;
}


/* ۱. تعریف آیکون SVG به صورت ماسک (برای قابلیت تغییر رنگ داینامیک) */
.wd-show-sidebar-btn > a::before,
.woodmart-show-sidebar-btn > a::before,
.wd-sidebar-opener.wd-filter-icon > a::before,
.wd-sidebar-opener > a::before {
    content: "" !important;
    background-image: none !important; /* حذف بک‌گراند قبلی */
    background-color: #333 !important; /* رنگ پیش‌فرض آیکون شما در حالت عادی (مثلاً مشکی/خاکستری) */
    
    /* اعمال تفنگ ماسک روی SVG */
    -webkit-mask-image: url('/wp-content/uploads/2026/05/setting.svg');
    mask-image: url('/wp-content/uploads/2026/05/setting.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    
    width: 20px !important; /* سایز آیکون در دکمه ثابت بالای صفحه */
    height: 20px !important;
    display: inline-block !important;
    font-family: inherit !important;
}

/* ۲. چالش اول: بزرگ‌تر کردن آیکون اختصاصی در حالت اسکرول (دکمه شناور) */
.wd-sidebar-opener.wd-filter-icon > a::before,
.wd-sidebar-opener > a::before {
    width: 28px !important;  /* سایز بزرگتر در حالت اسکرول */
    height: 28px !important;
}

.wd-show-sidebar-btn > a,
.woodmart-show-sidebar-btn > a,
.wd-sidebar-opener > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* تشخیص فعال بودن فیلتر با CSS مدرن (سازگار کامل با AJAX وودمارت) */
body:has(.wd-active-filters) .wd-sidebar-opener.wd-filter-icon > a::before,
body:has(.wd-active-filters) .wd-sidebar-opener > a::before,
body:has(.widget_layered_nav_filters) .wd-sidebar-opener.wd-filter-icon > a::before,
body:has(.widget_layered_nav_filters) .wd-sidebar-opener > a::before {
    background-color: #6A9145 !important; /* تغییر رنگ به سبز */
}

/* ========================================================
   اصلاح نهایی موتور ترنزیشن و انحلال کارت (Cross-Dissolve)
   ======================================================== */

/* تنظیمات پایه نگهدارنده تصویر کارت */
.product-image-link {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    background-color: #fff;
}

/* انیمیشن لایه تصویر اصلی */
.product-image-link .primary-main-image,
.product-image-link img:first-child {
    display: block !important;
    width: 100%;
    height: auto;
    opacity: 1 !important;
    position: relative;
    z-index: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
}

/* انیمیشن لایه تصویر دوم بدون لودینگ فرعی */
.product-image-link .secondary-hover-image {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0 !important;
    z-index: 2;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
}

/* --- وضعیت ۲: محصول تصویر دوم ندارد -> فقط یک زوم نرم ایجاد شود --- */
.no-hover-image:hover .product-image-link img {
    transform: scale(1.05) !important;
}

/* --- وضعیت ۱ و ۳: محصول تصویر دوم دارد -> انیمیشن انحلال دو تصویر درون یکدیگر --- */
.has-hover-image:hover .product-image-link .primary-main-image,
.has-hover-image:hover .product-image-link img:first-child {
    opacity: 0 !important;
    transform: scale(1.02) !important;
}

.has-hover-image:hover .product-image-link .secondary-hover-image {
    opacity: 1 !important;
    transform: scale(1.02) !important;
}

/* لغو رفتارهای تداخلی پوسته‌های قدیمی وودمارت */
.woodmart-hover-base:hover .product-image-link img,
.custom-product-card:hover .card-image-section:not(.no-hover-image):not(.has-hover-image) img {
    transform: none !important;
    opacity: 1 !important;
}

/* حذف محدودیت‌های عرض و پدینگ از دور باکس آی‌فریم */
.whb-top-bar .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.whb-top-bar .whb-column,
.whb-top-bar .wd-header-text {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* حذف حاشیه‌های پیش‌فرض آی‌فریم در موبایل و دسکتاپ */
.whb-top-bar iframe {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* ========================================================
   موتور کاروسل اختصاصی ۵ تایی با حفظ ارتفاع واقعی (Auto-Height)
   ======================================================== */

/* دسکتاپ: چیدمان ۵ تایی فیکس و هم‌تراز */
.custom-category-carousel {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: flex-start !important;
    gap: 16px !important;
}

/* تقسیم فضا به ۵ قسمت مساوی در دسکتاپ برای ویجت‌های تصویر داخل کانتینر */
.custom-category-carousel > .elementor-element {
    width: 20% !important; 
    max-width: 20% !important;
    flex-shrink: 1 !important;
}

.custom-category-carousel img {
    width: 100% !important;
    height: auto !important; /* حفظ ارتفاع واقعی عکس */
    object-fit: contain !important;
    border-radius: 14px !important;
}

/* موبایل: تبدیل به کاروسل اسکرولی با نمایش ۲ تصویر بزرگ در صفحه */
@media (max-width: 767px) {
    .custom-category-carousel {
        overflow-x: auto !important; /* فعال‌سازی اسکرول با انگشت روی موبایل */
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        padding-bottom: 15px !important;
        gap: 12px !important; /* فاصله تصاویر در گوشی */
    }

    /* مخفی کردن نوار اسکرول پایین در گوشی */
    .custom-category-carousel::-webkit-scrollbar {
        display: none !important;
    }

    /* لغو کردن عرض ۲۰٪ دسکتاپ و بزرگ کردن تصاویر روی موبایل */
    .custom-category-carousel > .elementor-element {
        min-width: 46% !important; /* نمایش ۲ تصویر کامل و بیرون ماندن تصویر سوم */
        width: 46% !important;
        max-width: 46% !important;
        flex-shrink: 0 !important;
        scroll-snap-align: start !important;
    }
    
    .custom-category-carousel img {
        height: auto !important;
    }
}