* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --red: #e11d2e;
    --dark: #1a1a2e;
    --gray: #f5f6f8;
    --text: #333;
    --muted: #777;
    --green: #00a86b;
    --radius: 14px
}

body {
    font-family: 'IRANSans',Tahoma,sans-serif;
    background: #fff;
    color: var(--text);
    line-height: 1.8
}
@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: 900;
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Black.eot');
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Black.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    url('../assets/fonts/IRANSans/woff2/IRANSansWeb_Black.woff2') format('woff2'),
    /* FF39+,Chrome36+, Opera24+*/
    url('../assets/fonts/IRANSans/woff/IRANSansWeb_Black.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../assets/fonts/IRANSans/ttf/IRANSansWeb_Black.ttf') format('truetype');
}

@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: bold;
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Bold.eot');
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Bold.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    url('../assets/fonts/IRANSans/woff2/IRANSansWeb_Bold.woff2') format('woff2'),
    /* FF39+,Chrome36+, Opera24+*/
    url('../assets/fonts/IRANSans/woff/IRANSansWeb_Bold.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../assets/fonts/IRANSans/ttf/IRANSansWeb_Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: 500;
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Medium.eot');
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Medium.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    url('../assets/fonts/IRANSans/woff2/IRANSansWeb_Medium.woff2') format('woff2'),
    /* FF39+,Chrome36+, Opera24+*/
    url('../assets/fonts/IRANSans/woff/IRANSansWeb_Medium.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../assets/fonts/IRANSans/ttf/IRANSansWeb_Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: 300;
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Light.eot');
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_Light.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    url('../assets/fonts/IRANSans/woff2/IRANSansWeb_Light.woff2') format('woff2'),
    /* FF39+,Chrome36+, Opera24+*/
    url('../assets/fonts/IRANSans/woff/IRANSansWeb_Light.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../assets/fonts/IRANSans/ttf/IRANSansWeb_Light.ttf') format('truetype');
}

@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: 200;
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_UltraLight.eot');
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb_UltraLight.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    url('../assets/fonts/IRANSans/woff2/IRANSansWeb_UltraLight.woff2') format('woff2'),
    /* FF39+,Chrome36+, Opera24+*/
    url('../assets/fonts/IRANSans/woff/IRANSansWeb_UltraLight.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../assets/fonts/IRANSans/ttf/IRANSansWeb_UltraLight.ttf') format('truetype');
}

@font-face {
    font-family: 'IRANSans';
    font-style: normal;
    font-weight: normal;
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb.eot');
    src: url('../assets/fonts/IRANSans/eot/IRANSansWeb.eot?#iefix') format('embedded-opentype'),
    /* IE6-8 */
    url('../assets/fonts/IRANSans/woff2/IRANSansWeb.woff2') format('woff2'),
    /* FF39+,Chrome36+, Opera24+*/
    url('../assets/fonts/IRANSans/woff/IRANSansWeb.woff') format('woff'),
    /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
    url('../assets/fonts/IRANSans/ttf/IRANSansWeb.ttf') format('truetype');
}
@font-face {
    font-family: 'iransansweb';
    src: url('../assets/fonts/iransans/eot/iransansweb.eot') format('embedded-opentype');
}

a {
    text-decoration: none !important;
    border-bottom: none !important;
    color: inherit
}

.container {
    max-width: 1280px;
    margin: auto;
    padding: 0 16px
}

img {
    max-width: 100%;
    display: block
}
/* topbar */
.topbar {
    background: var(--dark);
    color: #ddd;
    font-size: 12.5px;
    padding: 7px 0
}

    .topbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px
    }

    .topbar span {
        margin-left: 18px
    }
/* header */
/* header — overflow باید visible بماند تا بج سبد بریده نشود (فیکس ایراد ۳) */
header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
    overflow: visible
}

.header-main {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
    overflow: visible
}

header .container {
    overflow: visible
}

.logo {
    font-size: 26px;
    font-weight: 900;
    color: var(--red);
    white-space: nowrap
}

    .logo b {
        color: var(--dark)
    }

.search {
    flex: 1;
    display: flex;
    background: var(--gray);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb
}

    .search input {
        flex: 1;
        border: 0;
        background: transparent;
        padding: 12px 16px;
        font-family: inherit;
        outline: none
    }

    .search button {
        background: var(--red);
        color: #fff;
        border: 0;
        padding: 0 26px;
        cursor: pointer;
        font-family: inherit
    }

.hactions {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 0
}

.btn {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    display: inline-block
}

    .btn.primary {
        background: var(--dark);
        color: #fff;
        border-color: var(--dark)
    }

    .btn.red {
        background: var(--green);
        color: #fff;
        border-color: var(--green)
    }

.blu {
    background: #1d85e1;
    color: #fff;
    border-color: #1dbce1;
}

.btn.cart {
    flex-shrink: 0
}

.cart {
    position: relative;
    overflow: visible
}

    .cart .count {
        position: absolute;
        top: -10px;
        left: -6px;
        background: var(--red);
        color: #fff;
        font-size: 11px;
        min-width: 20px;
        height: 20px;
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border: 2px solid #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,.25);
        z-index: 3
    }

nav.menu {
    border-top: 1px solid #f0f0f0;
    overflow: visible;
    position: relative;
    z-index: 150
}

    nav.menu ul.dmenu {
        display: flex;
        gap: 4px;
        list-style: none;
        padding: 0;
        margin: 0;
        font-size: 14px;
        overflow: visible;
        white-space: nowrap;
        align-items: stretch;
        flex-wrap: wrap
    }

        nav.menu ul.dmenu > li {
            position: relative;
            padding: 0
        }

            nav.menu ul.dmenu > li > a, nav.menu ul.dmenu > li.hot, nav.menu ul.dmenu > li > span {
                display: block;
                padding: 12px 14px
            }

            nav.menu ul.dmenu > li.has-sub > a::after {
                content: ""
            }

            nav.menu ul.dmenu > li.has-sub:hover {
                background: var(--gray);
                border-radius: 10px
            }

    nav.menu li.hot {
        color: var(--red);
        font-weight: 700
    }
/* --- منوی ۳ سطحی دسکتاپ (ایراد ۱) : هاور برای سطح ۲ و ۳ --- */
.dmenu .sub, .dmenu .sub2 {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    padding: 8px;
    z-index: 300;
    list-style: none;
    text-align: right
}

    .dmenu .sub::before {
        content: "";
        position: absolute;
        top: -10px;
        right: 30px;
        border: 5px solid transparent;
        border-bottom-color: #fff
    }

    .dmenu .sub li, .dmenu .sub2 li {
        position: relative;
        margin: 0;
        padding: 0
    }

    .dmenu .sub a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 13.5px;
        white-space: nowrap;
        color: var(--text)
    }

        .dmenu .sub a:hover {
            background: var(--gray);
            color: var(--red)
        }

.dmenu li.has-sub:hover > .sub {
    display: block
}
/* سطح ۳ : کنار سطح ۲ به سمت چپ باز شود */
.dmenu .sub .sub2 {
    top: 0;
    left: auto;
    right: 100%;
    margin-right: 8px;
    margin-left: 0
}
/* آخرین آیتم دارای زیرمنو (نزدیک لبه چپ صفحه): سطح ۳ به سمت داخل (راست) باز شود تا از صفحه بیرون نزند */
.dmenu > li:last-child .sub .sub2, .dmenu > li:nth-last-child(2) .sub .sub2 {
    left: 100%;
    right: auto;
    margin-left: 8px;
    margin-right: 0
}

.dmenu .sub li.has-sub > a::after {
    content: "◂";
    color: var(--muted);
    font-size: 12px
}

.dmenu .sub li.has-sub:hover > .sub2 {
    display: block
}
/* hero */
.hero {
    display: grid;
    grid-template-columns: 2.2fr;
    gap: 16px;
    margin: 18px 0
}

.slider {
    background: linear-gradient(135deg,#1a1a2e,#e11d2e);
    color: #fff;
    border-radius: 18px;
    padding: 44px 30px;
    position: relative;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: center
}

    .slider h1 {
        font-size: 32px;
        margin-bottom: 10px
    }

    .slider p {
        opacity: .9;
        margin-bottom: 18px
    }

    .slider .cta {
        background: #fff;
        color: var(--red);
        padding: 12px 28px;
        border-radius: 10px;
        font-weight: 700;
        display: inline-block
    }

.side-banners {
    display: flex;
    flex-direction: column;
    gap: 16px
}

    .side-banners div {
        border-radius: 18px;
        padding: 22px;
        color: #fff;
        flex: 1
    }

.sb1 {
    background: linear-gradient(135deg,#ff9a3c,#ff5e62)
}

.sb2 {
    background: linear-gradient(135deg,#0ea5e9,#6366f1)
}
/* sections */
.sec-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 16px
}

    .sec-title h2 {
        font-size: 20px
    }

    .sec-title a {
        color: var(--red);
        font-size: 13px
    }

.cats {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    gap: 12px;
    text-align: center
}

.cat {
    background: var(--gray);
    border-radius: 16px;
    padding: 18px 6px;
    font-size: 13px;
    transition: .2s;
    display: block
}

    .cat:hover {
        background: #ffe8eb;
        transform: translateY(-3px)
    }

    .cat i {
        font-size: 30px;
        display: block;
        margin-bottom: 8px;
        font-style: normal
    }
/* amazing */
.amazing {
    background: var(--red);
    border-radius: 18px;
    padding: 20px;
    color: #fff;
    margin: 10px 0
}

.amazing-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px
}

.timer {
    display: flex;
    gap: 8px;
    direction: ltr;
    align-items: center
}

    .timer span {
        background: #fff;
        color: var(--red);
        border-radius: 8px;
        padding: 4px 10px;
        font-weight: 800
    }

.products {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 14px
}

.card {
    background: #fff;
    color: var(--text);
    border-radius: 14px;
    padding: 12px;
    position: relative;
    transition: .2s;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column
}

    .card:hover {
        box-shadow: 0 8px 24px rgba(0,0,0,.1)
    }

    .card .off {
        position: absolute;
        top: 10px;
        right: 10px;
        background: var(--red);
        color: #fff;
        font-size: 12px;
        border-radius: 8px;
        padding: 2px 8px;
        z-index: 2
    }

    .card .pimg {
        height: 170px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f9fafb;
        border-radius: 10px;
        font-size: 70px;
        width: 100%
    }

    .card h3 {
        font-size: 13.5px;
        margin: 10px 0 6px;
        min-height: 48px
    }

        .card h3 a:hover {
            color: var(--red)
        }

.price {
    font-weight: 800;
    font-size: 15px
}

.old {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 12px
}

.add {
    width: 100%;
    margin-top: auto;
    background: var(--dark);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 9px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 10px
}

    .add:hover {
        background: var(--red)
    }
/* banners */
.banners {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px;
    margin: 22px 0
}

    .banners div {
        border-radius: 16px;
        padding: 26px 16px;
        color: #fff;
        text-align: center;
        font-weight: 700
    }

.grid2 {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px
}

.features {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 12px;
    margin: 26px 0;
    background: var(--gray);
    border-radius: 16px;
    padding: 18px;
    text-align: center;
    font-size: 13px
}
/* footer - سفید، چینش مطابق نمونه */
footer {
    background: #fff;
    color: var(--text);
    margin-top: 30px;
    padding: 36px 0 20px;
    border-top: 1px solid #eee;
    direction: rtl;
    text-align: right
}

    footer .cols {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 0.9fr 1.5fr;
        gap: 24px;
        align-items: start
    }

    footer h4 {
        color: var(--dark);
        margin-bottom: 12px;
        font-size: 15px;
        font-weight: 800
    }

    footer ul {
        list-style: none;
        font-size: 13.5px;
        margin: 0;
        padding: 0
    }

    footer li {
        margin-bottom: 8px
    }

    footer a {
        text-decoration: none !important;
        border-bottom: none !important;
        color: var(--text)
    }

        footer a:hover {
            color: #1d85e1
        }

.footer-contact li {
    margin-bottom: 10px
}

.footer-about {
    margin-top: 26px
}

    .footer-about h4 {
        font-size: 15px
    }

    .footer-about p {
        font-size: 13.5px;
        line-height: 2.1;
        color: #444
    }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px
}

.footer-trusts {
    display: flex;
    gap: 12px;
    align-items: center
}

    .footer-trusts img {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 10px;
        width: 80px;
        height: 80px;
        object-fit: contain;
        padding: 4px
    }

.copy {
    border-top: 1px solid #eee;
    margin-top: 18px;
    padding-top: 14px;
    font-size: 12px;
    text-align: center;
    color: var(--muted)
}
/* product page */
.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin: 16px 0
}

    .breadcrumb b {
        color: var(--text)
    }

.p-wrap {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 22px
}

.p-gallery {
    background: var(--gray);
    border-radius: 16px;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 130px;
    position: relative
}

    .p-gallery .off-big {
        position: absolute;
        top: 14px;
        right: 14px;
        background: var(--red);
        color: #fff;
        border-radius: 10px;
        padding: 4px 12px;
        font-size: 14px
    }

.p-info h1 {
    font-size: 22px;
    margin-bottom: 8px
}

.p-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px
}

.p-price-box {
    background: var(--gray);
    border-radius: 14px;
    padding: 16px;
    margin: 14px 0
}

    .p-price-box .new {
        font-size: 24px;
        font-weight: 900;
        color: var(--dark)
    }

.p-specs {
    font-size: 14px;
    margin: 12px 0;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 12px;
    padding: 12px 16px;
    list-style: none
}

    .p-specs li {
        margin-bottom: 6px
    }
/* نوار چسبان قیمت + خرید (فقط موبایل/تبلت، داخل Details.cshtml) */
.sticky-buy {
    display: none
}
/* در صفحه لندینگ/محصول چون قیمت پایین هست، منوی موبایل پایین لازم نیست (ایراد ۴) */
body:has(.sticky-buy) .mnav {
    display: none !important
}

body:has(.sticky-buy) {
    padding-bottom: 0
}

.qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0
}

    .qty button {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #ddd;
        background: #fff;
        font-size: 18px;
        cursor: pointer
    }

    .qty b {
        font-size: 18px;
        min-width: 30px;
        text-align: center
    }

.related {
    margin-bottom: 20px
}
/* cart */
.cart-wrap {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin: 18px 0 30px;
    align-items: start
}

.cart-item {
    display: flex;
    gap: 14px;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
    align-items: center
}

    .cart-item .thumb {
        width: 90px;
        height: 90px;
        background: var(--gray);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 44px;
        flex-shrink: 0
    }

    .cart-item h3 {
        font-size: 14px
    }

.cart-summary {
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 18px;
    position: sticky;
    top: 140px
}

    .cart-summary .row {
        display: flex;
        justify-content: space-between;
        font-size: 14px;
        margin-bottom: 10px
    }

    .cart-summary .total {
        font-size: 18px;
        font-weight: 900;
        border-top: 1px dashed #ddd;
        padding-top: 10px
    }

.coupon {
    display: flex;
    gap: 8px;
    margin: 12px 0
}

    .coupon input {
        flex: 1;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 10px;
        font-family: inherit
    }

.empty {
    text-align: center;
    padding: 50px 10px;
    border: 1px dashed #ddd;
    border-radius: 16px;
    color: var(--muted)
}
/* mobile nav */
.mnav {
    display: none;
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 8px;
    z-index: 99
}

    .mnav div {
        display: flex;
        justify-content: space-around;
        font-size: 12px;
        text-align: center
    }

.toast {
    position: fixed;
    bottom: 80px;
    right: 50%;
    transform: translateX(50%);
    background: var(--dark);
    color: #fff;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
    z-index: 200
}
/* hamburger + drawer 3-level (mobile/tablet) */
.hamburger {
    display: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    font-size: 20px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-shrink: 0
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0;
    visibility: hidden;
    transition: .25s;
    z-index: 120
}

    .drawer-overlay.show {
        opacity: 1;
        visibility: visible
    }

.drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100dvh;
    background: #fff;
    z-index: 130;
    transition: right .28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0,0,0,.15)
}

    .drawer.open {
        right: 0
    }

.drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #eee
}

.drawer-close {
    border: 0;
    background: var(--gray);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px
}

.drawer-search {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0
}

    .drawer-search input {
        width: 100%;
        border: 1px solid #e5e7eb;
        background: var(--gray);
        border-radius: 10px;
        padding: 10px 12px;
        font-family: inherit;
        outline: none
    }

.drawer ul {
    list-style: none
}

.lvl1 {
    overflow-y: auto;
    padding: 8px;
    flex: 1
}

    .lvl1 > li {
        border-bottom: 1px solid #f3f4f6
    }

    .lvl1 button {
        width: 100%;
        background: none;
        border: 0;
        font-family: inherit;
        font-size: 14.5px;
        padding: 12px 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        text-align: right
    }

        .lvl1 button:hover {
            color: var(--red)
        }

    .lvl1 a.single {
        display: block;
        padding: 12px 10px;
        font-size: 14.5px
    }

        .lvl1 a.single.hot {
            color: var(--red);
            font-weight: 700
        }

.lvl2, .lvl3 {
    display: none;
    background: #f9fafb;
    border-radius: 10px;
    margin: 0 6px 8px
}

li.open > .lvl2, li.open > .lvl3 {
    display: block
}

.lvl2 li, .lvl3 li {
    border-bottom: 1px solid #eef0f2
}

    .lvl2 li:last-child, .lvl3 li:last-child {
        border-bottom: 0
    }

.lvl2 button {
    font-size: 13.5px
}

.lvl3 a {
    display: block;
    padding: 10px 18px;
    font-size: 13px;
    color: #444
}

    .lvl3 a:hover {
        color: var(--red)
    }

.arr {
    transition: .2s;
    color: var(--muted)
}

li.open > button .arr {
    transform: rotate(180deg)
}

@media(max-width:1000px) {
    .hamburger {
        display: block
    }

    nav.menu {
        display: none
    }
    /* مشخصات محصول: افقی اسکرولی در موبایل/تبلت */
    .p-specs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 10px;
        scrollbar-width: thin
    }

        .p-specs li {
            flex: 0 0 auto;
            margin: 0;
            background: var(--gray);
            border: 1px solid #eee;
            border-radius: 20px;
            padding: 7px 14px;
            font-size: 13px;
            white-space: nowrap
        }
    /* نوار فیکس پایین صفحه محصول — چون mnav در این صفحه مخفی است به کف می‌چسبد (ایراد ۴) */
    .sticky-buy {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        bottom: 12px;
        right: 10px;
        left: 10px;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 16px;
        box-shadow: 0 -6px 24px rgba(0,0,0,.12);
        padding: 10px 14px;
        z-index: 110
    }

    .sticky-price {
        flex: 1;
        line-height: 1.5
    }

        .sticky-price .old {
            font-size: 12px
        }

        .sticky-price .new {
            font-size: 17px;
            font-weight: 900
        }

    .sticky-add {
        flex: 1.2;
        padding: 13px;
        font-size: 15px;
        font-weight: 700
    }
    /* فضای تنفسی تا نوار روی فوتر نیاید (فقط صفحاتی که نوار چسبان دارند — منوی پایین در این صفحات مخفی است) */
    body:has(.sticky-buy) {
        padding-bottom: 120px
    }

    .hero {
        grid-template-columns: 1fr
    }

    .products {
        grid-template-columns: repeat(3,1fr)
    }

    .cats {
        grid-template-columns: repeat(4,1fr)
    }

    .banners, .grid2 {
        grid-template-columns: repeat(2,1fr)
    }

    footer .cols {
        grid-template-columns: 1fr 1fr 1fr
    }

    .footer-contact {
        grid-column: 1/-1
    }

    .features {
        grid-template-columns: repeat(2,1fr)
    }

    .p-wrap, .cart-wrap {
        grid-template-columns: 1fr
    }

    .cart-summary {
        position: static
    }
}

@media(max-width:640px) {
    .search {
        flex: 1;
        min-width: 0
    }

        .search button {
            padding: 0 12px
        }

    .hactions {
        flex-shrink: 0
    }

        .hactions .btn.hide {
            display: none
        }

        .hactions .btn.cart {
            padding: 10px 14px
        }

    .header-main {
        flex-wrap: wrap;
        gap: 10px
    }

        .header-main .search {
            order: 3;
            flex-basis: 100%
        }

    .mnav {
        display: block
    }

    body {
        padding-bottom: 60px
    }

        body:has(.sticky-buy) {
            padding-bottom: 120px
        }

            body:has(.sticky-buy) .mnav {
                display: none !important
            }

    nav.menu ul.dmenu {
        font-size: 13px
    }

    .p-gallery {
        min-height: 260px;
        font-size: 90px
    }
    /* گرید دسته در انتهای فایل مدیریت می‌شود تا cascade به‌هم نریزد */
    .card {
        display: grid;
        grid-template-columns: 96px 1fr;
        gap: 2px 12px;
        align-items: center;
        padding: 10px
    }

        .card .pimg {
            grid-row: 1 / span 4;
            height: 96px;
            min-height: 96px;
            font-size: 46px
        }

        .card h3 {
            min-height: 0;
            margin: 0;
            font-size: 13px
        }

        .card .old {
            font-size: 11px
        }

        .card .price {
            font-size: 14.5px;
            white-space: nowrap
        }

        .card .add {
            grid-column: 2;
            margin-top: 6px;
            padding: 8px;
            font-size: 13px
        }

        .card .off {
            top: 6px;
            right: 6px
        }
}
/* ===== گالری محصول ===== */
.p-gallery-slider {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.g-main {
    background: var(--gray);
    border-radius: 16px;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 130px;
    position: relative
}

.g-slide {
    user-select: none
}

.g-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1
}

    .g-arrow.next {
        left: 12px
    }

    .g-arrow.prev {
        right: 12px
    }

.g-count {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 12px;
    border-radius: 8px;
    padding: 2px 10px
}

.g-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto
}

.g-thumb {
    min-width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--gray);
    font-size: 30px;
    cursor: pointer
}

    .g-thumb.active {
        border-color: var(--red)
    }
/* ===== تب‌های محصول ===== */
.tabs {
    margin: 22px 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 18px;
    padding: 18px
}

.tab-bar {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 14px;
    overflow-x: auto
}

.tab-btn {
    border: 0;
    background: var(--gray);
    border-radius: 10px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap
}

    .tab-btn.active {
        background: var(--dark);
        color: #fff
    }

.tab-panel {
    display: none
}

    .tab-panel.active {
        display: block
    }

.spec-group {
    margin: 14px 0 6px;
    font-size: 15px
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-bottom: 10px
}

    .spec-table td {
        border: 1px solid #eee;
        padding: 8px 12px
    }

    .spec-table .k {
        background: var(--gray);
        width: 35%;
        font-weight: 700
    }

.review {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px
}

.r-head {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13.5px;
    margin-bottom: 6px;
    flex-wrap: wrap
}

.stars {
    color: #f59e0b
}

.r-date {
    color: var(--muted);
    font-size: 12px;
    margin-right: auto
}

.review-ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 13.5px
}

.review-form {
    background: var(--gray);
    border-radius: 12px;
    padding: 14px;
    margin-top: 12px
}

.rf-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap
}

    .rf-row input, .rf-row select {
        flex: 1;
        border: 1px solid #ddd;
        border-radius: 10px;
        padding: 10px;
        font-family: inherit;
        min-width: 140px
    }

.review-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    font-family: inherit;
    margin-bottom: 8px
}
/* ===== صفحه دسته‌بندی ===== */
.cat-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 18px;
    margin: 14px 0 30px;
    align-items: start
}

.filters {
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 14px;
    position: sticky;
    top: 140px;
    background: #fff
}

.filter-toggle {
    display: none;
    width: 100%;
    border: 1px solid #ddd;
    background: var(--gray);
    border-radius: 10px;
    padding: 10px;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 10px
}

.f-group {
    margin-bottom: 16px
}

    .f-group h4 {
        font-size: 14px;
        margin-bottom: 8px
    }

.f-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    margin-bottom: 6px;
    cursor: pointer
}

.f-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 9px 12px;
    font-family: inherit
}

.cat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px
}

    .cat-head h2 {
        font-size: 19px
    }

    .cat-head small {
        color: var(--muted);
        font-size: 13px
    }

.sort-inline .f-input {
    width: auto;
    min-width: 170px
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px
}
/* اوررایدهای تبلت/موبایل دسته در انتهای فایل (بعد از همه) آمده — اینجا تکرار نمی‌شود */
/* ===== انتخاب رنگ دایره‌ای — صفحه لندینگ/محصول (ایراد ۶) ===== */
.color-box {
    margin: 12px 0
}

    .color-box h4 {
        font-size: 14px;
        margin-bottom: 8px
    }

.color-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center
}

.color-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    cursor: pointer;
    position: relative;
    transition: .15s;
    padding: 0
}

    .color-dot:hover {
        transform: scale(1.08)
    }

    .color-dot.selected {
        border-color: var(--red);
        box-shadow: 0 0 0 3px #ffd7db
    }

        .color-dot.selected::after {
            content: "✔";
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 15px;
            text-shadow: 0 1px 3px rgba(0,0,0,.7)
        }

.color-name {
    font-size: 13px;
    color: var(--muted)
}
/* ===== توضیحات زیر محصولات دسته (ایراد ۵) ===== */
.cat-desc {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 18px 0 26px;
    font-size: 13.5px;
    color: #444
}

    .cat-desc h3 {
        font-size: 16px;
        margin-bottom: 8px
    }

    .cat-desc p {
        margin-bottom: 8px
    }
/* ===== صفحه تسویه Checkout (ایراد ۷) ===== */
.co-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin: 14px 0 30px;
    align-items: start
}

    .co-layout > form, .co-layout > aside, .cat-main {
        min-width: 0
    }

.co-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px
}

    .co-card h3 {
        font-size: 16px;
        margin-bottom: 12px
    }

.co-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

    .co-grid .full {
        grid-column: 1/-1
    }

    .co-grid label {
        font-size: 13px;
        display: block;
        margin-bottom: 2px
    }

.co-card input[type=text], .co-card input[type=tel], .co-card textarea, .co-card select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box
}

.co-card textarea {
    resize: vertical
}

.co-card label.ship-opt, .co-card label.pay-opt {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: .15s;
    font-size: 14px
}

.ship-opt:hover, .pay-opt:hover {
    border-color: var(--red)
}

.ship-opt input, .pay-opt input {
    margin-top: 5px;
    flex-shrink: 0
}

.ship-opt b, .pay-opt b {
    font-size: 14px
}

.ship-opt small, .pay-opt small {
    display: block;
    font-size: 12.5px;
    color: var(--muted)
}

.ship-opt .p {
    margin-right: auto;
    font-weight: 800;
    white-space: nowrap
}

.co-items .co-item {
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0
}

    .co-items .co-item:last-child {
        border-bottom: 0
    }

.co-thumb {
    width: 56px;
    height: 56px;
    background: var(--gray);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0
}

.co-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px
}

    .co-total-row.grand {
        font-size: 17px;
        font-weight: 900;
        border-top: 1px dashed #ddd;
        padding-top: 10px
    }

.co-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin: 20px 0
}

.co-side {
    position: sticky;
    top: 140px
}
/* ترتیب cascade مهم است: اوررایدهای ریسپانسیو همیشه آخر فایل باشند تا گرید دسته (۴ستونه) را در موبایل به ۱ستون برگردانند (ایراد ۲) */
@media(max-width:1000px) {
    .co-layout {
        grid-template-columns: 1fr
    }

    .co-side {
        position: static
    }

    .cat-layout {
        grid-template-columns: 1fr
    }

    .filters {
        position: static
    }

    .filter-toggle {
        display: block
    }

    .filter-body {
        display: none
    }

    .filters.open .filter-body {
        display: block
    }

    .products.cat-grid {
        grid-template-columns: repeat(3,1fr)
    }

    .g-main {
        min-height: 280px;
        font-size: 95px
    }
}

@media(max-width:640px) {
    .co-grid {
        grid-template-columns: 1fr
    }

    .co-card {
        padding: 14px
    }
    /* دسته و خانه در موبایل: تک‌ستون، کارت‌ها ردیفی و زیر هم — دقیقاً یکسان (ایراد ۲) */
    .products, .products.cat-grid, .cat-main .products {
        grid-template-columns: 1fr
    }
}
/* منوی اکانت کاربری */
.account-wrap {
    position: relative;
    overflow: visible
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 200px
}

.account-icon {
    font-size: 18px
}

.account-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700
}

.account-arrow {
    font-size: 12px;
    color: var(--muted);
    transition: .2s
}

.account-btn.open .account-arrow {
    transform: rotate(180deg)
}

.account-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    padding: 8px;
    z-index: 400
}

    .account-menu.show {
        display: block;
        animation: fadeDown .18s ease
    }

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-6px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.account-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 24px;
    border: 5px solid transparent;
    border-bottom-color: #fff
}

.am-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    white-space: nowrap
}

    .am-item:hover {
        background: var(--gray);
        color: var(--red)
    }

    .am-item.logout {
        color: var(--red);
        border-top: 1px solid #f0f0f0;
        margin-top: 4px;
        border-radius: 0 0 10px 10px
    }
/* فیکس موبایل: باکس اکانت کامل دیده شود */
@media(max-width:640px) {
    .header-main {
        position: relative
    }

    .account-wrap {
        position: static
    }

    .account-menu {
        position: absolute;
        top: 100%;
        left: 16px !important;
        right: 16px !important;
        min-width: 0;
        width: auto;
    }

        .account-menu::before {
            display: none
        }

    .account-btn {
        max-width: 150px;
        padding: 8px 12px
    }

    .account-name {
        max-width: 70px
    }
}
/* ===== پاپ‌آپ جستجو (هماهنگ با shop.css) ===== */
.search-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column
}

.search {
    width: 100%
}

.search-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    z-index: 400;
    max-height: 380px;
    overflow-y: auto;
    padding: 6px 0
}

    .search-popup::before {
        content: "";
        position: absolute;
        top: -10px;
        right: 30px;
        border: 5px solid transparent;
        border-bottom-color: #fff
    }

.sp-sec {
    padding: 6px 0
}

.sp-cat-sec {
    border-top: 1px solid #ffeaee
}

.sp-head {
    padding: 8px 14px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.sp-title {
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0
}

.sp-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto
}

.sp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid #f5f6f8;
    transition: .15s
}

    .sp-item:hover {
        background: var(--gray)
    }

    .sp-item:last-child {
        border-bottom: 0
    }

.sp-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: var(--gray);
    border-radius: 10px;
    flex-shrink: 0
}

.sp-name {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.sp-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 14px 12px;
    scrollbar-width: thin
}

.sp-chip {
    flex: 0 0 auto;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    white-space: nowrap;
    background: #fff
}

    .sp-chip:hover {
        background: var(--gray);
        color: var(--red);
        border-color: #ffd7db
    }

.sp-empty {
    text-align: center;
    padding: 24px;
    color: var(--muted);
    font-size: 14px
}

.search-wrap {
    position: relative;
}

#searchResult {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1000;
}

@media(max-width:640px) {
    .search-wrap {
        order: 3;
        flex-basis: 100%
    }

    .search-popup {
        max-height: 60vh
    }
}

.search-wrap {
    position: relative;
}

.search {
    position: relative;
}

#clearBtn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

#searchResult {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1000;
}

    #searchResult .close-btn {
        position: absolute;
        left: 8px;
        top: 8px;
        border: none;
        background: #eee;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        cursor: pointer;
    }
/* فوتر موبایل: ۲ ستونه */
@media(max-width:640px) {
    footer .cols {
        grid-template-columns: 1fr 1fr
    }

    .footer-contact {
        grid-column: 1/-1
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start
    }
}
