/**
 * Header Styles
 */

/* Site Header - Default white background */
.hvn-theme-site-header {
    background: var(--hvn-theme-color-white, #ffffff);
    box-shadow: var(--hvn-theme-header-shadow);
    position: sticky;
    top: 0;
    z-index: var(--hvn-theme-z-sticky);
    width: 100%;
}

/* When header image is set, override background */
.hvn-theme-site-header.has-header-image {
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Header Inner */
.hvn-theme-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hvn-theme-space-lg);
    min-height: var(--hvn-theme-header-height);
    padding: var(--hvn-theme-space-sm) 0;
}

/* Site Branding */
.hvn-theme-site-branding {
    flex-shrink: 0;
}
.hvn-theme-custom-logo a {
    display: inline-block;
}
.hvn-theme-custom-logo img {
    max-height: 50px;
    width: auto;
}
.hvn-theme-site-title {
    font-size: var(--hvn-theme-font-size-2xl);
    font-weight: var(--hvn-theme-font-weight-bold);
    margin: 0;
    line-height: 1.2;
}

.hvn-theme-site-title a {
    color: var(--hvn-theme-text-primary);
    text-decoration: none;
}

.hvn-theme-site-title a:hover {
    color: var(--hvn-theme-brand-primary);
}

/* Header Actions */
.hvn-theme-header-actions {
    display: flex;
    align-items: center;
    gap: var(--hvn-theme-space-md);
}
.hvn-theme-header-actions button, .hvn-theme-header-actions button:hover, .hvn-theme-header-actions button:focus , .hvn-theme-header-actions button:active {
    background-color: transparent;
}
/* Search Toggle */
.hvn-theme-search-toggle {
    background: none;
    border: none;
    padding: var(--hvn-theme-space-sm);
    cursor: pointer;
    color: var(--hvn-theme-text-primary);
    transition: color var(--hvn-theme-transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.hvn-theme-search-toggle:hover,
.hvn-theme-search-toggle:focus {
    color: var(--hvn-theme-brand-primary);
    background: var(--hvn-theme-color-gray-100);
}

.hvn-theme-search-toggle svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   SEARCH MODAL - IMPROVED DESIGN
   ============================================ */

.hvn-theme-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.hvn-theme-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hvn-theme-search-overlay-inner {
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: searchFadeInUp 0.4s ease;
}

@keyframes searchFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Close Button */
.hvn-theme-search-close {
    position: absolute;
    top: -70px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hvn-theme-search-close:hover {
    background: var(--hvn-theme-brand-primary);
    transform: rotate(90deg);
}

/* Search Form */
.hvn-theme-search-overlay .search-form {
    display: flex;
    gap: 15px;
    background: transparent;
    flex-wrap: wrap;
}

.hvn-theme-search-overlay .search-form label {
    flex: 1;
    min-width: 200px;
}

.hvn-theme-search-overlay .search-field {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.125rem;
    border: none;
    border-radius: 60px;
    background: white;
    color: var(--hvn-theme-text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hvn-theme-search-overlay .search-field:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--hvn-theme-brand-primary), 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.hvn-theme-search-overlay .search-field::placeholder {
    color: #aaa;
    font-style: italic;
}

.hvn-theme-search-overlay .search-submit {
    padding: 0 32px;
    background: var(--hvn-theme-brand-primary);
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(108, 96, 254, 0.3);
}

.hvn-theme-search-overlay .search-submit::before {
    content: "🔍";
    font-size: 1rem;
}

.hvn-theme-search-overlay .search-submit:hover {
    background: var(--hvn-theme-brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 96, 254, 0.4);
}

/* Search suggestions */
.hvn-theme-search-suggestions {
    margin-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.hvn-theme-search-suggestions a {
    color: white;
    text-decoration: none;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin: 0 5px;
    display: inline-block;
    transition: all 0.2s ease;
}

.hvn-theme-search-suggestions a:hover {
    background: var(--hvn-theme-brand-primary);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE SEARCH MODAL
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
    .hvn-theme-search-overlay-inner {
        width: 95%;
    }
    
    .hvn-theme-search-close {
        top: -60px;
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .hvn-theme-search-overlay .search-field {
        padding: 14px 20px;
        font-size: 1rem;
    }
    
    .hvn-theme-search-overlay .search-submit {
        padding: 0 24px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .hvn-theme-search-overlay {
        align-items: flex-start;
        padding-top: 100px;
    }
    
    .hvn-theme-search-overlay-inner {
        width: 90%;
    }
    
    .hvn-theme-search-close {
        top: -50px;
        right: 0;
        width: 36px;
        height: 36px;
    }
    
    .hvn-theme-search-overlay .search-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .hvn-theme-search-overlay .search-field {
        padding: 14px 18px;
        font-size: 0.95rem;
        border-radius: 50px;
    }
    
    .hvn-theme-search-overlay .search-submit {
        padding: 12px 20px;
        justify-content: center;
        width: 100%;
        border-radius: 50px;
    }
    
    .hvn-theme-search-suggestions {
        margin-top: 20px;
    }
    
    .hvn-theme-search-suggestions a {
        padding: 4px 10px;
        font-size: 0.75rem;
        margin: 3px;
    }
}

/* Mobile Header Adjustments */
@media (max-width: 991px) {
    .hvn-theme-header-inner {
        min-height: var(--hvn-theme-header-height-mobile);
    }
    
    .hvn-theme-site-title {
        font-size: var(--hvn-theme-font-size-xl);
    }
}

/* Sticky Header Animation */
.hvn-theme-site-header.header-hidden {
    transform: translateY(-100%);
    transition: transform var(--hvn-theme-transition-base);
}

.hvn-theme-site-header.header-visible {
    transform: translateY(0);
}