
/* ===== بنر بالا ===== */
.top-header-banner { width: 100%; }
.top-header-banner img { width: 100%; height: auto; display: block; }


/* ===== Header Base ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
}

.header-bg {
    background: #f9f9f9;
    border-bottom: 1px solid #e5e5e5;
    width: 100%;
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 90px 180px minmax(320px, 1fr) 180px;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
}

/* ===== Category Button ===== */
.header-categories {
    display: flex;
    align-items: center;
}

.category-btn {
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: IRANSans, sans-serif;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: #ef394e;
}

.category-icon {
    font-size: 18px;
    line-height: 1;
}

.category-label {
    font-size: 14px;
}

/* ===== Logo ===== */
.header-logo {
    display: flex;
    align-items: center;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo img {
    max-height: 52px;
    width: auto;
    display: block;
}

.site-name {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

/* ===== Search ===== */
.header-search {
    width: 100%;
}

/* ===== Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.header-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
}

.cart-count {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 20px;
    background: #ef394e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-family: IRANSans, sans-serif;
}

.login-button {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    background: #ef394e;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    font-family: IRANSans, sans-serif;
}

.login-button:hover {
    color: #fff;
}

/* ===== اکشن‌ها ===== */

/* ===== جستجو ===== */

.adv-search-wrap {
    position: relative;
    width: 100%;
}

.adv-search-wrap input[type="text"] {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    height: 44px;
    background: #fff;
    font-family: IRANSans, sans-serif;
    box-sizing: border-box;
}

.adv-search-wrap input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

#advanced-search-results,
#advanced-search-results-mobile {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 999;
    max-height: 360px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ===== جستجوی موبایل (پیش‌فرض مخفی) ===== */
.header-mobile-search { display: none; }

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

    .header-inner {
        grid-template-columns: 48px 1fr auto;
        gap: 10px;
        padding: 10px 12px;
    }

    /* Column Positions */
    .header-categories {
        grid-column: 1;
    }

    .header-logo {
        grid-column: 2;
        justify-content: center;
    }

    .header-actions {
        grid-column: 3;
        gap: 8px;
    }

    /* Hide Desktop Search */
    .desktop-search {
        display: none;
    }

    /* Show Mobile Search */
    .header-mobile-search {
        display: block;
        max-width: 1300px;
        margin: 0 auto;
        padding: 0 12px 12px;
    }

    /* Hide Text Labels */
    .category-label,
    .login-label {
        display: none;
    }

    /* Compact Buttons */
    .category-btn,
    .login-button {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
    }

    .header-logo img {
        max-height: 42px;
    }
}

/* =========================
   Desktop Mega Menu
========================= */

.mega-menu-shell {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 9999;
    display: none;
}

.mega-menu-panel {
    max-width: 1300px;
    margin: 10px auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,.12);
    display: grid;
    grid-template-columns: 260px 1fr;
    overflow: hidden;
    min-height: 500px;
}

/* ستون راست */
.mega-menu-sidebar {
    background: #f8f8f8;
    border-left: 1px solid #eee;
    max-height: 500px;
    overflow-y: auto;
}

.mega-menu-category {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    padding: 16px 20px;
    cursor: pointer;
    font-family: IRANSans, sans-serif;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.mega-menu-category:hover {
    background: #fff;
    color: #ef394e;
}

/* ستون چپ */
.mega-menu-content {
    padding: 30px;
    background: #fff;
}

.mega-menu-placeholder {
    color: #777;
    font-size: 14px;
}

/* =========================
   Mobile Drawer
========================= */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    max-width: 90%;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transition: right .25s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu-header {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    font-weight: 700;
}

.mobile-menu-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

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

.mobile-menu-category {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 1px solid #eee;
    background: #fff;
    text-align: right;
    font-family: IRANSans, sans-serif;
    cursor: pointer;
}

/* Active States */
.mega-menu-shell.active {
    display: block;
}

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

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

/* Mobile */
@media (max-width: 768px) {
    .mega-menu-shell {
        display: none !important;
    }
}

