/*
 Theme Name:   Woodmart Child
 Template:     woodmart
 Version:      1.0
 Author:       Your Name
 Description:  قالب فرزند برای Woodmart
*/

/*رفع ارور فونت در انالیز گوگل*/
@font-face {
    font-family: 'Woodmart';
    src: url('/wp-content/themes/woodmart/fonts/woodmart-font-2-700.woff2?v=8.2.7') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =============================
   متن تخفیف و درصد تخفیف
   ============================= */
.onsale.product-label {
    color: #ffffff !important;        /* متن سفید */
    background-color: #f82568 !important; /* پس‌زمینه پررنگ */
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

/* =============================
   قیمت محصولات در product-wrapper
   ============================= */
.product-wrapper bdi {
    color: #111111 !important;        /* متن تیره */
    font-weight: 600;
}

/* =============================
   دکمه‌ها و لینک‌ها
   ============================= */
a.elementor-button,
a.elementor-button:hover {
    color: #ffffff !important;       /* متن سفید */
    background-color: #f82568 !important; /* پس‌زمینه دکمه */
}

/* =============================
   لینک‌های دسته‌بندی و مطالب
   ============================= */
a.category-link,
a.wd-fill {
    color: #111111 !important;        /* متن تیره */
}

a.category-link:hover,
a.wd-fill:hover {
    color: #f82568 !important;        /* هاور قرمز برند */
}

/* =============================
   پیام‌های اتمام موجودی
   ============================= */
.out-of-stock.product-label {
    color: #ffffff !important;
    background-color: #333333 !important; /* خاکستری تیره */
    padding: 2px 6px;
    border-radius: 3px;
}

/* =============================
   فونت و سایز استاندارد برای موبایل
   ============================= */
@media (max-width: 768px) {
    .onsale.product-label,
    .product-wrapper bdi {
        font-size: 14px !important;
    }
}


/* استایل عمومی badge */
.mahora-sale-badge {
    background: #f82568;
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 14px;
    display: inline-block;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* مخصوص آرشیو (صفحه فروشگاه و صفحه اصلی) */
.woocommerce ul.products li.product .mahora-sale-badge {
    top: 10px;
    right: 10px;
    left: auto;  /* اگر قالب پیشفرضش left داده */
}

/* مخصوص صفحه محصول تکی */
.single-product .mahora-sale-badge {
    top: 15px;
    right: 15px;
}

/*فعال شدن زوم موبایل*/
html, body {
    touch-action: auto !important;
}


/* ========================= Mini Cart - Elementor Menu - Fixed ========================= */

/* کل پنل سبد */
.widget_shopping_cart {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    font-family: SHABNAM, sans-serif;
    text-align: center;
}

/* محصولات داخل سبد */
.widget_shopping_cart .elementor-menu-cart__product {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7fff2;
    border-radius: 5px;
    border: 1px solid #cccccc;
    padding: 10px;
    margin-bottom: 10px;
    transition: 0.3s ease;
    position: relative;
}

/* دکمه حذف محصول - واقعی با لینک ووکامرس */
.widget_shopping_cart .product-remove a {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: 0.2s ease;
    background: #ffeded;
    text-decoration: none !important;
}

/* علامت × */
.widget_shopping_cart .product-remove a::before {
    content: "×";
    font-size: 16px;
    font-weight: bold;
    color: #ff3366;
    display: block;
    line-height: 1;
}

/* هاور روی دکمه حذف */
.widget_shopping_cart .product-remove a:hover {
    background: #ff3366;
}
.widget_shopping_cart .product-remove a:hover::before {
    color: #ffffff;
}

/* تصویر محصول و نام */
.widget_shopping_cart .product-thumbnail img {
    width: 60px;
    border-radius: 4px;
    border: 1px solid #cccccc;
    margin-bottom: 5px;
}
.widget_shopping_cart .elementor-menu-cart__product .product-name {
    font-weight: 500;
    margin-bottom: 5px;
}

/* تعداد و قیمت کنار هم */
.widget_shopping_cart .product-quantity,
.widget_shopping_cart .product-price {
    display: inline-block;
    font-weight: 500;
}
.widget_shopping_cart .product-quantity {
    margin-right: 10px;
}

/* جمع کل */
.widget_shopping_cart .elementor-menu-cart__subtotal {
    background: #f7f7f7;
    border: 1px solid #cccccc;
    border-radius: 5px;
    padding: 1em;
    margin-top: 1.5em;
    font-weight: 500;
    color: #000;
}

/* دکمه‌های View Cart و Checkout */
.widget_shopping_cart .elementor-button--view-cart,
.widget_shopping_cart .elementor-button--checkout {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    margin-top: 10px;
    border-radius: 5px;
    font-weight: 500;
    transition: 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

/* دکمه مشاهده سبد خرید - سفید و متن مشکی */
.widget_shopping_cart .elementor-button--view-cart {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #cccccc !important;
}

/* دکمه پرداخت - تیره */
.widget_shopping_cart .elementor-button--checkout {
    background: #403f3e;
    color: #ffffff;
    border: 1px solid #403f3e;
}

/* افکت hover دکمه‌ها */
.widget_shopping_cart .elementor-button--view-cart:hover,
.widget_shopping_cart .elementor-button--checkout:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 0.95;
}

/* دکمه Close */
.widget_shopping_cart .elementor-menu-cart__close-button-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 5px;
    background: #f7f7f7;
    border: 1px solid #cccccc;
    font-weight: 500;
    color: #6B6B6B;
    font-size: 1.1rem;
    cursor: default;
}

/* Overflow برای محصولات */
.widget_shopping_cart .elementor-menu-cart__products {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 5px;
}

/* موبایل */
@media (max-width: 768px){
    .widget_shopping_cart {
        width: 95vw;
        padding: 10px;}
    .widget_shopping_cart .elementor-menu-cart__products {
        max-height: 48vh;
    }
    .widget_shopping_cart .product-thumbnail img {
        width: 48px;
    }
    .widget_shopping_cart .elementor-button--view-cart,
    .widget_shopping_cart .elementor-button--checkout {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    /* فاصله از سمت چپ فقط در موبایل */
    .widget_shopping_cart .elementor-menu-cart__product {
        margin-left: 10px;
    }
}
@media (max-width: 768px){
  .widget_shopping_cart .elementor-menu-cart__product {
      width: 100%;
      margin: 0 auto 10px;
      padding-left: 10px; /* 👈 فاصله از چپ */
    //*  padding-right: 10px; /* مطمئن بشیم راست و چپ یکسانه */
      text-align: right;  /* متن درست راست‌چین بمونه */
  }
}
@media (max-width: 768px){
  .widget_shopping_cart {
      width: 100vw;
	  padding-left: 70px;
      //*padding: 10px 15px; /* 👈 چپ و راست فاصله بیشتر */
      //*box-sizing: border-box; /* تا از کادر بیرون نزنه */
  }
}



/*استایل کد تخفیف صفحه پرداخت*/
.woocommerce-form-coupon {
    display: inline-flex !important;
}
.woocommerce-form-coupon-toggle {
  display: none;
}



/*  mini cartحذف پیام سبد خالی و اضافه کردن تصویر */
.widget_shopping_cart .woocommerce-mini-cart__empty-message {
    visibility: hidden !important;
    width: 100% !important;
    flex-grow: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
}

.widget_shopping_cart .woocommerce-mini-cart__empty-message:after {
    content: "" !important;
    position: absolute !important;
    visibility: visible !important;
    background-image: url("https://mahoragallery.ir/wp-content/uploads/2025/09/basket.webp") !important;
    background-size: 75% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    inset: 0 !important;
    opacity: 1 !important;
}

/* حذف پیام سبد خالی ووکامرس در صفحه سبد خرید و نمایش تصویر */
.woocommerce-cart .cart-empty {
    visibility: hidden !important;
    position: relative !important;
    min-height: 250px !important; /* ارتفاع برای جاگیری عکس */
}

.woocommerce-cart .cart-empty::after {
    content: "" !important;
    visibility: visible !important;
    position: absolute !important;
    inset: 0 !important;
    background-image: url("https://mahoragallery.ir/wp-content/uploads/2025/09/basket.webp") !important;
    background-size: 250px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    opacity: 1 !important;
}



/*
استال دکمه های فیلتر صفحه فروشگاه
 */
<style>
.custom-sorting-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* اضافه شده برای موبایل */
}

.custom-sorting-buttons .sorting-button {
    background-color: #ff096a;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    flex: 1; /* دکمه‌ها فضای مساوی دریافت می‌کنند */
    white-space: nowrap; /* از شکستن متن جلوگیری می‌کند */
}

.custom-sorting-buttons .sorting-button:hover {
    background-color: #ff096a;
}

.custom-sorting-buttons .sorting-button:active {
    background-color: #ff096a;
}

/* بهینه‌سازی برای موبایل */
@media (max-width: 768px) {
    .custom-sorting-buttons .sorting-button {
        font-size: 12px;
        padding: 8px 10px;
    }

    .custom-sorting-buttons {
        gap: 5px;
    }
}

</style>

/*استایل رایگان کردن قیمت ارسال+1م*/
.wc-shipping-free {
    color: #2a9d8f; /* رنگ دلخواه */
    font-weight: 700;
    margin-right: 6px;
}

/**/
/* مخفی کردن فرم کوپن که بالای صفحه قرار گرفته (سعی می‌کنیم سلکتور عمومی و ایمن باشه) */
.woocommerce-checkout > form.checkout_coupon,
.woocommerce-checkout form.checkout_coupon:not(.woocommerce-checkout-form-in-review) {
    display: none !important;
}

/* نمایش فرم کوپن داخل ویجت (اگر لازم شد کلاس اضافه کنید) */
.woocommerce #order_review form.checkout_coupon {
    display: block !important;
}

/**/
/* همه آیکون‌ها خاکستری و کم‌رنگ */
.wd-toolbar .wd-toolbar-icon img {
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s, opacity 0.3s;
}

/* آیکون فعال یا صفحه فعلی رنگی و روشن */
.wd-toolbar .wd-toolbar-link.active .wd-toolbar-icon img {
    filter: grayscale(0%);
    opacity: 1;
}


