:root {
    --main-menu-back: white;
    --main-menu-back-small: rgba(255, 255, 255, 0.8);
    --main-menu-margin-top: 20px;
    --main-menu-margin: 11%;
    --main-menu-padding-default: 10px;
    --main-menu-padding-small: 0px;
    /*  اگر متغیر --raduis را تعریف نکرده اید، این خط را اضافه کنید: */
    --raduis: 5px;
    /* یا هر مقدار دلخواه دیگر */
    --bookmark-height: 60px;
}

.main-menu {
    background-color: var(--main-menu-back);
    position: fixed;
    height: fit-content;
    z-index: 1000;
    top: var(--main-menu-margin-top);
    left: var(--main-menu-margin);
    right: var(--main-menu-margin);
    padding: var(--main-menu-padding-default) var(--main-menu-padding-default);
    transition: 500ms;
    box-sizing: content-box !important;
}

.main-menu.small {
    border-radius: 0 !important;
    left: 0;
    right: 0;
    top: 5px;
    padding: var(--main-menu-padding-small) 100px;
    /*background-color: var(--main-menu-back-small);  اگر می خواهید پس زمینه نیمه شفاف باشد */
    /*backdrop-filter: blur(2px); اگر می خواهید پس زمینه محو باشد */
    box-shadow: 0px 4px 5px #8484845e;
    /*border-radius: 10px; اگر می خواهید گوشه ها گرد باشند */
}

.main-menu.with-bookmark {
    top: calc(var(--bookmark-height) + 10px);
}

.main-menu.smallBookmark {
    top: var(--bookmark-height) !important;
}

.main-menu.small .navbar .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.main-menu .navbar .navbar-brand {
    margin-right: 0;
}

.main-menu .navbar .navbar-brand img {
    height: 45px;
    transform: scale(1);
    -ms-transform: scale(1);
}

.main-menu.small .navbar .navbar-brand img {
    margin-right: 0;
    margin-left: 0;
    transform: scale(0.8);
    -ms-transform: scale(0.8);
}

.main-menu .navbar .btn-text {
    color: var(--bs-nav-link-color) !important;
    padding: 4px 10px;
    border-radius: var(--raduis);
    /* added border-radius */

}

.main-menu .navbar .btn-text:hover {
    /*background-color: var(--primary-color--50); */
    color: white !important;
}

.main-menu .dropdown-item {
    font-weight: 300;
    font-size: 14px;
}


.main-menu .nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    color: #333;
    transition: color 0.3s ease;
}

.main-menu .nav-link:hover {
    color: var(--primary-color);
}

.main-menu .nav-link:hover .badge-percent-svg path {
    fill: var(--primary-color);
}

/* انیمیشن خط زیر لینک‌ها */
.main-menu .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 12%;
    width: 0;
    height: 1.5px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-menu .nav-link:hover::after {
    width: 80%;
}

.cart-badge {
    padding: 0;
    padding-top: 1px;
    position: absolute !important;
    top: 0px !important;
    right: 0px;
    width: 14px;
    height: 13px;
    background-color: #4fba6b;
}


/* .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
} */


#navbarCartList::-webkit-scrollbar {
    width: 5px;
    background-color: white;
}

#navbarCartList::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    border-radius: 10px;
}

#navbarCartList.dropdown-animated {
    visibility: hidden;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    display: block;
    left: 0 !important;
    /* برای نمایش درست توسط بوت‌استرپ */
}

.dropdown .show+.dropdown-animated {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* دکمه دسته‌بندی‌ها */
.categories-btn {
    background-color: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.categories-btn:hover {
    transform: translateY(-2px);
}

/* منوی کشویی دسته‌بندی‌ها */
.categories-dropdown {
    position: relative;
}

.category-container {
    background-color: #f7f7f7;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.category-item {
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #e0e0e0;
}

.category-item:hover {
    color: var(--primary-color);
    padding-right: 2rem;
}

.category-item i {
    font-size: 0.8rem;
    color: #999;
}

/* زیرمنو */
.submenu {
    position: absolute;
    top: 0;
    right: 101%;
    width: 200px;
    background: #f7f7f7;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 5px 0;
    display: none;
}

.has-submenu:hover .submenu {
    display: block;
}

.submenu-item {
    padding: 0.5rem 1.5rem;
    display: block;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #e0e0e0;
}

.submenu-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    padding-right: 2rem;
}

@media (max-width: 992px) {
    .main-menu {
        top: 10px;
        left: 10px;
        right: 10px;
        margin: 0;
        padding: 0px;
    }

    .main-menu.small {
        padding: var(--main-menu-padding-small) 20px;
    }
}




/* استایل بوکمارک */
.bookmark-container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.bookmark {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    color: white;
    height: var(--bookmark-height);
    /* حذف بک‌گراند از اینجا - بک‌گراند از body می‌آید */
    transition: all 0.4s ease;
    margin-bottom: 20px;
    overflow: hidden;
    /* اضافه شده */
    background: transparent;
}


.bookmark.collapsed {
    height: 5px;
}

.bookmark.collapsed #bookmarkToggle {
    display: none;
}

/* محتوای بوکمارک */
.bookmark-content {
    padding: 0;
    width: 100%;
    background: var(--primary-color);
    /* box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); */
}

.bookmark-item {
    height: 100%;
    width: 100%;
    position: relative;
    /* برای موقعیت‌دهی عنوان */
}

.bookmark-media {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: start;
    overflow: hidden;
    /* padding-left: 60px !important; */

}

/* استایل برای محتوای داخل body */
.bookmark-media>* {
    /* width: 100%; */
    height: 100%;
    object-fit: cover;
    padding-right: 20px;
    display: flex;
    align-items: center;
    padding-left: 60px !important;

}

/* اگر body شامل عکس باشد */
.bookmark-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* اگر body شامل ویدیو باشد */
.bookmark-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* اگر body شامل div با بک‌گراند باشد */
.bookmark-media>div {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* عنوان به صورت overlay */
.bookmark-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-right: 30px;
    bottom: 0;
    display: flex;
    align-items: center;
    /* justify-content: center; */
    z-index: 10;
    /* background: rgba(0, 0, 0, 0.3); */
    /* padding: 10px 20px; */
    font-size: 1.2rem;
    font-weight: bold;
    /* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); */
}

/* استایل برای محتوای متنی داخل body */
.bookmark-media p {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    /* justify-content: center; */
    margin: 0;
    /* padding: 20px; */
    text-align: center;
}

/* دکمه بستن */
.btn-close {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    opacity: 0.8;
}

.btn-close:hover {
    opacity: 1;
}



#bookmarkToggle {
    padding: 10px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.login-link:hover {
    color: var(--primary-color) !important;
}




/* new ================================================================================================ */
/* منوی دسته‌بندی برای دسکتاپ */
.category-menu {
    position: absolute;
    top: 75px;
    left: -10px;
    right: -10px;
    background: white;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border-top: 2px solid var(--primary-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    border-radius: 10px;
    padding: 8px 10px;
}

.category-menu.active {
    opacity: 1;
    visibility: visible;
    max-height: 70vh;
}

.category-menu.small {
    top: 75px;
}

.category-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px 15px;
}

.category-content::-webkit-scrollbar {
    width: 5px;
    background-color: white;
    border-radius: 10px;
}

.category-content::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    border-radius: 10px;
}

/* دسته‌های اصلی */
.main-categories {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    padding: 10px 10px;
    margin-bottom: 5px;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
    text-decoration: none;
}

.main-categories::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.main-categories:hover {
    color: var(--primary-color);
    background: rgba(25, 135, 84, 0.05);
    text-decoration: none;
    padding-right: 12px;
}

.main-categories:hover::before {
    height: 28px;
}

/* زیر‌دسته‌ها */
.sub-categories {
    list-style: none;
    padding-right: 25px;
    margin-top: 6px;
    margin-bottom: 12px;
    border-right: 1px dashed #eee;
}

.sub-categories li {
    margin-bottom: 6px;
}

.sub-categories a {
    position: relative;
    text-decoration: none;
    color: #666;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 4px 0;
}

/* مربع کنار زیر‌دسته‌ها */
.sub-categories a::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 2px solid #ccc;
    border-radius: 2px;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.sub-categories a:hover {
    color: var(--primary-color);
    transform: translateX(-3px);
}

.sub-categories a:hover::before {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

/* افکت نرم‌تر برای تمام منو */
.category-menu,
.main-categories,
.sub-categories a {
    transition: all 0.3s ease;
}



/* آکاردئون موبایل */
.mobile-category-menu {
    position: fixed;
    top: 0;
    right: -420px;
    width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transition: right 0.3s ease;
    overflow-y: auto;
}

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

.mobile-category-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-category-content {
    padding: 20px;
}

.mobile-main-category {
    border-bottom: 1px solid #eee;
}

.mobile-main-category button {
    width: 100%;
    text-align: right;
    padding: 15px 0;
    background: none;
    border: none;
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-main-category button:hover {
    color: var(--primary-color);
}

.mobile-main-category button::after {
    content: '\f282';
    font-family: 'bootstrap-icons';
    transition: transform 0.3s ease;
}

.mobile-main-category button[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.mobile-sub-categories {
    list-style: none;
    padding-right: 15px;
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-main-category button[aria-expanded="true"]+.mobile-sub-categories {
    max-height: 500px;
}

.mobile-sub-categories li {
    margin-bottom: 10px;
}

.mobile-sub-categories a {
    text-decoration: none;
    color: #666;
    display: block;
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.mobile-sub-categories a:hover {
    color: var(--primary-color);
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 992px) {
    .category-menu {
        display: none !important;
    }
}

@media (min-width: 993px) {
    .mobile-category-menu {
        display: none !important;
    }

    #overlay {
        display: none !important;
    }
}

.hero-section {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: white;
    padding: 60px 0;
    border-radius: 10px;
    margin-bottom: 30px;
}




.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls a {
    display: inline-block;
    width: 25px;
    height: 25px;
    text-align: center;
    line-height: 23px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.quantity-controls a:hover {
    background: #198754;
    color: white;
    border-color: #198754;
}

.quantity-controls .count {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}


















/* استایل سبد خرید */
.cart-container {
    position: relative;
    display: inline-block;
}

.favorites-container {
    position: relative;
    display: inline-block;
}

.compare-container {
    position: relative;
    display: inline-block;
}
.profile-container {
    position: relative;
    display: inline-block;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.cart-badge {
    padding: 0;
    padding-top: 0px;
    position: absolute !important;
    top: -3px !important;
    right: -1px;
    width: 15px;
    height: 15px;
    background-color: var(--primary-color);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 8px;
}

.cart-dropdown,
.favorites-dropdown,
.profile-dropdown,
.compare-dropdown {
    position: absolute;
    top: 75px;
    left: -10px;
    width: 340px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    border-top: 2px solid var(--primary-color);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.favorites-dropdown {
    left: -10px;
}

.compare-dropdown {
    left: -10px;
}
.profile-dropdown {
    width: 200px !important;
    left: -10px;
}

.cart-container:hover .cart-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.favorites-container:hover .favorites-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.compare-container:hover .compare-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.profile-container:hover .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 10px;
}

.cart-items::-webkit-scrollbar {
    width: 5px;
}

.cart-items::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    border-radius: 10px;
}

.cart-item {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 15px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-content {
    flex: 1;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.cart-item-price {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.cart-item-old-price {
    font-size: 12px;
    color: #6c757d;
    text-decoration: line-through;
    margin-right: 5px;
}

.favorites-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.favorites-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 10px;
}

.favorites-items::-webkit-scrollbar {
    width: 5px;
}

.favorites-items::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    border-radius: 10px;
}

.compare-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 0 10px;
}

.compare-items::-webkit-scrollbar {
    width: 5px;
}

.compare-items::-webkit-scrollbar-thumb {
    background-color: darkgrey;
    border-radius: 10px;
}

.favorites-item {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 15px;
}

.favorites-item:last-child {
    border-bottom: none;
}

.favorites-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.favorites-item-content {
    flex: 1;
}

.favorites-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.favorites-item-price {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.favorites-item-old-price {
    font-size: 12px;
    color: #6c757d;
    text-decoration: line-through;
    margin-right: 5px;
}

.compare-item {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 15px;
}

.compare-item:last-child {
    border-bottom: none;
}

.compare-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.compare-item-content {
    flex: 1;
}

.compare-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.compare-item-price {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.compare-item-old-price {
    font-size: 12px;
    color: #6c757d;
    text-decoration: line-through;
    margin-right: 5px;
}

.quantity-controls {
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 0px;
    background: #f8f9fa;
    padding: 3px 5px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.quantity-controls button {
    background: white;
    border: 1px solid #198754;
    color: #198754;
    width: 25px;
    height: 25px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.quantity-controls button:hover {
    background: #198754;
    color: white;
}

.quantity-controls .count {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.cart-footer {
    padding: 10px 20px;
    background: white;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 10px 10px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 14px;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.btn-checkout {
    /* flex: 1; */
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
}

.btn-checkout:hover {
    background: #146c43;
}

.btn-view-cart {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-view-cart:hover {
    background: #5a6268;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #dee2e6;
}




/* language ============================================================================================================================ */
/* استایل دکمه انتخاب زبان */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 2px;
    /* height: 40px; */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    margin-left: 2px;
}

.language-btn:hover .current-language {
    color: var(--primary-color);
}

.language-btn i {
    font-size: 14px;
    top: 0 !important;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.language-btn.active .bi-chevron-down {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    margin-top: 5px;
}

.language-selector.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.language-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-item:hover {
    background-color: #f8f9fa;
}

.language-item.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.language-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.language-name {
    flex: 1;
}

.language-check {
    color: var(--primary-color);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.language-item.active .language-check {
    opacity: 1;
}

.favorites-item .favorites-btn:hover i {
    color: #ffffff !important;
}
