
/*
 * MishiLand Single Product Safe Fix v1.7.3
 * فقط صفحه تکی محصول. صفحه اصلی، سبد خرید، فوتر و بقیه صفحات دست نمی‌خورند.
 */

body.single-product {
    background: #f7f4ef !important;
}

/* Outer product wrapper: remove the huge card feeling on mobile. */
body.single-product div.product {
    max-width: 1320px !important;
    margin-inline: auto !important;
}

/* Gallery should be compact and visually balanced. */
body.single-product .woocommerce-product-gallery,
body.single-product .product-images {
    background: #fff !important;
    border: 1px solid #ece6de !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(17,24,39,.05) !important;
}

body.single-product .woocommerce-product-gallery__wrapper,
body.single-product .product-image-wrap {
    min-height: 0 !important;
    height: auto !important;
    background: #fff !important;
}

body.single-product .woocommerce-product-gallery img,
body.single-product .product-image-wrap img {
    width: 100% !important;
    height: auto !important;
    max-height: 500px !important;
    object-fit: contain !important;
}

/* Product summary becomes a clean independent card instead of one huge blank block. */
body.single-product .summary.entry-summary,
body.single-product .product-summary-shadow {
    background: #fff !important;
    border: 1px solid #ece6de !important;
    border-radius: 20px !important;
    padding: 18px !important;
    box-shadow: 0 8px 24px rgba(17,24,39,.05) !important;
}

/* Title: much smaller and easier to scan. */
body.single-product .product_title,
body.single-product h1.product_title {
    margin: 0 0 12px !important;
    color: #171b23 !important;
    font-size: clamp(20px,2.1vw,30px) !important;
    line-height: 1.65 !important;
    font-weight: 850 !important;
    text-align: right !important;
}

/* Keep social/share tools compact. */
body.single-product .product-share,
body.single-product .wd-social-icons,
body.single-product .wd-social-icons.icons-design-default {
    margin-top: 10px !important;
}

body.single-product .wd-social-icons a {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 50% !important;
}

/* Hide quick-view-looking stray labels/buttons if WoodMart injects them inside product summary. */
body.single-product .summary.entry-summary .quick-view,
body.single-product .summary.entry-summary .wd-quick-view {
    display: none !important;
}

/* Tabs should not sit inside an oversized white slab. */
body.single-product .woocommerce-tabs,
body.single-product .wd-tabs {
    clear: both !important;
    background: #fff !important;
    border: 1px solid #ece6de !important;
    border-radius: 20px !important;
    padding: 14px !important;
    margin-top: 18px !important;
    box-shadow: 0 8px 24px rgba(17,24,39,.04) !important;
}

/* New recommendation rail */
body.single-product .ml-sp-reco {
    clear: both;
    margin: 22px auto 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid #ece6de;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(17,24,39,.05);
}

body.single-product .ml-sp-reco__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

body.single-product .ml-sp-reco__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #a46131;
    font-size: 10px;
    font-weight: 800;
}

body.single-product .ml-sp-reco__head h2 {
    margin: 0 !important;
    color: #171b23 !important;
    font-size: 17px !important;
    line-height: 1.5 !important;
    font-weight: 900 !important;
}

body.single-product .ml-sp-reco__hint {
    color: #8b8f97;
    font-size: 10px;
    white-space: nowrap;
}

body.single-product .ml-sp-reco__rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 3px;
}

body.single-product .ml-sp-reco__rail::-webkit-scrollbar {
    display: none;
}

body.single-product .ml-sp-reco__card {
    flex: 0 0 165px;
    min-width: 165px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    padding: 8px;
    color: #171b23 !important;
    text-decoration: none !important;
    background: #fff;
    border: 1px solid #eee7df;
    border-radius: 15px;
}

body.single-product .ml-sp-reco__image {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    background: #faf8f5;
    border-radius: 12px;
    overflow: hidden;
}

body.single-product .ml-sp-reco__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.single-product .ml-sp-reco__name {
    min-height: 38px;
    margin-top: 7px;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.7;
    color: #252a32;
}

body.single-product .ml-sp-reco__price {
    margin-top: auto;
    padding-top: 5px;
    color: #9f5e30;
    font-size: 10.5px;
    font-weight: 900;
}

body.single-product .ml-sp-reco__view {
    margin-top: 7px;
    min-height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f4ece3;
    color: #8f572d;
    font-size: 9.5px;
    font-weight: 800;
}

/* Avoid duplicate giant standard related rail after our custom recommendations. */
body.single-product .related.products,
body.single-product .upsells.products {
    margin-top: 18px !important;
}

@media (max-width: 767px) {
    body.single-product .main-page-wrapper,
    body.single-product .site-content {
        padding-bottom: 88px !important;
    }

    body.single-product div.product {
        padding: 8px !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.single-product .product-image-summary-wrap,
    body.single-product .single-product-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    body.single-product .woocommerce-product-gallery,
    body.single-product .product-images {
        margin-bottom: 10px !important;
        border-radius: 16px !important;
    }

    body.single-product .woocommerce-product-gallery img,
    body.single-product .product-image-wrap img {
        max-height: 340px !important;
    }

    body.single-product .summary.entry-summary,
    body.single-product .product-summary-shadow {
        margin: 0 0 10px !important;
        padding: 13px !important;
        border-radius: 16px !important;
    }

    body.single-product .product_title,
    body.single-product h1.product_title {
        margin-top: 0 !important;
        font-size: 17px !important;
        line-height: 1.7 !important;
        text-align: right !important;
    }

    body.single-product .woocommerce-tabs,
    body.single-product .wd-tabs {
        margin: 10px 8px 0 !important;
        padding: 11px !important;
        border-radius: 16px !important;
    }

    body.single-product .ml-sp-reco {
        margin: 12px 8px 10px !important;
        padding: 12px !important;
        border-radius: 16px !important;
    }

    body.single-product .ml-sp-reco__head {
        align-items: center;
    }

    body.single-product .ml-sp-reco__hint {
        display: none;
    }

    body.single-product .ml-sp-reco__head h2 {
        font-size: 15px !important;
    }

    body.single-product .ml-sp-reco__card {
        flex-basis: 140px;
        min-width: 140px;
        padding: 7px;
    }

    body.single-product .ml-sp-reco__name {
        font-size: 10px;
    }

    /* Keep the floating smart assistant above the bottom nav but away from product title/share area. */
    body.single-product .msa-launcher {
        bottom: 84px !important;
    }
}


/* v1.7.3 — stronger mobile square gallery fix */
@media (max-width: 767px) {
    /* ناحیه تصویر روی موبایل مربعی و جمع‌وجور شود */
    body.single-product .woocommerce-product-gallery,
    body.single-product .product-images {
        padding: 12px !important;
    }

    body.single-product .woocommerce-product-gallery__wrapper,
    body.single-product .product-images .owl-stage-outer,
    body.single-product .product-images .slick-list,
    body.single-product .product-images .swiper-wrapper,
    body.single-product .wd-carousel-wrap {
        overflow: visible !important;
        min-height: 0 !important;
        height: auto !important;
    }

    /* هر تصویر اصلی داخل یک قاب مربعی نمایش داده شود */
    body.single-product .woocommerce-product-gallery__image > a,
    body.single-product .woocommerce-product-gallery__image > div,
    body.single-product .product-image-wrap > a,
    body.single-product .product-image-link,
    body.single-product .product-images .owl-item a,
    body.single-product .product-images .swiper-slide a,
    body.single-product .product-images .slick-slide a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: min(100%, 320px) !important;
        height: min(100vw - 86px, 320px) !important;
        margin: 0 auto !important;
        aspect-ratio: 1 / 1 !important;
        background: #faf8f5 !important;
        border: 1px solid #eee7df !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.single-product .woocommerce-product-gallery__image img,
    body.single-product .product-image-wrap img,
    body.single-product .product-images .owl-item img,
    body.single-product .product-images .swiper-slide img,
    body.single-product .product-images .slick-slide img {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
        padding: 12px !important;
    }

    /* نوار بندانگشتی مزاحم سمت چپ/کنار روی موبایل مخفی شود تا فضای خالی ایجاد نکند */
    body.single-product .flex-control-thumbs,
    body.single-product .wd-product-thumbs,
    body.single-product .product-thumbnails,
    body.single-product .thumbnails,
    body.single-product .wd-nav-product-images,
    body.single-product .product-images .owl-nav,
    body.single-product .product-images .slick-dots {
        display: none !important;
    }

    /* باکس متن محصول جمع‌وجورتر */
    body.single-product .summary.entry-summary,
    body.single-product .product-summary-shadow {
        padding: 12px !important;
    }

    body.single-product .summary.entry-summary .woocommerce-product-details__short-description,
    body.single-product .summary.entry-summary .short-description,
    body.single-product .summary.entry-summary p {
        font-size: 13px !important;
        line-height: 2 !important;
    }

    /* ابزار مشاوره خرید از روی اشتراک‌گذاری نپرد */
    body.single-product .msa-launcher {
        bottom: 96px !important;
        left: 12px !important;
    }
}


/* v1.7.4 — موبایل: تصویر اصلی تمام عرض قاب گالری را بگیرد */
@media (max-width: 767px) {

    /* خود گالری دیگر قاب بزرگ تو در تو نسازد */
    body.single-product .woocommerce-product-gallery,
    body.single-product .product-images {
        width: 100% !important;
        max-width: none !important;
        padding: 8px !important;
        margin: 0 0 10px !important;
        border-radius: 18px !important;
        box-sizing: border-box !important;
    }

    /* اسلاید اصلی حتماً 100 درصد عرض داشته باشد */
    body.single-product .woocommerce-product-gallery__wrapper,
    body.single-product .woocommerce-product-gallery__image,
    body.single-product .product-image-wrap,
    body.single-product .product-images .owl-item,
    body.single-product .product-images .swiper-slide,
    body.single-product .product-images .slick-slide {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 100% !important;
        box-sizing: border-box !important;
    }

    /* قاب خود عکس تقریباً کل عرض موبایل */
    body.single-product .woocommerce-product-gallery__image > a,
    body.single-product .woocommerce-product-gallery__image > div,
    body.single-product .product-image-wrap > a,
    body.single-product .product-image-link,
    body.single-product .product-images .owl-item a,
    body.single-product .product-images .swiper-slide a,
    body.single-product .product-images .slick-slide a {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        aspect-ratio: 1 / 1 !important;
        margin: 0 !important;
        padding: 8px !important;
        border-radius: 16px !important;
        box-sizing: border-box !important;
        background: #faf8f5 !important;
    }

    /* خود تصویر بزرگ‌تر و نزدیک‌تر به لبه‌های قاب */
    body.single-product .woocommerce-product-gallery__image img,
    body.single-product .product-image-wrap img,
    body.single-product .product-images .owl-item img,
    body.single-product .product-images .swiper-slide img,
    body.single-product .product-images .slick-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 4px !important;
        object-fit: contain !important;
        object-position: center center !important;
        box-sizing: border-box !important;
    }

    /* اگر WoodMart ستون فرعی برای بندانگشتی‌ها رزرو کرده باشد، حذف شود */
    body.single-product .product-images-inner,
    body.single-product .woocommerce-product-gallery__wrapper,
    body.single-product .wd-carousel-inner {
        grid-template-columns: 1fr !important;
        column-gap: 0 !important;
    }

    body.single-product .product-images .owl-stage,
    body.single-product .product-images .swiper-wrapper,
    body.single-product .product-images .slick-track {
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* v1.8.0 — mobile gallery hard fix: remove empty thumbnail column and let main image fill the card */
@media (max-width: 767px) {
    /* محصول در موبایل حتما تک‌ستونه شود */
    body.single-product div.product,
    body.single-product .product-image-summary-wrap,
    body.single-product .single-product-content,
    body.single-product .product-images,
    body.single-product .woocommerce-product-gallery,
    body.single-product .product-images-inner,
    body.single-product .wd-product-detail,
    body.single-product .wd-product-gallery,
    body.single-product .images,
    body.single-product .summary {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: block !important;
        flex: none !important;
        grid-template-columns: 1fr !important;
        box-sizing: border-box !important;
    }

    /* هرگونه ستون/ناحیه بندانگشتی که فضا رزرو کرده را حذف کن */
    body.single-product .woocommerce-product-gallery__thumbnails,
    body.single-product .flex-control-thumbs,
    body.single-product .product-thumbnails,
    body.single-product .wd-product-thumbs,
    body.single-product .wd-thumbnails,
    body.single-product .thumbnails,
    body.single-product .thumbs-position-left .product-thumbnails,
    body.single-product .thumbs-position-left .wd-product-thumbs,
    body.single-product .product-images .thumbnails,
    body.single-product .product-images .wd-product-thumbs {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    /* ردیف/ستون داخلی گالری کامل تک‌ستونه */
    body.single-product .woocommerce-product-gallery,
    body.single-product .product-images {
        padding: 12px !important;
        overflow: hidden !important;
    }

    body.single-product .woocommerce-product-gallery > *,
    body.single-product .product-images > *,
    body.single-product .product-images-inner > *,
    body.single-product .wd-product-gallery > *,
    body.single-product .images > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex: 0 0 100% !important;
        box-sizing: border-box !important;
    }

    body.single-product .woocommerce-product-gallery__wrapper,
    body.single-product .wd-carousel-inner,
    body.single-product .owl-stage-outer,
    body.single-product .owl-stage,
    body.single-product .slick-list,
    body.single-product .slick-track,
    body.single-product .swiper,
    body.single-product .swiper-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    body.single-product .woocommerce-product-gallery__image,
    body.single-product .product-image-wrap,
    body.single-product .owl-item,
    body.single-product .slick-slide,
    body.single-product .swiper-slide {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* قاب تصویر اصلی کل عرض کارت را بگیرد */
    body.single-product .woocommerce-product-gallery__image > a,
    body.single-product .woocommerce-product-gallery__image > div,
    body.single-product .product-image-wrap > a,
    body.single-product .product-image-link,
    body.single-product .owl-item > a,
    body.single-product .slick-slide > a,
    body.single-product .swiper-slide > a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 10px !important;
        background: #faf8f5 !important;
        border: 1px solid #eee7df !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.single-product .woocommerce-product-gallery__image img,
    body.single-product .product-image-wrap img,
    body.single-product .owl-item img,
    body.single-product .slick-slide img,
    body.single-product .swiper-slide img {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center center !important;
        margin: 0 !important;
        padding: 4px !important;
        box-sizing: border-box !important;
    }

    /* آیکن بزرگنمایی داخل قاب بماند */
    body.single-product .woocommerce-product-gallery__trigger,
    body.single-product .wd-gallery-btn,
    body.single-product .open-product-gallery {
        right: 12px !important;
        bottom: 12px !important;
        left: auto !important;
        top: auto !important;
        z-index: 4 !important;
    }
}
