/* تعریف فونت سمیم */
@font-face {
    font-family: 'Samim';
    src: url('assets/fonts/Samim.eot');
    src: url('assets/fonts/Samim.eot?#iefix') format('embedded-opentype'),
        url('assets/fonts/Samim.woff2') format('woff2'),
        url('assets/fonts/Samim.woff') format('woff'),
        url('assets/fonts/Samim.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* استایل کلی برای بدنه صفحه */
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    position: relative;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    overflow-x: hidden;
}


/* قفل اسکرول صفحه هنگام باز بودن منوی موبایل */
body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* اطمینان از اسکرول منوها */
body.menu-open .mobile-menu {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* اطمینان از اسکرول منوها */
body.menu-open .mobile-menu .menu {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* اطمینان از اسکرول منوها */
body.menu-open .mobile-menu .menu li {
    overflow: visible !important;
}

/* اطمینان از اسکرول منوها */
body.menu-open .mobile-menu .menu li a {
    overflow: visible !important;
}



/* استایل برای body در حالت موبایل با نوار ناوبری پایین */
body.has-mobile-nav {
    padding-bottom: 60px !important;
}

/* استایل کلی ناوبار */
.navbar {
    position: sticky;
    top: 0;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0;
    min-height: 65px;
}

/* قسمت بالایی نوبار */
.navbar-top {
    display: flex;
    align-items: center;
    padding: 0 20px 0 20px;
    border-bottom: none;
    min-height: 35px;
    width: 100%;
    box-sizing: border-box;
    gap: 20px;
    position: relative;
}

/* قسمت پایینی نوبار */
.navbar-bottom {
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    padding: 0 20px 0 20px;
    min-height: 30px;
    width: 100%;
    box-sizing: border-box;
}

/* بخش منوها */
.menu-section {
    display: flex;
    justify-content: center;
    flex: none;
}

/* بخش کاربری */
.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* بهبود نمایش منوها در دسکتاپ */
@media (min-width: 769px) {
    .navbar {
        display: flex;
        flex-direction: column;
    }

    .navbar-top {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center;
        width: 100%;
        gap: 20px;
        padding: 0 20px 0 20px;
        min-height: 35px;
        border-bottom: none;
        position: relative;
    }

    .navbar-bottom {
        display: flex !important;
        justify-content: center !important;
        align-items: center;
        width: 100%;
        padding: 0 20px 0 20px;
        min-height: 30px;
    }

    .menu-section {
        flex: none;
        display: flex;
        justify-content: center;
    }

    .menu.menu-horizontal {
        gap: 2rem;
        background: transparent !important;
        display: flex;
        align-items: center;
        justify-content: center;
        list-style: none;
        padding: 0;
        margin: 0;
        flex-wrap: nowrap;
        overflow: visible;
        white-space: nowrap;
    }

    .user-section {
        display: flex;
        align-items: center;
        gap: 15px;
    }
}

/* استایل منوی موبایل */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: white;
    padding: 20px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    overflow-y: auto !important;
    /* اسکرول عمودی فعال */
    overflow-x: hidden !important;
    /* اسکرول افقی غیرفعال */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mobile-menu.active {
    right: 0;
}

/* استایل برای هدر بخش‌های منو */
.menu-section-header {
    padding: 0.25rem 15px;
    color: #3b82f6;
    font-weight: 500;
    text-align: right;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    margin: 0;
    /* حذف تمام margin‌ها */
}

.account-section-header {
    padding: 0.25rem 15px;
    color: #3b82f6;
    font-weight: 500;
    text-align: right;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    margin: 0;
    /* حذف تمام margin‌ها */
}


/* استایل برای منوی موبایل */
.mobile-menu .menu {
    list-style: none;
    padding: 0;
    margin: 0;
    /* حذف تمام margin‌ها */
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: 300px;
    /* محدود کردن ارتفاع */
    overflow-y: auto;
    /* اسکرول عمودی */
    overflow-x: hidden;
    /* حذف اسکرول افقی */
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-wrap: nowrap;
}

.mobile-menu .menu li {
    width: 100%;
    margin-bottom: 2px;
    /* کاهش فاصله بین آیتم‌ها */
    flex: 0 0 auto;
    /* جلوگیری از تغییر اندازه خودکار */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-menu .menu li a {
    display: block;
    width: 100%;
    padding: 8px 15px;
    color: #333;
    text-decoration: none !important;
    text-align: right;
    transition: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.mobile-menu .menu li a.active {
    color: #3b82f6 !important;
    background: transparent !important;
    border-right: 4px solid #3b82f6 !important;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}






/* استایل دکمه همبرگر */
.hamburger-menu {
    display: none;
    cursor: pointer;
    z-index: 2500;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 10px;
    width: 40px;
    text-align: center;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #333;
    transition: all 0.3s ease-in-out;
}

/* انیمیشن برای دکمه همبرگر */
.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* استایل برای overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
}

.overlay.active {
    display: block;
}

/* تنظیمات برای حالت موبایل */
@media (max-width: 768px) {
    .hamburger-menu {
        display: block !important;
        width: 45px !important;
        text-align: center !important;
        position: absolute !important;
        right: 20px !important;
        top: 65% !important;
        transform: translateY(-50%) !important;
        order: 1 !important;
        flex: 0 0 auto !important;
        z-index: 20 !important;
    }

    .navbar-top {
        position: relative !important;
        padding: 0 !important;
        min-height: 60px !important;
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .navbar-bottom {
        display: none;
    }

    .menu.menu-horizontal {
        display: none;
    }

    .menu-section {
        display: none;
    }

    .user-section {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: absolute !important;
        left: 20px !important;
        top: 73% !important;
        transform: translateY(-50%) !important;
        z-index: 15 !important;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* مخفی کردن دکمه برگشت به بالا در حالت موبایل */
    .scroll-to-top {
        display: none !important;
    }
}

/* انیمیشن برای تمام آیتم‌های منو */
.mobile-menu .menu li,
.mobile-menu .account-section-header,
.mobile-menu .menu-section-header {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.mobile-menu.active .menu li,
.mobile-menu.active .account-section-header,
.mobile-menu.active .menu-section-header {
    opacity: 1;
    transform: translateX(0);
}

/* تأخیر انیمیشن برای آیتم‌های منو */
.mobile-menu .menu li:nth-child(1) {
    transition-delay: 0.2s;
}

.mobile-menu .menu li:nth-child(2) {
    transition-delay: 0.3s;
}

.mobile-menu .menu li:nth-child(3) {
    transition-delay: 0.4s;
}

.mobile-menu .menu li:nth-child(4) {
    transition-delay: 0.5s;
}

.mobile-menu .menu li:nth-child(5) {
    transition-delay: 0.6s;
}

.mobile-menu .menu li:nth-child(6) {
    transition-delay: 0.7s;
}

.mobile-menu .menu li:nth-child(7) {
    transition-delay: 0.8s;
}

.mobile-menu .menu li:nth-child(8) {
    transition-delay: 0.9s;
}

.mobile-menu .menu li:nth-child(9) {
    transition-delay: 1.0s;
}

.mobile-menu .menu li:nth-child(10) {
    transition-delay: 1.1s;
}

.mobile-menu .menu li:nth-child(11) {
    transition-delay: 1.2s;
}

.mobile-menu .menu li:nth-child(12) {
    transition-delay: 1.3s;
}

.mobile-menu .menu li:nth-child(13) {
    transition-delay: 1.4s;
}

.mobile-menu .menu li:nth-child(14) {
    transition-delay: 1.5s;
}

.mobile-menu .menu li:nth-child(15) {
    transition-delay: 1.6s;
}

.mobile-menu .menu li:nth-child(16) {
    transition-delay: 1.7s;
}

.mobile-menu .menu li:nth-child(17) {
    transition-delay: 1.8s;
}

.mobile-menu .menu li:nth-child(18) {
    transition-delay: 1.9s;
}

.mobile-menu .menu li:nth-child(19) {
    transition-delay: 2.0s;
}

.mobile-menu .menu li:nth-child(20) {
    transition-delay: 2.1s;
}

/* تأخیر انیمیشن برای هدرهای بخش */
.mobile-menu .account-section-header {
    transition-delay: 0.1s;
}

.mobile-menu .menu-section-header {
    transition-delay: 0.7s;
}



.mobile-menu-header {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    z-index: 2001;
}

.mobile-menu-header h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding-right: 10px;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.close-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 5px;
}

.close-menu:hover {
    color: #3b82f6;
}

.mobile-menu .menu {
    margin-top: 0.5rem;
    padding-bottom: 0.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-wrap: nowrap;
}

.mobile-menu .menu li {
    margin-bottom: 0.25rem;
}

.mobile-menu .menu li:last-child {
    margin-bottom: 0;
}

/* استایل برای اسکرول */
.mobile-menu::-webkit-scrollbar,
.mobile-menu .menu::-webkit-scrollbar,
.mobile-menu .account-menu::-webkit-scrollbar {
    width: 8px;
}

.mobile-menu::-webkit-scrollbar-track,
.mobile-menu .menu::-webkit-scrollbar-track,
.mobile-menu .account-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mobile-menu::-webkit-scrollbar-thumb,
.mobile-menu .menu::-webkit-scrollbar-thumb,
.mobile-menu .account-menu::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.mobile-menu::-webkit-scrollbar-thumb:hover,
.mobile-menu .menu::-webkit-scrollbar-thumb:hover,
.mobile-menu .account-menu::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* نشانه‌های اسکرول برای منوی موبایل */
.mobile-menu .menu,
.mobile-menu .account-menu {
    position: relative;
}

/* نشانه اسکرول بالا */
.mobile-menu .menu::before,
.mobile-menu .account-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* نشانه اسکرول پایین */
.mobile-menu .menu::after,
.mobile-menu .account-menu::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* نمایش نشانه‌ها هنگام اسکرول */
.mobile-menu .menu.scrollable-top::before,
.mobile-menu .account-menu.scrollable-top::before {
    opacity: 1;
}

.mobile-menu .menu.scrollable-bottom::after,
.mobile-menu .account-menu.scrollable-bottom::after {
    opacity: 1;
}

/* پیکان‌های اسکرول */
.mobile-menu .scroll-indicator {
    position: absolute;
    left: 10px;
    z-index: 15;
    pointer-events: none;
    transition: all 0.3s ease;
}

.mobile-menu .scroll-indicator.top {
    top: 5px;
    color: #3b82f6;
    font-size: 16px;
    opacity: 0;
}

.mobile-menu .scroll-indicator.bottom {
    bottom: 5px;
    color: #3b82f6;
    font-size: 16px;
    opacity: 0;
}

.mobile-menu .menu.scrollable-top .scroll-indicator.top,
.mobile-menu .account-menu.scrollable-top .scroll-indicator.top {
    opacity: 1;
    animation: bounce-up 2s infinite;
}

.mobile-menu .menu.scrollable-bottom .scroll-indicator.bottom,
.mobile-menu .account-menu.scrollable-bottom .scroll-indicator.bottom {
    opacity: 1;
    animation: bounce-down 2s infinite;
}

@keyframes bounce-up {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-3px);
    }

    60% {
        transform: translateY(-2px);
    }
}

@keyframes bounce-down {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(3px);
    }

    60% {
        transform: translateY(2px);
    }
}


.mobile-menu .menu li a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none !important;
    text-align: right;
    transition: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}


.mobile-menu .menu li:last-child a {
    color: #333;
    border: none;
    margin-top: 0;
    padding-top: 12px;
    background: transparent !important;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* اطمینان از ساده بودن منوهای موبایل */
.mobile-menu .menu li a:hover,
.mobile-menu .menu li a:focus,
.mobile-menu .menu li a:active {
    color: #333 !important;
    background: transparent !important;
    border: none !important;
    transform: none !important;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* اطمینان از ساده بودن منوهای موبایل */
.mobile-menu .menu li a:visited {
    color: #333 !important;
    background: transparent !important;
    border: none !important;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* اطمینان از ساده بودن منوهای موبایل */
.mobile-menu .menu li a:link {
    color: #333 !important;
    background: transparent !important;
    border: none !important;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a::before,
.mobile-menu .menu li a::after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:before,
.mobile-menu .menu li a:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:link:before,
.mobile-menu .menu li a:link:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:visited:before,
.mobile-menu .menu li a:visited:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:hover:before,
.mobile-menu .menu li a:hover:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:focus:before,
.mobile-menu .menu li a:focus:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:active:before,
.mobile-menu .menu li a:active:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:link:before,
.mobile-menu .menu li a:link:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:visited:before,
.mobile-menu .menu li a:visited:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:hover:before,
.mobile-menu .menu li a:hover:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:focus:before,
.mobile-menu .menu li a:focus:after {
    display: none !important;
    content: none !important;
}

/* حذف کامل خط زیر منوهای موبایل */
.mobile-menu .menu li a:active:before,
.mobile-menu .menu li a:active:after {
    display: none !important;
    content: none !important;
}


.account-section-header {
    padding: 0.25rem 15px;
    color: #3b82f6;
    font-weight: 500;
    text-align: right;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.menu-section-header {
    padding: 0.25rem 15px;
    color: #3b82f6;
    font-weight: 500;
    text-align: right;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.hamburger-menu {
    display: none;
    cursor: pointer;
    width: 60px;
    height: 40px;
    position: relative;
    z-index: 2001;
    font-size: 24px;
}

.hamburger-menu:hover {
    background: transparent;
}

.hamburger-menu .bar {
    width: 24px;
    height: 3px;
    background: #333;
    margin: 4px auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    border-radius: 2px;
    transform-origin: center;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* پروفایل و سبد خرید */
.user-section {
    display: flex;
    align-items: center;
    gap: 25px;
    height: 100%;
}

.user-section .profile-button img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

/* استایل منوها */
.menu li a {
    font-weight: bold;
    color: black;
    background: transparent !important;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu li a:hover,
.menu li a:focus,
.menu li a:active {
    color: #3b82f6;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #3b82f6;
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.menu li a:hover::after {
    transform: scaleX(1);
}

/* استایل حالت active برای منوهای اصلی */
.menu.menu-horizontal li a.active {
    color: #3b82f6 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.menu.menu-horizontal li a.active::after {
    transform: scaleX(1);
}


.menu li a.relative span.absolute {
    background-color: #3b82f6;
}

/* تنظیم فضای بیشتر بین آیتم‌های منو */
.menu.menu-horizontal {
    gap: 2rem;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
    overflow: visible;
    white-space: nowrap;
}

/* منوی کشویی */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: -90px;
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    list-style: none;
    padding: 10px 0;
    width: 140px;
    display: none;
    z-index: 1500;
    margin-top: 5px;
    opacity: 0;
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: rotateX(-15deg);
    transform-origin: top center;
    transition: all 0.4s cubic-bezier(0.17, 0.67, 0.21, 1.69);
    overflow: hidden;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #1e40af);
    transform: translateY(-100%);
    transition: transform 0.3s 0.1s ease;
}

.dropdown-menu.active {
    display: block;
    opacity: 1;
    transform: rotateX(0deg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.dropdown-menu.active::before {
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    text-align: right;
    background: transparent !important;
    position: relative;
    overflow: hidden;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 136, 204, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.dropdown-menu a:hover {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05)) !important;
    color: #3b82f6;
    transform: translateX(-5px);
}

.dropdown-menu a:hover::before {
    transform: translateX(0);
}

.dropdown-menu.active a {
    animation: fadeInUp 0.5s forwards;
}

.dropdown-menu.active a:nth-child(1) {
    animation-delay: 0.1s;
}

.dropdown-menu.active a:nth-child(2) {
    animation-delay: 0.2s;
}

.dropdown-menu.active a:nth-child(3) {
    animation-delay: 0.3s;
}

.dropdown-menu.active a:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* استایل دکمه سبد خرید */
.cart-button {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: black;
    text-decoration: none;
    padding: 8px 15px;
    border: none;
    transition: all 0.3s ease;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.cart-button i {
    font-size: 24px;
}

.cart-button span {
    font-size: 16px;
    font-weight: bold;
}

.cart-button:hover {
    color: #00a86b;
    /* تغییر رنگ به سبز در حالت hover */
}

.logo-container {
    width: 150px;
    height: 90px;
    flex-shrink: 0;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* استایل باکس جستجو */
.search-box {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 2px solid #666666;
    border-radius: 12px;
    /* گوشه‌های گردتر */
    padding: 6px 16px;
    /* پدینگ متوسط */
    margin: 0;
    width: 500px;
    /* عرض بیشتر برای طولانی‌تر بودن */
    transition: all 0.3s ease;
    z-index: 5;
    height: 42px;
    /* ارتفاع متوسط */
}

.search-box:focus-within {
    border-color: #0088ff;
    /* کادر آبی هنگام فوکوس */
    border-width: 2.3px;
    /* افزایش ضخامت حاشیه هنگام فوکوس */
    box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.1);
    /* سایه آبی ملایم هنگام فوکوس */
}

.search-icon {
    color: #0088ff;
    /* رنگ آبی برای آیکون ذره‌بین */
    margin-left: 8px;
}

.search-input {
    background-color: transparent;
    border: none;
    color: #000000;
    width: 100%;
    /* استفاده از کل فضای موجود */
    padding: 4px 8px;
    outline: none;
    font-size: 16px;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.search-input::placeholder {
    color: #666666;
}

/* استایل نتایج جستجو */
.search-results {
    position: absolute;
    top: 45px;
    right: 0;
    width: min(500px, 90vw);
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    padding: 20px;
    border: 1px solid #e1e5e9;
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.search-section {
    margin-bottom: 20px;
}

.search-section h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-weight: 600;
    border: none;
}

.search-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 200px;
    padding-bottom: 10px;
}

.search-section ul::-webkit-scrollbar {
    width: 6px;
}

.search-section ul::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-section ul::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-section ul::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.search-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    border: 1px solid #e1e5e9;
    background: white;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.search-item:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #bbdefb;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.search-result-image,
.search-result-no-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-left: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.search-item-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    flex: 1;
    min-width: 0;
}

.search-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    margin-bottom: 4px;
    word-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-item-price {
    font-size: 12px;
    color: #27ae60;
    font-weight: 500;
    text-align: right;
}


.no-results {
    padding: 25px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.no-results::before {
    content: "🔍";
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

/* انیمیشن لودینگ */
.search-loading {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.search-loading .dot {
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    margin: 0 3px;
    animation: bounce 1.5s infinite ease-in-out;
}

.search-loading .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.search-loading .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* استایل‌های اضافی برای نتایج جستجو */
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.search-no-results::before {
    content: "🔍";
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    border: 1px solid transparent;
    margin-bottom: 4px;
    cursor: pointer;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #bbdefb;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


.search-result-image {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    margin-left: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.search-result-category {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.search-result-price {
    font-size: 13px;
    color: #27ae60;
    font-weight: 500;
}

/* استایل دکمه ورود/ثبت‌نام */
.login-button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: black;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
    flex-direction: row-reverse;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.login-button:hover {
    color: #0088cc;
}

.login-button:hover .text-container span {
    color: #0088cc;
}

.login-button .text-container span {
    display: inline;
    transition: color 0.3s ease;
}

/* اضافه کردن Overlay برای منوهای موبایل */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.overlay.active {
    display: block;
}

/* استایل نوار سیاه بالای هدر */
.top-black-bar {
    background-color: #212121;
    /* رنگ خاکستری تیره به جای مشکی */
    color: white;
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .top-black-bar {
        position: static;
        /* Changed to static to scroll with page */
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 16px 0;
        font-size: 12px;
    }

    .top-black-bar .hide-on-mobile {
        display: none !important;
        /* Added !important to ensure it hides */
    }

    .top-black-bar .top-bar-center {
        position: static;
        transform: none;
        width: auto;
        text-align: center;
    }
}

.top-black-bar .top-bar-right {
    margin-right: 20px;
    width: 33%;
    text-align: right;
}

.top-bar-right span:first-child {
    color: #3b82f6;
    font-weight: bold;
}

.top-black-bar .top-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    z-index: 5;
}

.top-black-bar .top-bar-left {
    margin-left: 20px;
    display: flex;
    align-items: center;
    width: 33%;
    text-align: left;
    justify-content: flex-end;
}

.top-black-bar .top-bar-left i {
    font-size: 14px;
    margin-right: 5px;
    color: #3b82f6;
    /* تغییر رنگ به آبی */
}

.top-black-bar span {
    margin-left: 0px;
}

.top-black-bar .discount-code {
    color: #3b82f6;
    font-weight: 700;
    margin: 0 2px;
}

/* This block has been merged with the rule above to avoid conflicts. */

/* استایل نوار ناوبری موبایل */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    height: 70px;
    align-items: center;
    justify-content: space-around;
    z-index: 2001;
    /* افزایش z-index برای قرار گرفتن روی منوی موبایل */
    padding: 0 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #eaeaea;
}

.mobile-bottom-nav .button-container {
    display: flex;
    width: 100%;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.mobile-bottom-nav .button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    gap: 5px;
    position: relative;
    width: 33.33%;
    height: 100%;
    font-family: 'Samim', tahoma, Arial, sans-serif;
}

.mobile-bottom-nav .button:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15px;
    bottom: 15px;
    width: 1px;
    background-color: #eaeaea;
}

.mobile-bottom-nav .button .icon {
    font-size: 24px;
}

/* باکس جستجوی موبایل */
.mobile-search-box {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2001;
    padding: 20px;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    overflow: hidden;
}

.mobile-search-box.active {
    display: flex;
    flex-direction: column;
}

.mobile-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    flex-shrink: 0;
    color: #000000;
}

.mobile-search-content {
    flex-grow: 1;
    overflow-y: auto;
    margin-right: -20px;
    padding-right: 20px;
    max-height: calc(100vh - 120px);
    min-height: 200px;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 15px;
    background-color: #ffffff;
    border: 2px solid #666666;
    border-radius: 20px;
    font-size: 16px;
    margin-bottom: 20px;
    font-family: 'Samim', tahoma, Arial, sans-serif;
    transition: all 0.3s ease;
    color: #000000;
}

.mobile-search-input:focus {
    border-color: #0088ff;
    border-width: 2.3px;
    outline: none;
}

/* Mobile search results styles are handled by autocomplete-container */

/* Override autocomplete styles for mobile */
.mobile-search-box .autocomplete-container {
    position: static;
    border: none;
    box-shadow: none;
    max-height: none;
    overflow-y: visible;
    border-radius: 0;
    padding: 0;
    margin-top: 10px;
}

/* بهبود نمایش محتویات هنگام باز بودن کیبورد */
@media (max-height: 600px) {
    .mobile-search-content {
        max-height: calc(100vh - 80px);
        min-height: 150px;
    }

    .mobile-search-header {
        margin-bottom: 10px;
    }

    .mobile-search-input {
        margin-bottom: 10px;
    }
}

/* استایل ساده برای جلوگیری از سرریز متن */
.search-results {
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
}

.search-results * {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* استایل خاص برای پیام‌های autocomplete */
.autocomplete-recent .no-results-message {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
    padding: 10px;
    color: #666;
    font-size: 14px;
    text-align: right;
    direction: rtl;
}

/* استایل‌های موبایل برای کارت‌های جستجو */
@media (max-width: 768px) {
    .search-section ul {
        gap: 8px;
        padding-bottom: 15px;
        max-height: 250px;
    }

    .search-item {
        width: 100%;
        padding: 10px;
        flex-direction: row;
    }

    .search-result-image,
    .search-result-no-image {
        width: 45px;
        height: 45px;
        margin-left: 10px;
    }

    .search-item-name {
        font-size: 13px;
    }

    .search-item-price {
        font-size: 11px;
    }

    /* اطمینان از عدم اسکرول افقی در موبایل */
    .mobile-menu,
    .mobile-menu .menu,
    .mobile-menu .menu li,
    .mobile-menu .menu li a {
        overflow-x: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

}




@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
        width: calc(100% - 24px) !important;
        left: 12px !important;
        right: auto !important;
        bottom: 12px !important;
        border-radius: 25px !important;
        height: 65px !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15) !important;
        border-top: none !important;
        background-color: white !important;
    }

    .search-box,
    .cart-button {
        display: none;
    }

    .user-section {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: absolute !important;
        left: 20px !important;
        top: 73% !important;
        transform: translateY(-50%) !important;
        z-index: 15 !important;
    }

    .profile-button {
        display: block;
    }
}

/* اصلاح خط جداکننده برای دکمه جستجو */
#mobileSearchButton::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15px;
    bottom: 15px;
    width: 1px;
    background-color: #eaeaea;
}


/* حذف منوی کشویی در حالت موبایل */
@media (max-width: 768px) {
    .profile-dropdown {
        display: none;
    }

    .profile-button {
        display: block;
        width: 40px;
        height: 40px;
    }

    .profile-button img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .hamburger-menu {
        display: block !important;
        width: 45px !important;
        text-align: center !important;
        position: absolute !important;
        right: 20px !important;
        top: 65% !important;
        transform: translateY(-50%) !important;
        z-index: 20 !important;
    }

    .menu.menu-horizontal {
        display: none;
    }

    .logo-container {
        position: absolute !important;
        left: 50% !important;
        top: 71% !important;
        transform: translate(-50%, -50%) !important;
        width: 120px !important;
        height: 70px !important;
        z-index: 10 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .logo-container img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .navbar {
        padding: 0 !important;
        position: relative !important;
        /* Removed stickiness */
        margin: 10px 12px 0;
        /* Fixed margin instead of auto */
        width: calc(100% - 24px) !important;
        /* Explicitly set width */
        border-radius: 25px !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
        z-index: 1001 !important;
        height: 60px !important;
        min-height: 60px !important;
        background-color: white !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .cart-button span {
        display: none;
    }

    .cart-button {
        padding: 0;
    }

    .cart-button i {
        font-size: 20px;
    }

    .user-section {
        gap: 15px;
    }

    .profile-dropdown {
        display: none;
    }

    .profile-button {
        display: block !important;
        width: 40px;
        height: 40px;
    }

    .profile-button img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
    }

    .search-results {
        width: 90vw;
        right: 0;
        left: 5vw;
        max-width: none;
    }

    .login-button {
        width: auto;
        height: auto;
        padding: 8px;
        margin: 0;
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        gap: 8px;
    }

    .login-button .text-container {
        display: flex;
        flex-direction: column;
        font-size: 12px;
        text-align: right;
    }

    .search-box {
        display: none;
    }

    body {
        padding-top: 0 !important;
        /* Let natural flow handle the spacing */
        padding-bottom: 100px !important;
        background-color: #f0f2f5;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 8px 10px;
        height: auto;
        min-height: 60px;
    }

    .logo-container {
        width: 100px;
        height: 100px;
    }

    .cart-button {
        font-size: 14px;
    }

    .search-box.active {
        width: 250px;
    }

    body {
        padding-bottom: 60px;
    }
}


/* Mobile Menu Final Styles */
@media (max-width: 768px) {

    /* Base styles for the mobile menu, preparing for animation */
    .mobile-menu {
        /* Use visibility/opacity for smooth transitions */
        visibility: hidden;
        opacity: 0;
        /* Start smaller for a pop-in effect */
        transform: scale(0.95);
        transform-origin: top right;
        /* Animate from the top-right corner */
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;

        /* Positioning and Sizing */
        position: fixed;
        top: 85px;
        /* Position below the header */
        right: 15px;
        /* Align to the right */
        width: 75vw;
        /* Adjust width */
        max-width: 280px;
        /* Set a smaller max-width */
        height: auto;
        max-height: calc(100vh - 180px);
        /* Ensure it fits on screen */

        /* Appearance */
        background: white;
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        z-index: 2000;
        overflow-y: auto;
        overflow-x: hidden;

        /* Override desktop styles */
        left: auto;
        display: flex;
        flex-direction: column;
    }

    /* Styles for the active (visible) mobile menu */
    .mobile-menu.active {
        visibility: visible;
        opacity: 1;
        transform: scale(1);
        /* Final animation state */
        /* Add a subtle shadow on the right to indicate potential horizontal scroll */
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), inset -10px 0 10px -10px rgba(0, 0, 0, 0.2);
    }

    /* Ensure the bottom nav bar is behind the overlay but above content */
    .mobile-bottom-nav {
        z-index: 1990;
    }
}

/* Social Media Links for Mobile View */
.mobile-social-links {
    /* Positioning */
    position: fixed;
    top: 50%;
    /* Start off-screen to the left */
    left: -60px;
    transform: translateY(-50%);
    z-index: 2001;
    /* Above the menu */

    /* Layout */
    display: flex;
    flex-direction: column;
    gap: 10px;

    /* Appearance */
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition: left 0.4s ease, opacity 0.4s ease, visibility 0.4s;
}

.mobile-social-links.active {
    left: 15px;
    /* Slide in to view */
    opacity: 1;
    visibility: visible;
    transition-delay: 0.2s;
    /* Delay to sync with menu opening */
}

.mobile-social-links .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.mobile-social-links .social-icon:hover {
    transform: scale(1.15);
}

.mobile-social-links .social-icon.support {
    background-color: #5a67d8;
}

.mobile-social-links .social-icon.whatsapp {
    background-color: #25D366;
}

.mobile-social-links .social-icon.telegram {
    background-color: #0088cc;
}

.mobile-social-links .social-icon.instagram {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

/* استایل حالت active برای دکمه‌های نوبار زیرین موبایل */
.mobile-bottom-nav .button.active {
    color: #3b82f6 !important;
}

.mobile-bottom-nav .button.active .icon {
    color: #3b82f6 !important;
}

.mobile-bottom-nav .button.active span {
    color: #3b82f6 !important;
    font-weight: bold;
}

.close-search {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}