/*
 Theme Name: Woodmart Child
 Theme URI:
 Description:
 Author:
 Template: woodmart
 Version: 1.0.0
*/

/* =========================================================
   A - Sticky Add To Cart + Price + Features (Mobile Only)
   ========================================================= */
@media (max-width: 767px) {

    /* کانتینر اصلی فرم */
    #main-cart-widget form.cart {
        position: fixed;
        bottom: 55px;
        left: 0;
        right: 0;
        background: #fff;
        padding: 8px 10px !important;
        z-index: 99;
        box-shadow: 0 -3px 15px rgba(0,0,0,0.1);
        display: flex !important;
        flex-direction: column !important;
    }

    /* ردیف اصلی */
    .wd-sticky-bottom-row {
        display: flex !important;
        flex-direction: row-reverse !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        gap: 8px !important;
    }

    /* ۱. تعداد (سمت راست) */
    #main-cart-widget .quantity {
        display: flex !important;
        flex: 0 0 85px !important;
        margin: 0 !important;
    }

    #main-cart-widget .quantity input[type="button"],
    #main-cart-widget .quantity input[type="number"] {
        height: 40px !important;
        border-radius: 4px !important;
    }

    /* ۲. دکمه افزودن (وسط) */
#main-cart-widget .single_add_to_cart_button {
    flex: 1 1 0 !important;       /* جلو جلوگیری از بزرگ شدن اضافی */
    min-width: 0 !important;      /* برداشتن حداقل ثابت 120px */
    max-width: 100% !important;   /* جلوگیری از خروج از ستون وسط */

    height: 44px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;   /* در صورت طولانی شدن، داخل بماند */
    text-overflow: ellipsis !important;
    border-radius: 6px !important;
}


    /* ۳. قیمت (سمت چپ) */
    .wd-sticky-price {
        flex: 0 0 110px !important;
        font-size: 15px !important;
        font-weight: bold;
        text-align: left;
        white-space: normal !important;
    }

    /* قیمت قبل و بعد زیر هم */
    .wd-sticky-price .price {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .wd-sticky-price del {
        font-size: 12px;
        color: #888;
    }

    .wd-sticky-price ins {
        font-size: 15px;
        text-decoration: none;
        color: #ef394e;
    }
    
    /* مخفی کردن المان‌های اضافه */
/*#main-cart-widget .variations,
/*#main-cart-widget .wd-single-add-cart .single_variation_wrap,
/*#main-cart-widget .woocommerce-variation-description {
/*    display: none !important;
/*}

    /* فاصله پایین صفحه */
    body {
        padding-bottom: 140px !important;
    }
}

/* =========================================================
   B - Hide FBT Prices and Totals (Mobile)
   ========================================================= */
@media (max-width: 767px) {
    .woobt-summary,
    .woobt-additional,
    .woobt-total {
        display: none !important;
    }

    .woobt-summary *,
    .woobt-additional *,
    .woobt-total * {
        display: none !important;
    }
}

/* =========================================================
   C - Pagination Design for FBT Slick Carousel (Mobile + Desktop) 
   ========================================================= */
    /* یکنواخت کردن ابعاد li */
    .woobt-products .slick-dots li {
        width: 28px !important;
        height: 28px !important;
        margin: 0 4px !important;
        padding: 0 !important;
        line-height: 0 !important; /* اصلاح اصلی */
    }

    /* تبدیل دکمه به یک دایره */
    .woobt-products .slick-dots li button {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;   /* جلوگیری از بیضی شدن */
        min-height: 0 !important;  /* جلوگیری از کشیدگی */
        border-radius: 50% !important;
        position: relative !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        background: #e5e5e5 !important; /* رنگ نقطه غیرفعال */
    }

    /* نقطه فعال */
    .woobt-products .slick-dots li.slick-active button {
        background: #16417C !important; 
    }

    /* جلوگیری از مداخله BEFORE وودمارت */
    .woobt-products .slick-dots li button:before {
        display: none !important;
    }

    /* عدد (AFTER) */
    .woobt-products .slick-dots li button:after {
        content: counter(fbt-slide) !important;
        font-size: 13px !important;
        color: #fff !important;
        font-weight: bold !important;
        line-height: 1 !important;
    }

    /* عدد فعال */
    .woobt-products .slick-dots li.slick-active button:after {
        color: #fff !important;
    }

    /* شماره‌گذاری */
    .woobt-products .slick-dots {
        counter-reset: fbt-slide;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        margin-top: 14px !important;
    }

    .woobt-products .slick-dots li {
        counter-increment: fbt-slide;
    }
    
/* =========================================================
   D - Mobile FBT Variations → Two-Column Layout
   ========================================================= */
@media (max-width: 767px) {

    /* کانتینر اصلی variations → تبدیل به دو ستون */
    .woobt-product .variations {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    /* هر variation یک ستون */
    .woobt-product .variations .variation {
        width: 50% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px;
    }

    /* لیبل */
    .woobt-product .variations .variation .label label {
        font-size: 13px;
        font-weight: 600;
        color: #333;
        margin-bottom: 2px;
        text-align: right;
        line-height: 1.2;
    }

    /* Select ها */
    .woobt-product .variations .variation .value select {
        width: 100% !important;
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 8px;
        background: #fff;
        border: 1px solid #dcdcdc;
        box-sizing: border-box;
    }
}
/* =========================================================
   E - نمایش پیام انتخاب ویژگی های محصولات همراه در حالت موبایل
   ========================================================= */
@media (max-width: 767px){

    /* کانتینر باید فعال باشد تا وقتی پیام آمد دیده شود */
    .woobt-summary{
        display:block !important;
        height:auto !important;
        overflow:visible !important;
    }

    /* بخش های اضافی همچنان مخفی */
    .woobt-additional,
    .woobt-total{
        display:none !important;
    }

    .woobt-additional *,
    .woobt-total *{
        display:none !important;
    }

    /* حالت عادی: پیام مخفی */
    .woobt-summary .woobt-alert{
        display:none;
        margin-top:10px;
        padding:8px 10px;
        background:#fff3cd;
        border:1px solid #ffe58f;
        border-radius:6px;
    }

    /* فقط وقتی افزونه آن را فعال می‌کند نمایش بده */
    .woobt-summary .woobt-alert[style*="display: block"]{
        display:block !important;
    }

}

/* =========================================================
   F - Toast Style for woobt alert (Floating message)
   ========================================================= */

#woobt-toast{
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    bottom: 20px; /* اگر خواستی از بالا بیاید، این را حذف کن و top بده */
    z-index: 99999;
    background: #fff3cd;
    border: 1px solid #ffe58f;
    color: #333;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    min-width: 220px;
    max-width: 320px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s ease;
}

/* حالت فعال (Toast نمایش داده شود) */
#woobt-toast.active{
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* نسخه مخصوص موبایل */
@media (max-width: 767px){
    #woobt-toast{
        bottom: 25px;
        font-size: 13px;
    }
}

/* =========================================================
   G - مخفی کردن کامل پیام داخلی woobt برای جلوگیری از نمایش تکراری
   ========================================================= */

.woobt-summary .woobt-alert{
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}
