/* Header */
/* Top */
.header-wrapper {
    margin: 0;
}

.header__container {
    background-color: #000;
    padding: 0 0.5rem;
    border-bottom-left-radius: 1.3rem;
    border-bottom-right-radius: 1.3rem;
    display: flex;
    justify-content: space-between;
}

.header {
    margin: 0;
    color: #f0f0f1;
}

.header__right,
.header__left {
    display: flex;
}

.header-logo {
    width: 70px;
    height: 70px;
    margin-left: 1.5rem;
}

.header-login {
    font-size: 1rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: all 0.6s;
}

.header-login:hover {
    color: var(--text-color-hover);
}

/* Menu */
.menu__container {
    display: flex;
}

.menu__item-icon {
    width: 25px;
    height: 25px;
}

.menu__item-container {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 1rem;
    color: #ccc;
    transition: all 0.6s;
}

.menu__item-container:last-child {
    margin-left: 1.5rem;
}

.menu__item-container a {
    white-space: nowrap;
}

.menu__item-container:hover {
    color: #1242FF;
}

.menu__item-container img {
    margin-left: 0.5rem;
}

/* Middle */
.header-middle__logo-container {
    /* For a tag */
    display: block;
    width: 90px;
    height: 90px;
}

/* Search */
/* ساختار کلی سرچ */
.header__search-container {
    position: relative;
    /* مهم برای dropdown */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

/* استایل ورودی جستجو */
.header-middle__search {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 2px solid var(--primary-border-color);
    border-radius: 1rem;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-middle__search:focus {
    border-color: #222;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15);
}

/* آیکون ذره‌بین */
.header__search-container i.fa-magnifying-glass {
    position: absolute;
    right: 10px;
    font-size: 16px;
    color: #888;
    pointer-events: none;
}

/* منوی نتایج */
.header__search-container>div[x-show] {
    position: absolute;
    top: calc(80%);
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    overflow: hidden;
}

/* هر مورد در نتایج */
.search-img {
    width: 85px;
    border-radius: 0.8rem;
}

.header__search-container a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #ddd;
    text-decoration: none;
    transition: background-color 0.2s;
}

.header__search-container a:last-child {
    border: none;
}

.header__search-container a:hover {
    background-color: #000;
}

/* پیام "موردی یافت نشد" */
.header__search-container div.text-gray-500 {
    padding: 10px 14px;
    font-size: 13px;
    color: #777;
}

/* برای ظاهر شدن نرم‌تر (x-transition) */
[x-cloak] {
    display: none !important;
}

/* End Search */
/* Mobile Search */
.header-mobile__search {
    margin-left: 0.8rem;
}

/* Modal Backdrop */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 30px;
    /* مودال از بالا فاصله داشته باشد */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 9999;
}

/* فعال شدن مودال */
.search-modal.active {
    opacity: 1;
    pointer-events: all;
}

/* Search Box */
.search-modal__content {
    width: 92%;
    max-width: 540px;
    /* background: #fff; */
    color: var(--text-color-500);
    border-radius: 16px;
    padding: 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;

    /* انیمیشن ورود */
    transform: translateY(-30px);
    opacity: 0;
    transition: all 0.28s cubic-bezier(.18, .89, .32, 1.28);
}

.search-modal.active .search-modal__content {
    transform: translateY(0);
    opacity: 1;
}

/* Close button */
.search-modal__close {
    background: transparent;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

/* Input */
.search-modal__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
}

/* این کانتینر همان باید هم‌عرض همان کادر سفید بزرگ باشد */
.mobile-search-container {
    position: relative;
    width: 100%;
}

/* input هم‌عرض container */
.mobile-search-input {
    width: 100%;
    padding: 12px 14px;
    color: var(--text-color-900);
    border: 1px solid #ddd;
    border-radius: 14px;
    background: #fff;
}

/* نتایج دقیقا هم‌عرض container (یعنی همان کادر بزرگ سفید بالا) */
.mobile-search-results {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 100%;
    /* ← کل عرض کادر بزرگ */

    background: #fff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);

    max-height: 260px;
    overflow-y: auto;
    z-index: 9999;
}

/* آیتم‌ها */
.mobile-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
}

.mobile-search-item:hover {
    background: #f5f5f5;
}

.mobile-search-thumb {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    object-fit: cover;
}

.mobile-search-title {
    font-size: 14px;
    font-weight: 500;
}

/* End Moblie Search */
/* User */
.header__user {
    margin: 0 1.2rem;
}

/* End User */
/* Cart */
.header__cart-img {
    width: 40px;
    height: 40px;
}

.header__cart-container {
    margin-left: 1.5rem;
}

/* End Cart */
.header__auth-btn {
    /* For use padding & margin */
    display: block;
    /* ------------------------ */
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--primary-border-color);
    color: #fff;
}

/* Bottom */
.header-bottom {
    background: var(--background-color);
    padding: 0.2rem 3rem;
    -webkit-box-shadow: 0px 9px 15px -1px rgba(0, 0, 0, 0.67);
    box-shadow: 0px 9px 15px -1px rgba(0, 0, 0, 0.67);
}

/* Sticky Header */
@keyframes fixedHeader {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.sticky-header {
    width: 100%;
    display: block;
}

.sticky-header.fixed {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1040;
    /* مثل حالت عادی */
    box-sizing: border-box;
    animation: fixedHeader .3s cubic-bezier(.22, 1, .36, 1);
    animation-timing-function: ease-out;
    -webkit-box-shadow: 0px 9px 15px -1px rgba(0, 0, 0, 0.67);
    box-shadow: 0px 9px 15px -1px rgba(0, 0, 0, 0.67);
}

.sticky-placeholder {
    height: 0;
}

.header-bottom__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-navbar__container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;

}

.header-navbar__item {
    color: var(--text-color-500);
    font-size: 0.9rem;
    margin-right: 1.2rem;
}

.header-navbar__item:hover {
    color: var(--text-color-hover);
}

.header-navbar__left-container {
    display: flex;
    align-items: center;
    margin: 0.5rem;
}

/* Profile & DropDown */
.header-user__item-container {
    /* برای اینکه زیرمنو داشته باشد */
    position: relative;
}

/* زیرمنو */
.header-user__dropdown {
    padding: 0.5rem 0;
    background: var(--primary-color);
    border: 1px solid var(--primary-border-color);
    border-radius: 0.875rem;
    position: absolute;
    text-align: right;
    top: 2.5rem;
    /* right: 0; */
    left: 0;
    width: 150px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
    /* opacity: 0; */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.header-user__item-container:hover .header-user__dropdown {
    opacity: 1;
    visibility: visible;
}

/* آیتم‌های زیرمنو */
.header-user__dropdown-item-container {
    border-bottom: 1px solid var(--primary-border-color);
}

.header-user__dropdown-item-container:last-child {
    border-bottom: none;
}

.header-user__dropdown-item {
    display: block;
    color: var(--text-color-500);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 8px 15px;
    transition: background 0.3s ease, color 0.3s ease;
}

.header-user__dropdown-item:hover {
    color: var(--text-color-hover);
}

/* End Profile & DropDown */

/* Header & DropDown */
.header-navbar__item-container {
    position: relative;
}

/* زیرمنو */
.header-navbar__dropdown {
    padding: 0.5rem 0;
    background: var(--secondary-color);
    border: 1px solid var(--primary-border-color);
    border-radius: 0.875rem;
    position: absolute;
    text-align: right;
    top: 2.5rem;
    right: 0;
    width: 250px;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* opacity: 0; */
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.header-navbar__item-container:hover .header-navbar__dropdown {
    opacity: 1;
    visibility: visible;
}

/* آیتم‌های زیرمنو */
.header-navbar__dropdown-item-container {
    border-bottom: 1px solid var(--primary-border-color);
}

.header-navbar__dropdown-item-container:last-child {
    border-bottom: none;
}

.header-navbar__dropdown-item {
    display: block;
    color: var(--text-color-900);
    font-size: 1rem;
    white-space: nowrap;
    padding: 8px 15px;
    transition: background 0.3s ease, color 0.3s ease;
}

.header-navbar__dropdown-item:hover {
    color: var(--text-color-hover);
}

.header-user__item,
.header-favorite,
.header-cart__item {
    color: var(--text-color-500);
    font-size: 1.6rem;
    margin-right: 1rem;
    position: relative;
}

.header-user__item:hover {
    color: var(--text-color-hover);
}

.header-favorite:hover i {
    color: var(--text-color-hover);
}

.header-favorite:hover span,
.header-cart:hover span {
    color: var(--text-color-900);
}

.header-count-number {
    position: absolute;
    top: -0.3rem;
    left: -0.8rem;
    background: var(--text-color-hover);
    color: var(--text-color-500);
    font-size: 1.1rem;
    font-weight: 600;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    text-align: -webkit-center;
}

/* ====================
Mobile
=======================*/
/* The side navigation menu */
.sidenav {
    height: 100%;
    /* 100% Full-height */
    width: 0;
    /* 0 width - change this with JavaScript */
    position: fixed;
    /* Stay in place */
    z-index: 1060;
    /* Stay on top */
    top: 0;
    /* Stay at the top */
    left: 0;
    backdrop-filter: blur(25px) saturate(150%);
    -webkit-backdrop-filter: blur(25px) saturate(150%);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow-x: hidden;
    /* Disable horizontal scroll */
    padding-top: 4rem;
    transition: 0.5s;
    /* 0.5 second transition effect to slide in the sidenav */
}

/* The navigation menu links */
.sidenav a {
    padding: 8px 1.5rem 8px 32px;
    text-decoration: none;
    font-size: 1.3rem;
    color: var(--text-color-500);
    display: flex;
    gap: 1rem;
    transition: 0.3s;
}

/* When you mouse over the navigation links, change their color */
.sidenav a:hover {
    color: var(--text-color-500);
}

/* Position and style the close button (top right corner) */
.sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

/* Style page content - use this if you want to push the page content to the right when you open the side navigation */
#main {
    transition: margin-left .5s;
    padding: 20px;
}

/* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
@media screen and (max-height: 450px) {
    .sidenav {
        padding-top: 15px;
    }

    .sidenav a {
        font-size: 18px;
    }
}

/* Accordion */
.submenu {
    max-height: 0;
    /* ارتفاع اولیه زیرمنو صفر است */
    overflow: hidden;
    /* برای مخفی کردن محتوای اضافی */
    transition: max-height 0.6s ease;
    /* انیمیشن نرم برای باز و بسته شدن */
    background-color: #f0f0f1;
    /* استایل اختیاری */
    padding-left: 20px;
    /* تورفتگی برای زیرمنو */
}

.submenu a {
    color: var(--text-color-900);
    font-size: 1rem;
    text-decoration: none;
    display: block;
    padding: 0.5rem 2.5rem;
}

.submenu a:hover {
    color: var(--text-color-500);
}

.submenu.open {
    max-height: 500px;
    /* مقدار بزرگ‌تر از ارتفاع پیش‌بینی‌شده زیرمنو */
}

/* Search */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 25px;
    max-height: 300px;
    overflow: hidden;
    display: none;
    z-index: 1000;
}

#mobile-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 25px;
    max-height: 300px;
    overflow: hidden;
    display: none;
    z-index: 1000;
}

#search-results p {
    padding: 10px;
    margin: 0;
    font-size: 1rem;
    color: var(--text-color-900);
    cursor: pointer;
}

#mobile-search-results p {
    padding: 10px;
    margin: 0;
    cursor: pointer;
}

#search-results p:hover {
    background-color: #f0f0f0;
}

#mobile-search-results p:hover {
    background-color: #f0f0f0;
}

#search-results .search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
}

#mobile-search-results .search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
}

#search-results .search-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 10px;
}

#mobile-search-results .search-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 10px;
}

#search-results .search-item a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

#mobile-search-results .search-item a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

#search-results .search-item:hover {
    background-color: #f0f0f0;
}

#mobile-search-results .search-item:hover {
    background-color: #f0f0f0;
}

/* ====================
Media Query
=======================*/
/* Tablet & Mobile (width between 768px and 1200px) */
@media(max-width:1199px) {

    /* Mobile Search */
    .header-middle {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 2;
        padding: 0.5rem 0.5rem;
    }

    .header__search-container {
        margin: 0;
    }

    .header-middle__search {
        font-size: 1rem;
    }

    .header-middle__right {
        width: 100%;
    }

    /* Mobile Navbar */
    .navbar-mobile {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        display: flex;
        z-index: 1050;
        justify-content: space-evenly;
        padding: 0.5rem 0.5rem;
        backdrop-filter: blur(25px) saturate(150%);
        -webkit-backdrop-filter: blur(25px) saturate(150%);
        background: rgba(0, 0, 0, 0.25);
        border-radius: 3rem;
        border: 1px solid rgba(255, 255, 255, 0.15);

    }

    .navbar-mobile__img-container {
        position: relative;
        width: 30px;
        margin-bottom: 0.5rem;
    }

    .navbar-mobile__item {
        display: flex;
        /* ایکون ها و متن زیر هم */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        /* --------- */
        font-size: 0.7rem;
        color: var(--text-color-500);
    }

    .navbar-mobile__item p {
        margin: 0;
        font-weight: 600;
    }

    .navbar-mobile__number {
        position: absolute;
        top: -0.4rem;
        left: -0.7rem;
        color: var(--text-color-500);
        font-size: 1rem;
        font-weight: 600;
        width: 1.3rem;
        height: 1.3rem;
        border-radius: 50%;
        text-align: -webkit-center;
        background-color: var(--text-color-hover);
    }

    .is-disabled {
        opacity: .5;
        pointer-events: none;
    }

    /* Social */
    .sideNav-social {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 2rem;
    }

    .sideNav-social a {
        font-size: 2rem;
    }

    /* Main */
    .main {
        margin-top: 1.5rem;
    }
}

/* Desktop */
@media (min-width:1500px) {
    .header__search-container {
        width: 330px;
        margin: 0 auto;
    }
}