/* 
 * Premium Header Design - SaaS Aesthetic
 * Optimized for clarity, alignment and modern look.
 */

:root {
    --header-bg: rgba(255, 255, 255, 0.98);
    --header-height: 80px;
    --header-accent: #007bff;
    --header-accent-hover: #0069d9;
    --header-border: rgba(0, 0, 0, 0.08);
    --header-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --header-text: #1a1a1a;
    --header-text-muted: #666;
    --header-radius: 8px;
    --header-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-premium {
    width: 100%;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10000;
    transition: var(--header-transition);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.header-premium.is-sticky {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    box-shadow: var(--header-shadow);
    height: 70px;
    /* Slim down on scroll */
}

.header-inner {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 200px 1fr 240px;
    align-items: center;
    gap: 20px;
}

/* Branding */
.header-branding {
    display: flex;
    align-items: center;
}

.header-branding a {
    text-decoration: none;
    display: block;
}

.header-branding img {
    height: 48px;
    width: auto;
    display: block;
    transition: var(--header-transition);
}

.header-premium.is-sticky .header-branding img {
    height: 40px;
}

.header-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--header-accent);
    letter-spacing: -1px;
}

.header-logo-text span {
    color: var(--header-text);
}

/* Search Bar - The Centerpiece */
.header-search {
    justify-self: center;
    width: 100%;
    max-width: 680px;
}

.header-search-bar {
    background: #fff;
    border: 1px solid var(--header-border);
    border-radius: 100px;
    padding: 6px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: var(--header-transition);
}

.header-search-bar:focus-within {
    border-color: var(--header-accent);
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.1);
}

.header-search-group {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
}

.header-search-group i.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--header-accent);
    margin-right: 10px;
    opacity: 0.8;
}

.header-search-group select,
.header-search-group input[type="text"] {
    width: 100%;
    border: none !important;
    background: transparent !important;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--header-text);
    padding: 10px 0 !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
    cursor: pointer;
}

.header-search-group input[type="text"] {
    cursor: text;
}

.search-dentista-wrap {
    position: relative;
    overflow: visible !important;
}

/* Autocomplete Results */
.header-search-results {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid var(--header-border);
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.autocomplete-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--header-transition);
}

.autocomplete-suggestion:hover {
    background: var(--header-accent);
    color: #fff;
}

.autocomplete-suggestion:hover span {
    color: #fff;
}

.autocomplete-suggestion img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.autocomplete-suggestion span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--header-text);
}

.suggestion-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggestion-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--header-text);
}

.suggestion-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--header-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-info {
    font-size: 0.8rem;
    color: var(--header-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.autocomplete-suggestion:hover .suggestion-name,
.autocomplete-suggestion:hover .suggestion-meta,
.autocomplete-suggestion:hover .suggestion-info {
    color: #fff;
}

.header-search-divider {
    width: 1px;
    height: 24px;
    background: var(--header-border);
}

.header-search-submit {
    background: var(--header-accent);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--header-transition);
    margin-left: 6px;
}

.header-search-submit:hover {
    background: var(--header-accent-hover);
    transform: scale(1.05);
}

.header-search-submit i {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Actions Section */
.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-link-login {
    text-decoration: none;
    color: var(--header-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    transition: var(--header-transition);
}

.header-link-login:hover {
    color: var(--header-accent);
}

.header-btn-register {
    text-decoration: none;
    background: var(--header-text);
    color: #fff;
    padding: 11px 24px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--header-transition);
}

.header-btn-register:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Logged In User */
.header-user {
    position: relative;
    cursor: pointer;
}

.header-user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    background: #f8f9fa;
    border: 1px solid var(--header-border);
    border-radius: 100px;
    transition: var(--header-transition);
}

.header-user-trigger:hover {
    border-color: var(--header-accent);
    background: #fff;
}

.header-user-trigger img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.header-user-trigger span {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--header-text);
}

.header-user-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #fff;
    border: 1px solid var(--header-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 10px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--header-transition);
}

.header-user:hover .header-user-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.header-user-menu a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--header-text);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--header-transition);
}

.header-user-menu a:hover {
    background: #f8f9fa;
    color: var(--header-accent);
}

/* Mobile Toggle */
.header-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--header-text);
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
    .header-inner {
        grid-template-columns: 160px 1fr 200px;
        padding: 0 20px;
    }
}

@media (max-width: 991px) {
    .header-inner {
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .header-search {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 15px;
    }

    .header-actions {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 15px;
    }

    .header-premium.mobile-menu-open {
        height: auto;
        padding-bottom: 20px;
    }

    .header-premium.mobile-menu-open .header-search,
    .header-premium.mobile-menu-open .header-actions {
        display: flex;
        flex-direction: column;
    }

    .header-search-bar {
        flex-direction: column;
        border-radius: 12px;
        padding: 10px;
    }

    .header-search-group {
        width: 100%;
        padding: 10px;
    }

    .header-search-divider {
        width: 100%;
        height: 1px;
        margin: 5px 0;
    }

    .header-search-submit {
        width: 100%;
        border-radius: 8px;
        margin-top: 10px;
        margin-left: 0;
    }

    .header-auth {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .header-auth a {
        width: 100%;
        text-align: center;
    }

    .header-user {
        width: 100%;
    }

    .header-user-trigger {
        justify-content: center;
    }

    .header-user-menu {
        position: relative;
        top: 0;
        width: 100%;
        box-shadow: none;
        border: 1px solid var(--header-border);
        margin-top: 10px;
        text-align: center;
    }

    .header-mobile-toggle {
        display: block;
    }
}

@media (max-width: 480px) {
    .header-branding img {
        height: 36px;
    }
}