/* Leon Dio Global Header Styles - 100% Original from Home Page */

/* ── CSS Variables (global — available on ALL pages, not just home) ── */
:root {
    --primary: #c5a059;
    --primary-light: #d4b882;
    --secondary: #1a1a1a;
    --text-dark: #222222;
    --text-muted: #666666;
    --white: #ffffff;
    --bg-light: #f9f9f9;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
    --font-heading: 'Playfair Display', serif;
    --header-bg: rgba(26, 26, 26, 0.88);
    --glass: rgba(26, 26, 26, 0.95);
}

/* Standard scrollbar logic - No !important patching */
html {
    overflow-y: scroll;
    height: auto;
}
body {
    overflow: visible;
    height: auto;
    margin: 0;
}

#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 100;
    padding: 0;
    height: 92px;
    transition: all 0.4s ease;
    background: var(--header-bg);
    display: flex;
    align-items: center;
}

#main-header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    flex: 0 0 auto;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

.logo span {
    display: none;
}

.nav-links {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 35px;
}

.nav-links li {
    position: relative;
}

.nav-links li a {
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    position: relative;
    padding: 10px 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
}

/* Sub-menu (Cấp 2) */
.nav-links .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(26, 26, 26, 0.95);
    min-width: 235px;
    padding: 15px 0;
    margin: 0;
    list-style: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-top: 2px solid var(--primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-links li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-links .sub-menu li {
    width: 100%;
    padding: 0;
}

.nav-links .sub-menu li a {
    padding: 12px 25px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: none;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links .sub-menu li a:hover {
    background: rgba(197, 160, 89, 0.1);
    color: var(--primary);
    padding-left: 30px;
}

/* Indicator cho mục có con */
.menu-item-has-children > a::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 8px;
    font-size: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-actions a {
    font-size: 18px;
    color: var(--white);
    text-decoration: none;
    position: relative;
}

.cart-btn {
    display: inline-flex;
    align-items: center;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--primary);
    color: var(--white);
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* Override parent theme hello-elementor/style.css:431 */
button:hover,
button:focus,
[type=submit]:hover,
[type=submit]:focus,
[type=button]:hover,
[type=button]:focus {
    background-color: unset;
    color: unset;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 4px 8px;
    font-size: 24px;
    cursor: pointer;
    color: var(--white);
    transition: var(--transition);
    z-index: 1001;
    -webkit-appearance: none;
    appearance: none;
}
.menu-toggle:hover,
.menu-toggle:focus,
.menu-toggle:active {
    background: none;
    outline: none;
    color: var(--primary);
}

/* Transparency logic - Original from home page */
.page-template-page-leon-dio-home #main-header:not(.sticky) {
    background: transparent;
    box-shadow: none;
}

#main-header.sticky {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Admin Bar Fix */
body.admin-bar #main-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #main-header {
        top: 46px;
    }
}

/* Fix overlapping content — áp dụng cho tất cả trang trừ home template */
body:not(.page-template-page-leon-dio-home) {
    padding-top: 92px;
}

/* Search Overlay Styles (Original) */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(26, 26, 26, 0.98);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-close {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 30px;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.search-overlay-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.search-overlay-content {
    width: 100%;
    max-width: 800px;
    padding: 0 30px;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s;
}

.search-overlay.active .search-overlay-content {
    transform: translateY(0);
    opacity: 1;
}

.search-form-luxury {
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    position: relative;
}

.search-field-luxury {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 36px;
    font-weight: 300;
    outline: none;
    font-family: var(--font-heading);
}

.search-submit-luxury {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 30px;
    cursor: pointer;
    transition: var(--transition);
}

/* Ẩn submenu toggle và close button trên desktop */
.submenu-toggle,
.nav-close-btn {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0;
        padding: 110px 30px 30px;
        overflow-y: auto;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: flex;
        box-sizing: border-box;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links > li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-links li a {
        color: var(--text-dark) !important;
        font-size: 16px;
        padding: 12px 0;
        display: block;
    }

    /* Submenu accordion */
    .nav-links .sub-menu {
        position: static;
        width: 100%;
        min-width: 0;
        background: transparent;
        box-shadow: none;
        border-top: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding: 0 0 8px 16px;
        backdrop-filter: none;
    }

    .nav-links li.active > .sub-menu {
        display: block;
    }

    .nav-links .sub-menu li {
        width: 100%;
    }

    .nav-links .sub-menu li a {
        padding: 8px 0;
        border-bottom: none;
        font-size: 14px;
        color: rgba(0, 0, 0, 0.6) !important;
        display: block;
        width: 100%;
    }

    .nav-links .sub-menu li a:hover {
        padding-left: 6px;
        color: var(--primary) !important;
        background: transparent;
    }

    /* Li cha có submenu */
    .menu-item-has-children {
        position: relative;
    }

    .menu-item-has-children > a {
        padding-right: 44px;
    }

    .menu-item-has-children > a::after {
        display: none !important;
    }

    /* Nút X đóng menu — override inline style display:none */
    .nav-close-btn {
        display: flex !important;
        position: absolute;
        top: 20px;
        right: 20px;
        width: 36px;
        height: 36px;
        background: none;
        border: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-dark);
        font-size: 20px;
        padding: 0;
        z-index: 10;
    }

    /* Nút mũi tên toggle */
    .submenu-toggle {
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: 44px;
        background: none;
        border: none;
        border-left: 1px solid rgba(0, 0, 0, 0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-muted);
    }

    .submenu-toggle i {
        font-size: 11px;
        transition: transform 0.25s;
        pointer-events: none;
    }

    .menu-item-has-children.active > .submenu-toggle i {
        transform: rotate(180deg);
    }

    .menu-toggle {
        display: block;
    }

    /* Ẩn hamburger khi menu đang mở — nav-close-btn trong panel đảm nhận việc đóng */
    .menu-toggle.active {
        display: none;
    }

    .header-actions {
        gap: 15px;
    }

    .search-btn {
        display: none;
    }
}
