/* ==============================================================
   mobile.css — بازبینی کامل نمایش سایت در موبایل
   این فایل باید در <head> و بعد از همه‌ی CSSهای دیگه لود بشه
   ============================================================== */

/* ============================================================
   تبلت / دسکتاپ کوچک
   ============================================================ */
@media (max-width: 900px) {

    /* فوتر */
    .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 18px !important; }

    /* پنل ادمین */
    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 250px !important;
        height: 100vh !important;
        z-index: 200 !important;
        transform: translateX(100%) !important;
        transition: transform .3s ease !important;
        padding-top: 60px !important;
        overflow-y: auto;
        box-shadow: -8px 0 30px rgba(0,0,0,.35);
    }
    .admin-sidebar.open { transform: translateX(0) !important; }
    .admin-sidebar.open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: -1;
    }
    .admin-main { padding: 60px 14px 24px !important; width: 100%; }
}


/* ============================================================
   موبایل — پرکاربردترین بازه
   ============================================================ */
@media (max-width: 768px) {

    /* ---------- پایه ---------- */
    html, body { overflow-x: hidden !important; }
    body {
        font-size: 14px !important;
        -webkit-text-size-adjust: 100%;
        padding-bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    }
    .container { padding: 0 14px !important; }
    main.container { padding-top: 4px !important; padding-bottom: 30px !important; }

    /* ---------- هدر سایت (موبایل): [جستجو] — RexUP — [تم رنگ] ---------- */
    .site-header {
        padding: 8px 0 !important;
        overflow: hidden;
    }
    .site-header .container.row {
        position: relative;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: space-between;
        min-height: 42px;
    }

    /* همه چیز به جز جستجو، RexUP و دکمه تم مخفی می‌شه */
    .site-header .logo,
    .site-header .main-nav,
    .site-header > .container.row > .search-box,
    .hamburger-btn,
    .header-icons .icon-btn {
        display: none !important;
    }

    /* لوگوی وسط */
    .m-brand {
        display: flex !important;
        align-items: center;
        gap: 4px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        direction: ltr;
        text-decoration: none;
        font-family: "Vazirmatn", "Poppins", sans-serif;
        font-weight: 800;
        font-size: 24px;
        letter-spacing: .5px;
        line-height: 1;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }
    .m-brand__rex { color: var(--text-main); }
    .m-brand__up {
        background: linear-gradient(110deg, #5cc9ff 0%, #2f6bff 40%, #8b5cf6 60%, #5cc9ff 100%);
        background-size: 220% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
        animation: mbrandShine 4s linear infinite;
    }
    .m-brand > i {
        font-size: 13px;
        margin-left: 1px;
        background: linear-gradient(180deg, #5cc9ff, #2f6bff);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: mbrandUp 1.8s ease-in-out infinite;
    }
    [data-theme="dark"] .m-brand { filter: drop-shadow(0 0 10px rgba(47, 168, 255, .45)); }

    /* دکمه جستجو (سمت راست) */
    .m-search-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 38px !important;
        height: 38px !important;
        font-size: 15px !important;
        border: none;
        padding: 0;
        flex-shrink: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .m-search-btn.open { color: var(--accent); }

    /* دکمه تم (سمت چپ) */
    .header-icons {
        margin-inline-start: auto !important;
        gap: 5px !important;
    }

    /* سوییچ روز/شب */
    .dnt-switch {
        width: 50px !important;
        height: 26px !important;
    }
    .dnt-knob {
        width: 20px !important;
        height: 20px !important;
        top: 3px !important;
        left: 3px !important;
    }
    .dnt-switch.on .dnt-knob { left: 27px !important; }
    .dnt-moon, .dnt-sun {
        width: 11px !important;
        height: 11px !important;
        font-size: 10px !important;
    }
    .dnt-moon { left: 14% !important; }
    .dnt-sun { right: 14% !important; }

    /* پنل جستجو: با دکمه ذره‌بین باز و بسته می‌شه */
    .mobile-drawer {
        display: block !important;
        max-height: 0 !important;
        opacity: 0;
        overflow: hidden !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        transition: max-height .35s ease, opacity .3s ease;
    }
    .mobile-drawer.open { max-height: 70px !important; opacity: 1; }
    .mobile-drawer nav { display: none !important; }
    .mobile-drawer .search-box {
        display: block !important;
        max-width: none !important;
        margin: 8px 0 4px !important;
    }

    /* ---------- هیرو ---------- */
    .hero {
        padding: 26px 16px !important;
        margin: 14px 0 !important;
        border-radius: var(--radius-md) !important;
    }
    .hero h1 {
        font-size: 14px !important;
        line-height: 2 !important;
        margin-bottom: 8px !important;
    }
    .hero p {
        font-size: 12px !important;
        line-height: 1.8 !important;
        margin-bottom: 16px !important;
    }
    .hero .btn {
        width: 100% !important;
        padding: 12px 18px !important;
        font-size: 13px !important;
    }

    /* ---------- تیتر بخش‌ها ---------- */
    .section-title { margin: 22px 0 12px !important; }
    .section-title h2 { font-size: 15px !important; }
    .section-title a { font-size: 12px !important; }

    /* ---------- گرید محصولات ---------- */
    .product-grid {
        gap: 10px !important;
    }
    .product-grid:not(.scroll-row) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .product-grid:not(.scroll-row) .product-card .info {
        padding: 10px !important;
    }
    .product-grid:not(.scroll-row) .product-card .pc-title {
        font-size: 12px !important;
        min-height: 32px !important;
        margin-bottom: 6px !important;
        line-height: 1.5 !important;
    }
    .product-grid:not(.scroll-row) .product-card .price-now {
        font-size: 12.5px !important;
    }
    .product-grid:not(.scroll-row) .product-card .price-old {
        font-size: 10px !important;
    }
    .product-grid:not(.scroll-row) .product-card .badge {
        font-size: 9px !important;
        padding: 2px 7px !important;
    }

    /* دکمه افزودن به سبد داخل کارت محصول */
    .product-grid:not(.scroll-row) .atc-btn.atc-btn-sm {
        padding: 8px 6px !important;
        min-width: 0 !important;
        width: 100% !important;
        border-radius: 8px !important;
    }
    .product-grid:not(.scroll-row) .atc-label {
        padding-right: 0 !important;
        margin-right: 0 !important;
        font-size: 11px !important;
        line-height: 20px !important;
    }
    .product-grid .atc-btn.atc-btn-sm .atc-label::before,
    .product-grid .atc-btn.atc-btn-sm .atc-label::after { display: none !important; }

    /* دکمه قلب روی کارت محصول */
    .wishlist-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
        top: 8px !important;
        left: 8px !important;
    }

    /* ---------- گرید دسته‌بندی ---------- */
    .category-grid:not(.scroll-row) {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .category-card { padding: 14px 6px !important; }
    .category-card i { font-size: 18px !important; margin-bottom: 6px !important; }
    .category-card span { font-size: 11px !important; }

    /* ---------- صفحه لیست محصولات ---------- */
    .filters-layout {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .filters-panel {
        padding: 16px !important;
    }
    .filters-panel h4 { font-size: 13px !important; margin-bottom: 8px !important; }
    .filters-panel label { font-size: 12.5px !important; margin-bottom: 6px !important; }

    /* sort dropdown بالای گرید */
    .filters-layout > div > div[style*="justify-content:flex-end"] {
        margin-bottom: 12px !important;
    }
    .filters-layout select[name="sort"] {
        width: 100% !important;
        font-size: 12.5px !important;
        padding: 9px !important;
    }

    /* pagination */
    .filters-layout > div > div[style*="justify-content:center"] {
        gap: 5px !important;
        margin-top: 22px !important;
        flex-wrap: wrap;
    }
    .filters-layout .btn { padding: 8px 12px !important; font-size: 12px !important; }

    /* ---------- صفحه جزئیات محصول ---------- */
    .product-detail {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        margin: 14px 0 !important;
    }
    .product-info h1 {
        font-size: 17px !important;
        line-height: 1.6 !important;
    }
    .product-info .badge { font-size: 10px !important; }
    .product-info .price-row {
        font-size: 16px !important;
        margin: 12px 0 !important;
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .product-info .price-now { font-size: 18px !important; }
    .product-info .price-old { font-size: 12px !important; }
    .product-info p {
        font-size: 12.5px !important;
        line-height: 1.85 !important;
    }

    .gallery-main img {
        border-radius: var(--radius-sm) !important;
    }
    .gallery-thumbs {
        gap: 6px !important;
        margin-top: 8px !important;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .gallery-thumbs img {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0;
    }

    .qty-select {
        margin: 14px 0 !important;
        gap: 8px !important;
        flex-wrap: wrap;
        font-size: 13px !important;
    }
    .qty-select input[type="number"] { width: 60px !important; }

    .tabs {
        gap: 14px !important;
        margin: 20px 0 12px !important;
        overflow-x: auto;
        white-space: nowrap;
    }
    .tabs .tab {
        font-size: 12.5px !important;
        flex-shrink: 0;
    }

    /* دکمه افزودن به سبد در صفحه محصول */
    .product-info .atc-btn {
        min-width: 0 !important;
        padding: 11px 14px !important;
        font-size: 13px !important;
    }
    .product-info .atc-label { font-size: 13px !important; padding-right: 20px !important; }
    .wishlist-btn-detail {
        min-width: 46px;
        padding: 10px !important;
    }

    /* ---------- سبد خرید — تبدیل جدول به کارت ---------- */
    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block !important;
        width: 100% !important;
    }
    .cart-table { border-spacing: 0 !important; }
    .cart-table tr {
        background: var(--surface) !important;
        border-radius: var(--radius-md) !important;
        padding: 14px !important;
        margin-bottom: 12px !important;
        box-shadow: var(--shadow-raised-sm) !important;
        position: relative;
    }
    .cart-table td {
        background: none !important;
        box-shadow: none !important;
        padding: 4px 0 !important;
        border-radius: 0 !important;
        text-align: right !important;
        font-size: 13px !important;
    }
    .cart-table td:first-child {
        font-weight: 700 !important;
        font-size: 14px !important;
        padding-inline-end: 42px !important;
        margin-bottom: 4px;
        display: block !important;
    }
    .cart-table td:nth-child(2) {
        color: var(--text-muted) !important;
        font-size: 12.5px !important;
    }
    .cart-table td:nth-child(2)::before { content: "قیمت واحد: "; }
    .cart-table td:nth-child(3) form { display: inline-flex !important; }
    .cart-table td:nth-child(3) input[type="number"] {
        width: 70px !important;
        padding: 8px !important;
        font-size: 13px !important;
    }
    .cart-table td:nth-child(4) {
        font-weight: 700 !important;
        color: var(--accent) !important;
        font-size: 14px !important;
        margin-top: 4px;
    }
    .cart-table td:nth-child(4)::before {
        content: "جمع: ";
        color: var(--text-muted);
        font-weight: 400;
        font-size: 12.5px;
    }
    .cart-table td:last-child {
        position: absolute !important;
        top: 10px !important;
        left: 10px !important;
        width: auto !important;
        padding: 0 !important;
        display: block !important;
    }
    .cart-table td:last-child .btn {
        padding: 6px 9px !important;
        font-size: 12px !important;
    }

    .cart-summary {
        max-width: none !important;
        margin: 18px 0 0 !important;
        padding: 18px !important;
    }
    .cart-summary form[style*="margin-bottom:16px"] {
        flex-wrap: wrap !important;
    }
    .cart-summary input[name="coupon"] { font-size: 13px !important; }

    /* ---------- فرم‌ها ---------- */
    .form-card {
        max-width: none !important;
        margin: 16px auto !important;
        padding: 20px 16px !important;
    }
    .form-card h2 {
        font-size: 17px !important;
        margin-bottom: 16px !important;
    }
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .field { margin-bottom: 14px !important; }
    .field input,
    .field select,
    .field textarea {
        height: 44px !important;
        font-size: 13.5px !important;
    }
    .field textarea {
        min-height: 96px !important;
        height: auto !important;
        padding-top: 14px !important;
    }
    .field i { left: 14px !important; }

    .btn { font-size: 13px !important; padding: 11px 18px !important; }

    /* ---------- صفحه چک‌اوت ---------- */
    form > div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    form > div[style*="max-width:640px"] {
        max-width: none !important;
    }
    button.card {
        padding: 22px 14px !important;
    }

    /* خلاصه سفارش بالای چک‌اوت */
    .checkout-summary,
    div[style*="max-width:480px"] {
        max-width: none !important;
        margin: 0 0 18px !important;
        padding: 16px !important;
    }

    /* ---------- پنل کاربری (اکانت) ---------- */
    .account-tabs,
    div[style*="display:flex; gap:10px"] {
        gap: 8px !important;
    }
    .account-tabs .btn,
    div[style*="margin-bottom:24px"] .btn {
        padding: 9px 14px !important;
        font-size: 12.5px !important;
    }

    /* ---------- ورود / ثبت‌نام ---------- */
    /* دایره تقریباً هم‌عرض صفحه‌ی گوشی می‌شه تا فرم کامل داخلش جا بشه.
       (فقط موبایل — دسکتاپ هیچ تغییری نمی‌کنه) */
    .login-wrapper {
        min-height: auto !important;
        padding: 14px 0 40px !important;
    }
    .flip-scene {
        --d: min(96vw, 420px);
        width: var(--d) !important;
        height: var(--d) !important;
        perspective: 1400px !important;
    }
    .flip-card { width: 100% !important; height: 100% !important; }
    .glass-circle {
        width: var(--d) !important;
        height: var(--d) !important;
    }
    .glass-circle::before { inset: 10px !important; }
    .login-form {
        width: calc(var(--d) * .64) !important;
        max-width: none !important;
    }
    .login-form h1 { font-size: 24px !important; margin-bottom: 2px !important; }
    .login-form .subtitle { font-size: 11.5px !important; margin-bottom: 14px !important; }
    .login-form .form-error { font-size: 11px !important; margin-bottom: 8px !important; }
    .login-form .field { margin-bottom: 10px !important; }
    .login-form .field input { height: 40px !important; font-size: 13px !important; }
    .login-form .field i { font-size: 12px !important; }
    .login-form .forgot {
        font-size: 11px !important;
        margin-bottom: 12px !important;
    }
    .login-form .remember { gap: 6px !important; font-size: 11px !important; }
    .login-form .switch { width: 34px !important; height: 18px !important; }
    .login-form .switch::after { width: 14px !important; height: 14px !important; }
    .login-form .switch.on::after { left: 18px !important; }
    .login-form button[type="submit"] {
        padding: 10px !important;
        font-size: 13px !important;
        margin-top: 4px;
    }
    .signup-text { font-size: 11.5px !important; margin-top: 12px !important; }

    /* ---------- فوتر ---------- */
    .site-footer {
        margin-top: 36px !important;
        padding: 24px 0 30px !important;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 18px 14px !important;
    }
    .footer-grid > div:first-child {
        grid-column: 1 / -1;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border-soft);
    }
    .footer-grid h4 {
        font-size: 12.5px !important;
        margin-bottom: 8px !important;
    }
    .footer-grid a { font-size: 12px !important; margin-bottom: 5px !important; }
    .footer-grid p, .footer-grid .footer-about { font-size: 12px !important; }
    .footer-bottom {
        margin-top: 18px !important;
        font-size: 11px !important;
    }

    /* ---------- نوار پایین موبایل ---------- */
    .mobile-bottom-nav {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 150 !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: space-around !important;
        padding: 6px 2px calc(6px + env(safe-area-inset-bottom)) !important;
    }
    .mobile-bottom-nav a {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-size: 10px !important;
        gap: 3px !important;
        padding: 6px 0 2px;
        z-index: 1;
        -webkit-tap-highlight-color: transparent;
        transition: color .35s ease;
    }
    .mobile-bottom-nav a i {
        font-size: 17px !important;
        transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
        will-change: transform;
    }
    .mobile-bottom-nav a:active i { transform: scale(.82); }
    .mobile-bottom-nav a.active { color: var(--accent) !important; font-weight: 700; }
    .mobile-bottom-nav a.active i {
        transform: translateY(-3px) scale(1.18);
        animation: mnavPop .55s cubic-bezier(.34, 1.56, .64, 1);
    }
    .mobile-bottom-nav a .mnav-count {
        position: absolute;
        top: -3px !important;
        left: calc(50% + 5px) !important;
        font-size: 9px !important;
        min-width: 14px !important;
        height: 14px !important;
        line-height: 14px;
        text-align: center;
        border-radius: 8px;
        padding: 0 3px;
    }
    /* خط/درخششِ متحرکی که بین تب‌ها می‌لغزه (با mobile-nav.js ساخته می‌شه) */
    .mobile-bottom-nav .mnav-indicator {
        position: absolute;
        top: 0;
        left: 0;
        width: 34px;
        height: 3px;
        border-radius: 0 0 6px 6px;
        background: var(--accent-gradient, var(--accent));
        box-shadow: 0 2px 14px var(--accent);
        opacity: 0;
        pointer-events: none;
        z-index: 0;
        transition: transform .5s cubic-bezier(.34, 1.25, .64, 1), opacity .3s ease;
    }
    .mobile-bottom-nav .mnav-indicator::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 50%;
        width: 72px;
        height: 44px;
        transform: translateX(-50%);
        background: radial-gradient(ellipse at top, var(--accent) 0%, transparent 70%);
        opacity: .22;
    }
    .mobile-bottom-nav .mnav-indicator.mnav-enter { animation: mnavEnter .45s ease both; }
}

@keyframes mnavPop {
    0%   { transform: translateY(4px) scale(.7); }
    60%  { transform: translateY(-6px) scale(1.28); }
    100% { transform: translateY(-3px) scale(1.18); }
}
@keyframes mnavEnter {
    from { opacity: 0; clip-path: inset(0 40% 0 40%); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav .mnav-indicator,
    .mobile-bottom-nav a i { transition: none !important; animation: none !important; }
}

/* روی دسکتاپ نوار پایین و لوگو/دکمه جستجوی موبایل نمایش داده نمی‌شن */
.mobile-bottom-nav { display: none; }
.m-brand, .m-search-btn { display: none; }
@media (min-width: 769px) {
    .m-brand, .m-search-btn, .site-header .m-brand, .site-header .m-search-btn, .mobile-bottom-nav { display: none !important; }
}

@keyframes mbrandShine {
    from { background-position: 0% 0; }
    to   { background-position: -220% 0; }
}
@keyframes mbrandUp {
    0%, 100% { transform: translateY(1px); opacity: .7; }
    50%      { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 768px) {

    /* ---------- کارت محصول: همه هم‌اندازه، قیمت و دکمه همیشه پایین ---------- */
    body .product-grid,
    body .product-grid.scroll-row { align-items: stretch !important; }

    body .product-grid .product-card {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        align-self: stretch !important;
    }
    body .product-grid .product-card .thumb-wrap { flex-shrink: 0; }
    body .product-grid .product-card .thumb {
        width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        object-fit: cover;
    }
    body .product-grid .product-card .info {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        padding: 10px !important;
    }
    /* عنوان: همیشه دقیقاً جای ۲ خط، اضافه‌اش با ... بریده می‌شه */
    body .product-grid .product-card .info .pc-title {
        font-size: 12.5px !important;
        line-height: 1.7 !important;
        height: calc(1.7em * 2) !important;
        min-height: 0 !important;
        margin: 0 0 6px !important;
        overflow: hidden;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    body .product-grid .product-card .info > span {
        display: block;
        min-height: 16px;
        margin-bottom: 4px;
    }
    /* قیمت: قیمت قدیمی بالا، قیمت جدید پایین؛ همه کارت‌ها یک ارتفاع */
    body .product-grid .product-card .info .price-row {
        display: flex !important;
        flex-direction: column-reverse !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 1px !important;
        min-height: 44px;
        margin-top: auto !important;
        margin-bottom: 10px !important;
    }
    body .product-grid .product-card .info .price-now,
    body .product-grid .product-card .info .price-old { white-space: nowrap; }
    /* دکمه: همیشه ته کارت و هم‌اندازه */
    body .product-grid .product-card .info .add-to-cart-form {
        width: 100%;
        flex-shrink: 0;
    }
    body .product-grid .product-card .info .atc-btn.atc-btn-sm {
        width: 100% !important;
        min-height: 38px !important;
        padding: 0 6px !important;
    }

    /* ---------- Toast ---------- */
    .toast-stack {
        top: 10px !important;
        width: 92vw !important;
    }
    .toast-card {
        padding: 12px 14px !important;
        gap: 10px !important;
        border-radius: 14px !important;
    }
    .toast-avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
    }
    .toast-body p { font-size: 12.5px !important; line-height: 1.6 !important; }

    /* ---------- پنل ادمین ---------- */
    .admin-main { padding: 56px 12px 20px !important; }

    /* دکمه منوی پنل ادمین */
    .admin-sidebar-toggle {
        display: flex !important;
        position: fixed;
        top: 10px;
        right: 12px;
        z-index: 210;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 12px;
        background: var(--surface);
        box-shadow: var(--shadow-raised-sm);
        color: var(--text-main);
        font-size: 17px;
        cursor: pointer;
    }
    .admin-sidebar-toggle.open { color: var(--accent); box-shadow: var(--shadow-pressed-accent); }

    /* جدول‌های ادمین — اسکرول افقی */
    .data-table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
    }
    .data-table tr { display: table-row !important; }
    .data-table th,
    .data-table td {
        display: table-cell !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 10px 10px !important;
    }
    .data-table th { font-size: 11px !important; }

    /* کارت‌های آماری داشبورد */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 16px !important;
    }
    .stat-card { padding: 14px 12px !important; }
    .stat-card .value { font-size: 16px !important; }
    .stat-card .label { font-size: 11px !important; line-height: 1.5 !important; }

    /* کارت نمودار فروش */
    .admin-main .card { padding: 14px !important; }
    .admin-main .card h3 { font-size: 14px !important; margin-bottom: 12px !important; }
    #salesChart { max-width: 100% !important; }

    /* گرید دو ستونی سفارش‌ها در ادمین */
    div[style*="grid-template-columns:1.2fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    div[style*="grid-template-columns:1.2fr 1fr"] > div:first-child {
        order: 1;
    }
    div[style*="grid-template-columns:1.2fr 1fr"] > div:last-child {
        order: 2;
    }

    /* فیلترهای سفارش ادمین */
    .admin-main > div[style*="margin-bottom:16px"] {
        gap: 5px !important;
        flex-wrap: wrap;
    }
    .admin-main > div[style*="margin-bottom:16px"] .btn {
        padding: 7px 11px !important;
        font-size: 11.5px !important;
    }

    /* فرم‌های ادمین */
    .admin-main .form-row { grid-template-columns: 1fr !important; gap: 0 !important; }
    .admin-main .card h3 { font-size: 14px !important; }
}


/* ============================================================
   گوشی‌های کوچک (اکثر گوشی‌های 360px و کمتر)
   ============================================================ */
@media (max-width: 480px) {

    .container { padding: 0 12px !important; }

    /* هدر: جمع‌وجورتر */
    .logo { max-width: 90px; font-size: 9px !important; }
    .logo i { font-size: 12px !important; }

    .header-icons { gap: 4px !important; }
    .icon-btn { width: 32px !important; height: 32px !important; font-size: 12px !important; }
    .icon-btn .count { width: 14px !important; height: 14px !important; font-size: 8.5px !important; }

    .dnt-switch { width: 42px !important; height: 22px !important; }
    .dnt-knob { width: 16px !important; height: 16px !important; top: 3px !important; left: 3px !important; }
    .dnt-switch.on .dnt-knob { left: 23px !important; }

    .hamburger-btn { width: 34px !important; height: 34px !important; font-size: 14px !important; }

    /* هیرو کوچک‌تر */
    .hero { padding: 22px 14px !important; margin: 12px 0 !important; }
    .hero h1 { font-size: 12.5px !important; line-height: 2 !important; }
    .hero p { font-size: 11.5px !important; }

    /* گرید محصولات */
    .product-grid:not(.scroll-row) { gap: 8px !important; }
    .product-grid:not(.scroll-row) .product-card .pc-title { font-size: 11.5px !important; }
    .product-grid:not(.scroll-row) .atc-label { font-size: 10.5px !important; }

    /* دسته‌بندی 2 ستونه در گوشی‌های خیلی کوچک */
    .category-grid:not(.scroll-row) {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* صفحه ورود (گوشی‌های کوچک‌تر: کمی جمع‌وجورتر) */
    .login-form { width: calc(var(--d) * .66) !important; }
    .login-form h1 { font-size: 21px !important; }
    .login-form .subtitle { font-size: 10.5px !important; margin-bottom: 10px !important; }
    .login-form .field { margin-bottom: 8px !important; }
    .login-form .field input { height: 37px !important; font-size: 12.5px !important; }
    .login-form .forgot { margin-bottom: 10px !important; }
    .login-form button[type="submit"] { padding: 9px !important; }
    .signup-text { margin-top: 10px !important; }

    /* فوتر */
    .footer-grid { gap: 14px 10px !important; }
    .footer-grid h4 { font-size: 12px !important; }
    .footer-grid a { font-size: 11.5px !important; }

    /* نوار پایین */
    .mobile-bottom-nav a { font-size: 9.5px !important; }
    .mobile-bottom-nav a i { font-size: 16px !important; }
}


/* ============================================================
   گوشی‌های خیلی کوچک (iPhone SE 320px)
   ============================================================ */
@media (max-width: 380px) {

    .logo { max-width: 70px; font-size: 8px !important; }
    .logo i { font-size: 11px !important; }

    .icon-btn { width: 30px !important; height: 30px !important; font-size: 11px !important; }
    .dnt-switch { width: 38px !important; height: 20px !important; }
    .dnt-knob { width: 14px !important; height: 14px !important; }
    .dnt-switch.on .dnt-knob { left: 21px !important; }
    .hamburger-btn { width: 32px !important; height: 32px !important; font-size: 13px !important; }

    /* آیکون wishlist رو مخفی کن و از طریق drawer دسترسی بده */
    .header-icons .icon-btn[href*="wishlist"] { display: none !important; }

    .product-grid:not(.scroll-row) { gap: 6px !important; }
    .product-grid:not(.scroll-row) .product-card .info { padding: 8px !important; }
    .product-grid:not(.scroll-row) .product-card .pc-title { font-size: 11px !important; }
    .product-grid:not(.scroll-row) .atc-label { font-size: 10px !important; padding: 6px 2px !important; }
}