/* ─── NAVBAR عمومی ─── */
.main-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 10px 0;
    position: relative;
    /* حذف حالت fixed */
    z-index: 1000;
}

.main-nav .navbar-brand img {
    height: 48px;
    width: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.brand-text {
    font-weight: 800;
    font-size: 17px;
    color: var(--primary);
    line-height: 1.3;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}

/* سرچ */
.nav-search-wrap {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

.nav-search-wrap .input-group {
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid var(--border);
    transition: border-color .2s;
}

.nav-search-wrap .input-group:focus-within {
    border-color: var(--primary);
}

.nav-search-wrap input {
    border: none;
    outline: none;
    box-shadow: none !important;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 14px;
    padding: 9px 14px;
    background: var(--bg-light);
}

.nav-search-wrap button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 18px;
    font-size: 16px;
    cursor: pointer;
    transition: background .2s;
}

.nav-search-wrap button:hover {
    background: var(--primary-dark);
}

/* سمت چپ ناوبار */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-auth-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1.5px solid var(--primary-light);
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-auth-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ─── TOPBAR (منوی اصلی) ─── */
.topbar {
    background: var(--primary-dark);
    position: relative;
    /* حذف حالت fixed */
    z-index: 999;
}

/* منوی دسکتاپ */
.topbar-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topbar-menu>li {
    position: relative;
}

.topbar-menu>li>a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, .88);
    font-size: 14px;
    font-weight: 500;
    padding: 11px 14px;
    text-decoration: none;
    transition: background .2s, color .2s;
    border-radius: 6px;
    white-space: nowrap;
}

.topbar-menu>li>a:hover,
.topbar-menu>li>a.active {
    color: #fff;
    background: rgba(255, 255, 255, .15);
}

/* dropdown زیرمنو */
.topbar-menu .dropdown-menu {
    min-width: 180px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 6px;
    right: 0;
    left: auto;
}

.topbar-menu .dropdown-item {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13.5px;
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-dark);
    transition: background .15s;
}

.topbar-menu .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* دکمه‌های چپ هدر پایینی (سبد خرید + تلفن) */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-phone {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
    direction: ltr;
    white-space: nowrap;
}

.topbar-cart {
    background: #fff;
    color: var(--primary-dark) !important;
    border-radius: 8px;
    padding: 7px 14px !important;
    font-weight: 700;
    font-size: 13.5px;
    transition: background .2s, transform .2s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topbar-cart:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* همبرگر فقط موبایل */
.topbar-hamburger {
    display: none;
}

@media (max-width: 991px) {
    .topbar-desktop {
        display: none;
    }

    .topbar-hamburger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 0;
    }
}

/* موبایل کوچک (زیر 575px): همه چیز زیر هم */
@media (max-width: 575px) {
    .main-nav .container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }

    .nav-search-wrap {
        max-width: 100%;
        margin: 0;
    }

    .nav-actions {
        justify-content: center;
        width: 100%;
    }

    .nav-auth-link {
        width: 100%;
        justify-content: center;
    }

    .topbar-hamburger {
        flex-direction: row-reverse;
    }
}

/* موبایل متوسط (575 تا 768) */
@media (min-width: 576px) and (max-width: 768px) {
    .main-nav .container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .nav-search-wrap {
        max-width: 100%;
        margin: 0;
    }

    .nav-actions {
        justify-content: center;
    }
}

/* منوی تمام‌صفحه موبایل */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--primary-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.open {
    transform: translateX(0);
}

.mobile-menu-close {
    align-self: flex-start;
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    transition: background .2s;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, .25);
}

.mobile-menu-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.mobile-menu-nav>li {
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.mobile-menu-nav>li>a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    padding: 16px 4px;
    text-decoration: none;
    transition: color .2s;
}

.mobile-menu-nav>li>a:hover {
    color: #a8d8f0;
}

/* زیرمنوی موبایل */
.mobile-submenu {
    list-style: none;
    padding: 0 0 10px 16px;
    margin: 0;
    display: none;
}

.mobile-submenu.open {
    display: block;
}

.mobile-submenu li a {
    display: block;
    color: rgba(255, 255, 255, .75);
    font-size: 14.5px;
    padding: 9px 4px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    transition: color .2s;
}

.mobile-submenu li a:hover {
    color: #fff;
}

.submenu-arrow {
    transition: transform .25s;
    font-size: 13px;
}

.submenu-arrow.rotated {
    transform: rotate(90deg);
}

/* ─── SCROLL TOP ─── */
.scroll-top {
    position: fixed;
    bottom: 28px;
    left: 28px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background .2s, transform .2s;
    display: none;
    z-index: 998;
    align-items: center;
    justify-content: center;
}

.scroll-top.show {
    display: flex;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.product-item.card {
    border: 1px solid #eef2f5 !important;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s ease-in-out;
}

.product-item.card:hover {
    transform: translateY(-6px);
    border-color: var(--primary, #007bff) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
}

.product-item.card:hover .btn-outline-primary {
    background-color: var(--primary, #007bff);
    color: #fff;
}

.effect-hover {
    transition: all 0.3s ease-in-out !important;
    position: relative;
}

.effect-hover:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08) !important;
    border-color: var(--primary, #007bff) !important;
}

.effect-hover:hover img {
    transform: scale(1.04);
}

.effect-hover img {
    transition: transform 0.4s ease-in-out;
}

.btn-view-all-articles {
    color: #0d6efd;
    border: 2px solid #0d6efd;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    background-color: transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.08);
}

.btn-view-all-articles:hover {
    background-color: #0d6efd;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.25);
    transform: translateY(-2px);
}

.btn-view-all-articles:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(13, 110, 253, 0.15);
}

.btn-view-all-articles .arrow-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn-view-all-articles:hover .arrow-icon {
    transform: translateX(-5px);
}
