/* ========================================
   تصميم الهيدر - دار المودة
   ======================================== */

:root {
    --header-primary: #123554;
    --header-secondary: #9b001d;
    --header-accent: #2a4d68;
    --header-white: #ffffff;
}

.dar-almawada-header {
    background: linear-gradient(135deg, var(--header-primary) 0%, var(--header-accent) 100%);
    box-shadow: 0 4px 20px rgba(18, 53, 84, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    font-family: 'Cairo', sans-serif;
}

.dar-almawada-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--header-secondary) 0%, var(--header-primary) 50%, var(--header-secondary) 100%);
}

.dar-header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.dar-site-branding {
    flex-shrink: 0;
}

.dar-site-branding a,
.dar-site-branding .custom-logo-link {
    display: inline-block;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
}

.dar-site-branding a:hover,
.dar-site-branding .custom-logo-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.dar-site-branding img,
.dar-site-branding .custom-logo {
    max-height: 80px;
    height: auto;
    width: auto;
    max-width: 250px;
    display: block;
    object-fit: contain;
}

.dar-site-branding .site-title {
    color: var(--header-white);
    font-size: 28px;
    font-weight: 800;
    margin: 0;
}

.dar-main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.dar-menu-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dar-menu-items li {
    position: relative;
    margin: 0;
}

.dar-menu-items > li > a {
    color: var(--header-white);
    font-weight: 600;
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dar-menu-items > li > a:hover,
.dar-menu-items > li > a:focus {
    background: var(--header-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 0, 29, 0.4);
}

.dar-menu-items li.current-menu-item > a,
.dar-menu-items li.current_page_item > a,
.dar-menu-items li.current-menu-ancestor > a,
.dar-menu-items li.current_page_ancestor > a {
    background: var(--header-secondary);
    box-shadow: 0 2px 8px rgba(155, 0, 29, 0.3);
}

.dar-menu-items .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--header-white);
    border: 2px solid var(--header-secondary);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    list-style: none;
    margin: 0;
    padding: 10px 0;
}

.dar-menu-items li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dar-menu-items .sub-menu li {
    width: 100%;
}

.dar-menu-items .sub-menu a {
    color: var(--header-primary);
    padding: 12px 24px;
    font-size: 15px;
    display: block;
    border-bottom: 1px solid rgba(18, 53, 84, 0.1);
    background: transparent;
    border-radius: 0;
}

.dar-menu-items .sub-menu li:last-child a {
    border-bottom: none;
}

.dar-menu-items .sub-menu a:hover {
    background: var(--header-secondary);
    color: var(--header-white);
    transform: translateX(-5px);
}

.dar-search-only {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.dar-search-toggle {
    background: var(--header-secondary);
    border: 2px solid var(--header-white);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--header-white);
}

.dar-search-toggle:hover {
    background: var(--header-white);
    color: var(--header-secondary);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dar-search-toggle svg {
    width: 24px;
    height: 24px;
}

.dar-search-wrap {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    background: var(--header-white);
    border: 3px solid var(--header-secondary);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    min-width: 350px;
    z-index: 101;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dar-search-wrap.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dar-search-wrap form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dar-search-wrap input[type="search"] {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid var(--header-primary);
    border-radius: 25px;
    font-size: 15px;
    font-family: 'Cairo', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.dar-search-wrap input[type="search"]:focus {
    border-color: var(--header-secondary);
    box-shadow: 0 0 0 4px rgba(155, 0, 29, 0.1);
}

.dar-search-wrap button {
    background: var(--header-secondary);
    color: var(--header-white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.dar-search-wrap button:hover {
    background: var(--header-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(18, 53, 84, 0.3);
}

@media (max-width: 1024px) {
    .dar-header-wrapper {
        padding: 12px 20px;
        gap: 20px;
    }
    
    .dar-menu-items {
        gap: 4px;
    }
    
    .dar-menu-items > li > a {
        padding: 10px 16px;
        font-size: 15px;
    }
    
    .dar-site-branding img,
    .dar-site-branding .custom-logo {
        max-height: 70px;
    }
}

@media (max-width: 768px) {
    .dar-header-wrapper {
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 15px;
    }
    
    .dar-site-branding {
        order: 1;
    }
    
    .dar-search-only {
        order: 2;
    }
    
    .dar-main-navigation {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .dar-menu-items {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }
    
    .dar-menu-items > li > a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .dar-site-branding img,
    .dar-site-branding .custom-logo {
        max-height: 55px;
    }
    
    .dar-search-toggle {
        width: 44px;
        height: 44px;
    }
    
    .dar-search-wrap {
        min-width: 280px;
        left: auto;
        right: 0;
    }
}

@media (max-width: 480px) {
    .dar-menu-items > li > a {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .dar-search-wrap {
        min-width: 100%;
        left: 0;
        right: 0;
    }
}