/**
 * Batdongsan24h.net - Modern Desktop Header Styles
 * Ultra-performance, Glassmorphism, Transparent Overlay & Sticky State
 */

/* Header Root & Wrapper */
.dx-header-desktop {
    width: 100%;
    z-index: 9999;
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                backdrop-filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

/* Home Page: Transparent Header floating on top of Hero Banner */
.dx-header-desktop.is-home-transparent {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

/* Non-home pages: Clean White Sticky Header */
.dx-header-desktop:not(.is-home-transparent) {
    position: sticky;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #f1f5f9;
}

/* Scrolled / Sticky Header Mode */
.dx-header-desktop.is-scrolled,
.dx-header-desktop.re__fix {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #f1f5f9;
    animation: dxHeaderSlideDown 0.25s ease-out;
}

@keyframes dxHeaderSlideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Container */
.dx-header-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

/* 1. Left: Logo */
.dx-header-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.dx-header-logo img {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* 2. Center: Navigation Menu */
.dx-header-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.dx-header-nav > li {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Navigation Links */
.dx-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 14.5px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    border-radius: 999px;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}
.dx-nav-link:hover {
    color: #ce050d;
    background-color: rgba(0, 0, 0, 0.04);
    text-decoration: none;
}

/* Active Pill (Trang chủ) */
.dx-nav-link.is-active,
.dx-header-nav > li.active > .dx-nav-link {
    background-color: #ce050d;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(206, 5, 13, 0.3);
}
.dx-nav-link.is-active:hover,
.dx-header-nav > li.active > .dx-nav-link:hover {
    background-color: #b5040b;
    color: #ffffff !important;
}
.dx-nav-link .dx-nav-icon {
    font-size: 14px;
}

/* Small Chevron Down */
.dx-nav-chevron {
    width: 10px;
    height: 10px;
    opacity: 0.65;
    transition: transform 0.2s ease;
}
.dx-header-nav > li:hover .dx-nav-chevron {
    transform: rotate(180deg);
}

/* Submenu Dropdown */
.dx-sub-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #ffffff;
    min-width: 210px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
}
.dx-header-nav > li:hover > .dx-sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dx-sub-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dx-sub-menu a {
    display: block;
    padding: 9px 18px;
    font-size: 13.5px;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
    line-height: 1.4;
}
.dx-sub-menu a:hover {
    background-color: #f8fafc;
    color: #ce050d;
    padding-left: 22px;
    text-decoration: none;
}

/* 3. Right: Actions */
.dx-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Yêu thích (Favorite) */
.dx-action-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
}
.dx-action-item:hover {
    color: #ce050d;
    text-decoration: none;
}

/* Tài khoản (User Dropdown) */
.dx-user-dropdown-wrap {
    position: relative;
}
.dx-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10001;
}
.dx-user-dropdown-wrap:hover .dx-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dx-user-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13.5px;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.dx-user-menu a:hover {
    background-color: #f8fafc;
    color: #ce050d;
    text-decoration: none;
}
.dx-user-menu .divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 6px 0;
}

/* User Logged-in Avatar */
.dx-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #cbd5e1;
}

/* Đăng tin miễn phí Button */
.dx-btn-post {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: #ce050d;
    color: #ffffff !important;
    padding: 9px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(206, 5, 13, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}
.dx-btn-post:hover {
    background-color: #b5040b;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(206, 5, 13, 0.45);
    text-decoration: none;
}
