/* منوی پایین پیش‌فرض مخفی */
.mobile-bottom-nav { display: none; }

/* دسته‌بندی موبایل پیش‌فرض مخفی */
.mobile-only-cats { display: none; }

/* ============ موبایل + تبلت ============ */
@media (max-width: 950px) {

    /* کارت کاربر موبایل */
    .dash-user {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .dash-user-info {
        flex: 1;
    }

    .dash-user-account {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        background: var(--gold-soft);
        border: 1px solid var(--gold-dark);
        border-radius: 10px;
        color: var(--gold);
        font-size: 12px;
        font-weight: 700;
        text-decoration: none;
        transition: all .2s;
        flex-shrink: 0;
    }

    .dash-user-account:hover,
    .dash-user-account:active {
        background: var(--gold);
        color: #1a1a1a;
    }

    .dash-user-account svg {
        flex-shrink: 0;
    }

    /* ============ پنل کاربری موبایل ============ */
    .dash-wrap {
        padding: 20px 12px 60px;
    }

    .dash-layout {
        grid-template-columns: 1fr !important;
    }

    .dash-sidebar {
        position: relative;
        top: auto;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 16px;
    }

    /* کارت کاربر */
    .dash-user {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 10px;
    }

    .dash-user-avatar {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }

    /* منوی افقی */
    .dash-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding: 8px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        scrollbar-width: none;
    }

    .dash-nav::-webkit-scrollbar { display: none; }

    .dash-nav-item {
        flex-shrink: 0;
        flex-direction: column;
        gap: 4px;
        padding: 10px 14px;
        font-size: 11px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .dash-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .dash-nav-item span:first-of-type {
        flex: initial;
    }

    /* ثبت درخواست - دکمه طلایی وسط */
    .dash-nav-gold {
        background: linear-gradient(135deg, var(--gold-light), var(--gold));
        color: #1a1a1a !important;
    }

    .dash-nav-divider {
        display: none;
    }

    /* ============ پنل کاربری موبایل (تکرار) ============ */
    .dash-layout {
        grid-template-columns: 1fr !important;
    }

    .dash-sidebar {
        position: relative;
        top: auto;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 20px;
    }

    /* کارت کاربر */
    .dash-user {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 14px;
        margin-bottom: 12px;
    }

    .dash-user-avatar {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }

    /* منوی افقی، اسکرول‌دار */
    .dash-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding: 8px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 14px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dash-nav::-webkit-scrollbar {
        display: none;
    }

    .dash-nav-item {
        flex-shrink: 0;
        flex-direction: column;
        gap: 4px;
        padding: 10px 14px;
        font-size: 11px;
        border-radius: 10px;
        white-space: nowrap;
    }

    .dash-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .dash-nav-item span:first-of-type {
        flex: initial;
    }

    /* دکمه ثبت طلایی - جدا */
    .dash-nav-gold {
        background: linear-gradient(135deg, var(--gold-light), var(--gold));
        color: #1a1a1a !important;
        order: -1;
        margin-left: auto;
    }

    .dash-nav-divider {
        display: none;
    }

    /* مخفی کردن بازگشت و خروج تو تب‌ها */
    .dash-nav-item:last-child,
    .dash-nav-item:nth-last-child(2) {
        display: none;
    }

    /* دکمه پشتیبانی موبایل */
    .header-support-btn span {
        display: none;
    }

    .header-support-btn {
        padding: 8px 10px;
    }

    /* HERO موبایل */
    .hero-badge {
        margin-bottom: 12px;
    }

    .hero-content h1 {
        font-size: 32px;
        white-space: nowrap;
        line-height: 1.2;
    }

    .hero-content h1 span {
        display: inline;
    }

    .hero-search {
        margin-top: 20px;
    }

    .hero-search input,
    .hero-search button {
        flex-basis: 100%;
        width: 100%;
    }

    /* پایه */
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        padding-bottom: 80px;
    }

    /* ============ هدر ============ */
    .header-container {
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 10px;
    }

    .site-logo {
        font-size: 22px;
        margin: 0;
    }

    .header-location { display: none !important; }
    .main-nav { display: none !important; }

    .header-search {
        order: 3;
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .header-search input,
    .header-search button { height: 42px; }

    /* ============ فوتر اصلی مخفی ============ */
    .site-footer { display: none !important; }

    /* ============ منوی پایین ============ */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 999;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 6px 0;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .15);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        flex: 1;
        padding: 6px 4px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        font-family: inherit;
        font-size: 11px;
        font-weight: 700;
        text-decoration: none;
        cursor: pointer;
        border-radius: 12px;
        transition: all 0.2s ease;
    }

    .mobile-nav-item:active,
    .mobile-nav-item:hover {
        color: var(--gold);
        background: var(--gold-soft);
    }

    .mobile-nav-item svg {
        width: 24px;
        height: 24px;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .mobile-nav-item:active svg,
    .mobile-nav-item:hover svg {
        transform: translateY(-2px);
    }

    .mobile-nav-item span {
        font-size: 11px;
        line-height: 1.2;
    }

    /* دکمه وسط ثبت */
    .mobile-nav-center {
        position: relative;
        margin-top: -38px;
    }

    .mobile-nav-center-btn {
        width: 60px;
        height: 60px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--gold-light), var(--gold));
        border-radius: 50%;
        color: #1a1a1a !important;
        box-shadow:
            0 8px 24px var(--gold-glow),
            0 0 0 6px var(--bg-card);
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mobile-nav-center:active .mobile-nav-center-btn {
        transform: scale(0.92);
        box-shadow: 0 4px 12px var(--gold-glow), 0 0 0 6px var(--bg-card);
    }

    /* ⚠️ نکته: display:none سایدبار حذف شد چون با پنل کشویی تداخل داشت */
    .categories-grid { display: none !important; }

    .mobile-only-cats {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        margin-bottom: 24px;
    }

    .mobile-cat-circle {
        width: 80px;
        height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: radial-gradient(circle at 35% 30%, var(--bg-elevated), var(--bg-card) 70%);
        border: 1px solid var(--border-light);
        border-radius: 50%;
        text-decoration: none;
        color: var(--gold);
        font-size: 10px;
        font-weight: 700;
        transition: all .25s;
        flex-shrink: 0;
    }

    .mobile-cat-circle:active,
    .mobile-cat-circle:hover {
        border-color: var(--gold);
        transform: translateY(-3px);
    }

    .mobile-cat-icon {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-cat-icon img {
        width: 28px;
        height: 28px;
    }

    /* ============ چیدمان ============ */
    .categories-layout {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .categories-main { width: 100%; }

    /* ============ HERO ============ */
    .hero-section {
        width: calc(100% - 24px);
        margin-top: 16px;
        min-height: auto;
        padding: 30px 16px;
        border-radius: 18px;
    }

    .hero-content { padding: 20px 12px; }
    .hero-content h1 {
        font-size: 36px;
        letter-spacing: -1px;
    }
    .hero-badge { font-size: 12px; }

    /* ============ بخش‌ها ============ */
    .categories-section,
    .ads-section {
        width: calc(100% - 20px);
        margin-top: 40px;
    }

    .section-title h2 { font-size: 20px; }

    /* ============ کارت آگهی: ۲ ستون ============ */
    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* ============ موبایل کوچیک ============ */
@media (max-width: 600px) {

    .hero-content h1 { font-size: 30px; }
    .hero-content p { font-size: 13px; }

    .hero-search {
        flex-wrap: wrap;
        padding: 6px;
    }

    .search-icon { display: none; }
    .hero-search input { width: 100%; height: 44px; }
    .hero-search button { width: 100%; height: 44px; margin-top: 6px; }

    .hero-buttons .btn-outline { display: none; }

    .ads-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ============ دسکتاپ: مخفی ============ */
@media (min-width: 951px) {
    .mobile-bottom-nav { display: none !important; }
    .mobile-only-cats { display: none !important; }
}

@media (max-width: 950px) {
    .header-support-btn {
        position: absolute;
        top: 15px;
        left: 24px;
        z-index: 100;
    }

    .header-support-btn span {
        display: none;
    }

    .header-support-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 600px) {

    .ads-grid .ad-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        height: 90px;
        margin-bottom: 10px;
        position: relative;
        padding: 0;
    }

    .ads-grid .ad-image {
        width: 75px;
        height: 100%;
        flex-shrink: 0;
        background: var(--bg-card);
        border-left: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ads-grid .ad-placeholder-icon svg,
    .ads-grid .ad-placeholder-icon img {
        width: 36px;
        height: 36px;
        object-fit: contain;
    }

    .ads-grid .ad-content {
        flex: 1;
        padding: 8px 12px 8px 30px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
    }

    .ads-grid .ad-content h3 {
        font-size: 13px;
        margin: 0 0 4px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ads-grid .ad-content .ad-category {
        display: none;
    }

    .ads-grid .ad-content .ad-footer {
        border-top: 1px solid var(--border);
        padding-top: 6px;
        margin-top: 6px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 11px;
    }
}