/* Site header (scoped to avoid affecting other <header> tags) */
.site-header {
    background-color: #fff;
    /* ensure dropdowns always render above page content */
    z-index: 3000;
    isolation: isolate;
}

.site-header .custom-logo-link img {
    max-height: 44px;
    width: auto;
    height: auto;
    display: block;
}

/* Desktop menu (TOP LEVEL ONLY) */
.site-header .site-nav--desktop > ul {
    display: flex;
    list-style: none;
    gap: 28px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.site-header nav a {
    color: #374151; /* gray-700 */
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.site-header nav a:hover,
.site-header nav a:focus {
    color: #2563eb; /* blue-600 */
}

.site-header .current-menu-item > a,
.site-header .current_page_item > a {
    color: #1d4ed8; /* blue-700 */
}

/* Make sure sub-menus are NOT forced into flex by top-level rules */
.site-header .site-nav--desktop ul ul {
    display: none;
}

/* "اكتشف منتجاتنا" button style (DESKTOP ONLY) */
.site-header .site-nav--desktop .ep-products-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: #2563eb;
    color: #fff !important;
    font-weight: 800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid rgba(37,99,235,0.25);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.site-header .site-nav--desktop .ep-products-btn:hover,
.site-header .site-nav--desktop .ep-products-btn:focus {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.18);
}

/* dropdown container inside header (DESKTOP) */
.site-header .site-nav--desktop .menu-item-has-children > ul.sub-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 4000;
    background: #fff;
    min-width: 260px;
    padding: 8px 0;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    /* allow the dropdown itself to scroll on desktop */
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 110px);
    overscroll-behavior: contain;
}

.site-header .site-nav--desktop .menu-item-has-children {
    position: relative;
}
.site-header .site-nav--desktop .menu-item-has-children > ul.sub-menu li a {
    display: block;
    padding: 10px 16px;
}
.site-header .site-nav--desktop .menu-item-has-children > ul.sub-menu li a:hover {
    background: #eff6ff;
}

/* Click-only dropdown on desktop:
   - disable hover open
   - open only when JS adds .ep-open
*/
.site-header .site-nav--desktop .menu-item-has-children:hover > ul {
    display: none !important;
}
.site-header .site-nav--desktop .menu-item-has-children.ep-open > ul {
    display: block !important;
}

/* Mobile: keep link readable (no white text on white background) */
.site-header .site-nav--mobile .ep-products-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb !important;
    border: 1px solid #bfdbfe;
}

/* لجعل الهيدر متجاوب */
@media (max-width: 1024px) {
    .site-header .site-nav--desktop > ul {
        gap: 18px;
    }
}

@media (max-width: 768px) {
    /* Mobile menu is handled in header-mobile.css */
}

@media (max-width: 480px) {
    .site-header .custom-logo-link img {
        max-height: 40px;
    }
}