@font-face {
    font-family: 'iranyekan';
    src: url('../fonts/iranyekanr.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-feature-settings: "ss02";
    font-display: swap;
}

@font-face {
    font-family: 'iranyekan';
    src: url('../fonts/iranyekanb.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-feature-settings: "ss02";
    font-display: swap;
}

.header {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1000;
}

.container {
    width: 1300px;
    max-width: 95%;
    margin: auto;
}

/* <!---------------------- ردیف بالا هدر ----------------------> */
.top-header {
    background: #F9FAF9;
    border-bottom: 1px solid var(--border, #E2E5E2);
    height: 42px;
}

.top-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.top-right ul {
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-right a {
    color: var(--text, #4D535A);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.25s ease;
}

.top-right a:hover {
    color: var(--primary, #436A49);
}

.top-left {
    display: flex;
    align-items: center;
}

.socials {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 16px;
    margin-left: 16px;
    border-left: 1px solid var(--border, #E2E5E2);
}

.socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light, #80878E);
    transition: color 0.3s ease;
}

.socials a svg {
    width: 16px;
    height: 16px;
}

.socials a:hover {
    color: var(--primary, #436A49);
}

.phone {
    font-size: 13px;
    color: var(--text, #4D535A);
    padding: 0 16px;
    margin: 0 16px;
    border-left: 1px solid var(--border, #E2E5E2);
    border-right: 1px solid var(--border, #E2E5E2);
    direction: ltr;
    display: flex;
    gap: 6px;
}

.phone strong {
    color: var(--primary, #436A49);
    font-weight: 700;
}

.icon-btn {
    display: flex;
    align-items: center;
    color: var(--text, #4D535A);
    font-size: 14px;
    text-decoration: none;
    margin-left: 5px;
    transition: color 0.25s ease;
}

.icon-btn:hover {
    color: var(--accent, #D4A359);
}

.wishlist-icon,
.compare-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* <!---------------------- ردیف اصلی هدر ----------------------> */
.main-header {
    height: 90px;
    border-bottom: 1px solid var(--border, #E2E5E2);
}

.bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-logo {
    flex-shrink: 0;
}

.logo {
    width: 115px;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

/***** بخش منو *************/
.header-menu {
    display: flex;
    align-items: center;
    flex: 1;
}

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

.mega-menu-root > li {
    position: relative;
}

.mega-menu-root > li > a {
    display: flex;
    align-items: center;
    height: 90px;
    text-decoration: none;
    color: var(--title, #2B3036);
    font-weight: 600;
    font-size: 15px;
    transition: color 0.25s ease;
    position: relative;
}

.mega-menu-root > li > a::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary, #436A49);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mega-menu-root > li:hover > a {
    color: var(--primary, #436A49);
}

.mega-menu-root > li:hover > a::before {
    transform: scaleX(1);
}

.mega-menu-root > li.menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mega-menu-root > li.menu-item-has-children > a::after {
    content: "";
    width: 5px;
    height: 5px;
    border-right: 2px solid var(--text-light, #80878E);
    border-bottom: 2px solid var(--text-light, #80878E);
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    margin-top: -3px;
}

.mega-menu-root > li.menu-item-has-children:hover > a::after {
    transform: rotate(225deg);
    border-color: var(--primary, #436A49);
}

/* زیرمنوهای سطح اول */
.mega-menu-root li ul {
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    max-height: 70vh;
    overflow: visible !important;
    background: #ffffff;
    display: none;
    z-index: 9999;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    padding: 8px 0;
    border: 1px solid var(--border, #E2E5E2);
    border-top: 2px solid var(--primary, #436A49);
}

.mega-menu-root li:hover > ul {
    display: block;
    animation: fadeInMenu 0.25s ease;
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mega-menu-root ul, 
.mega-menu-root ul li {
    list-style: none !important;
    margin: 0;
    padding-left: 0;
}

.mega-menu-root ul li {
    position: relative;
    width: 100%;
}

.mega-menu-root li ul li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text, #4D535A);
    text-decoration: none;
    transition: all 0.25s ease;
}

.mega-menu-root li ul li a:hover {
    background: #F4F7F4;
    color: var(--primary, #436A49);
    padding-right: 25px;
}

/* زیرمنوی سطح دوم (باز شدن به سمت چپ) */
.mega-menu-root ul li ul {
    top: 0;
    right: 100%;
    left: auto;
    border-radius: 12px;
    border-top: 1px solid var(--border, #E2E5E2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mega-menu-root ul li.menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--text-light, #80878E);
    border-bottom: 2px solid var(--text-light, #80878E);
    transform: rotate(135deg);
    transition: transform 0.2s ease;
    margin-right: auto;
}

.mega-menu-root ul li.menu-item-has-children:hover > a::after {
    transform: rotate(315deg);
    border-color: var(--primary, #436A49);
}

/*********************** بخش سرچ هدر *****************************/
.search-box {
    flex: 0 0 280px;
    position: relative;
}

.search-box input {
    width: 100%;
    height: 44px;
    background: #F8F9F8;
    border: 1px solid var(--border, #E2E5E2);
    border-radius: 25px;
    padding: 0 42px 0 15px;
    font-size: 13px;
    font-family: 'iranyekan';
    color: var(--text, #4D535A);
    transition: all 0.3s ease;
}

.search-box input:focus {
    background: #ffffff !important;
    border-color: var(--primary, #436A49);
    box-shadow: 0 0 0 3px rgba(67, 106, 73, 0.12);
    outline: none !important;
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light, #80878E);
    font-size: 16px;
    padding: 8px 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s;
}

.search-icon:hover {
    color: var(--primary, #436A49);
}

.search-box input[type="search"] {
    appearance: none;
    -webkit-appearance: none;
}

.search-box input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-left: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2380878E' stroke-width='2'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/14px no-repeat;
}

.search-results {
    position: absolute;
    top: 105%;
    right: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border, #E2E5E2);
    z-index: 9999;
    overflow: hidden;
}

.live-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.live-search-item {
    border-bottom: 1px solid #F0F3F0;
}

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

.live-search-item a {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--title, #2B3036);
    transition: background 0.2s;
}

.live-search-item a:hover {
    background: #F8F9F8;
}

.live-search-thumb img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border, #E2E5E2);
}

.live-search-info {
    margin-right: 12px;
    display: flex;
    flex-direction: column;
}

.live-search-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.search-results .woocommerce-Price-amount.amount {
    font-size: 14px !important;
    font-weight: 700;
    color: var(--primary, #436A49);
}

.search-results del .woocommerce-Price-amount.amount {
    font-size: 12px !important;
    color: var(--text-light, #80878E);
}

.no-result,
.search-loading {
    padding: 12px 15px;
    font-size: 13px;
    color: var(--text-light, #80878E);
    text-align: center;
}

/******************** آیکون‌های هدر و حساب کاربری **************************/
.header-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cart-header, 
.acount-header {
    position: relative;
    display: inline-block;
}

.cart-header {
    background: #F4F6F4;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #E2E5E2);
    transition: all 0.3s ease;
}

.cart-header:hover {
    border-color: var(--accent, #D4A359);
    background: #ffffff;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--title, #2B3036);
}

.cart-icon, 
.account-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cart-count {
    background: var(--accent, #D4A359);
    color: #1A1A1A;
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(212, 163, 89, 0.4);
}

.cart-header .cart-total .woocommerce-Price-amount.amount {
    font-size: 14px !important;
    font-weight: 700;
    color: var(--title, #2B3036);
}

/* دکمه ورود / عضویت شیک */
.account-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: var(--primary, #436A49);
    color: #ffffff !important;
    border: 1px solid var(--primary, #436A49);
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(67, 106, 73, 0.2);
}

.account-link svg {
    stroke: #ffffff;
    fill: none;
    width: 20px;
    height: 20px;
}

.account-text {
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
}

.account-link:hover {
    background: var(--primary-hover, #335338);
    border-color: var(--primary-hover, #335338);
    box-shadow: 0 8px 20px rgba(67, 106, 73, 0.35);
    transform: translateY(-1px);
}

/* اصلاح تداخل نمایش */
@media (min-width: 769px) {
    .mobile-header, .mobile-panel, .mobile-overlay, .top-bar-announcement {
        display: none !important;
    }
}

/********************************
       موبایل (768px↓)
********************************/
@media (max-width: 768px) {

    .top-header,
    .header-bottom,
    .main-header,
    .desktop-header {
        display: none !important;
    }

    .mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #ffffff;
        position: relative;
        border-bottom: 1px solid var(--border, #E2E5E2);
    }

    .mobile-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-logo img {
        max-width: 90px;
        height: auto;
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-header-left svg {
        display: block;
        color: var(--title, #2B3036);
        transition: 0.3s;
    }

    .mobile-header-left a, 
    .mobile-header-left button {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        line-height: 0;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        background: var(--primary, #436A49);
        border: none;
        padding: 5px 12px 5px 6px;
        cursor: pointer;
        color: #ffffff;
        border-radius: 25px;
    }

    .mobile-menu-btn i {
        font-style: normal;
        font-size: 18px;
        line-height: 1;
        background-color: #ffffff;
        border-radius: 50%;
        color: var(--primary, #436A49);
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-btn span {
        font-size: 13px;
        font-weight: 700;
        font-family: inherit;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        z-index: 9998;
    }

    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .mobile-panel {
        position: fixed;
        top: 0;
        left: 0; 
        width: 290px;
        max-width: 85%;
        height: 100%;
        background: #ffffff;
        z-index: 9999;
        transform: translateX(-101%);
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
        display: flex;
        flex-direction: column;
    }

    .mobile-panel.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    }

    .mobile-panel-top {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border-bottom: 1px solid var(--border, #E2E5E2);
    }

    .panel-search {
        flex: 1;
    }

    .panel-search input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid var(--border, #E2E5E2);
        border-radius: 8px;
        font-size: 13px;
        outline: none;
    }

    .close-panel {
        background: none;
        color: var(--text-light, #80878E);
        border: none;
        font-size: 22px;
        cursor: pointer;
    }

    .panel-tabs {
        display: flex;
        border-bottom: 1px solid var(--border, #E2E5E2);
    }

    .panel-tabs button {
        flex: 1;
        padding: 12px;
        border: none;
        background: #F8F9F8;
        color: var(--text, #4D535A);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

    .panel-tabs button.active {
        background: #ffffff;
        border-bottom: 2px solid var(--primary, #436A49);
        color: var(--primary, #436A49);
    }

    .panel-content {
        flex: 1;
        overflow-y: auto;
    }

    .tab-content {
        display: none;
    }

    .tab-content.active {
        display: block;
    }

    .mobile-menu, 
    .mobile-cats {
        list-style: none;
        padding: 0;
        margin: 0;
        display: block !important;
    }

    .mobile-menu li, 
    .mobile-cats li {
        border-bottom: 1px solid #F0F3F0;
        width: 100%;
        display: block; 
    }

    .mobile-menu li a, 
    .mobile-cats li a {
        display: block;
        padding: 14px 16px;
        color: var(--title, #2B3036) !important;
        text-decoration: none;
        font-size: 14px;
        text-align: right;
        transition: 0.25s;
    }

    .mobile-menu li a:active, 
    .mobile-cats li a:active {
        background-color: #F8F9F8;
    }

    .cat-item-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-direction: row-reverse;
        border-bottom: 1px solid #F0F3F0;
    }

    .cat-item-wrapper a {
        flex: 1;
        padding: 14px 16px;
        border-bottom: none !important;
    }

    .toggle-child {
        background: #F4F6F4;
        border: none;
        border-left: 1px solid #F0F3F0;
        width: 45px;
        height: 48px;
        cursor: pointer;
        transition: 0.3s;
        font-size: 12px;
        color: var(--text, #4D535A);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .toggle-child.open {
        transform: rotate(90deg);
        background: var(--primary, #436A49);
        color: #ffffff;
    }

    .sub-cats {
        list-style: none;
        padding: 0;
        margin: 0;
        background: #F8F9F8;
    }

    .sub-cats li a {
        display: block;
        padding: 12px 28px 12px 15px !important; 
        font-size: 13px;
        color: var(--text, #4D535A);
    }

    .sub-cats .sub-cats li a {
        padding-right: 42px !important;
        background: #ffffff;
    }

    .uder-header-mobile {
        margin: 15px;
    }
}