/* ============================================
   NEW CAMBODIA — Header Styles
   Extracted from page_blocks/header_new.php
   ============================================ */

/* Base Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(12, 22, 40, 0.96);
    will-change: transform;
    width: 100%;
}

/* Gold accent line */
.header__accent-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-accent, #c8a45e), transparent);
    opacity: 0.7;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(200, 164, 94, 0.3);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
}

/* Logo */
.header__logo {
    font-family: var(--font-body);
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.header__logo:hover {
    opacity: 0.9;
}

.header__logo-text {
    color: #ffffff;
}

.header__logo-accent {
    color: var(--color-accent);
}

/* Navigation */
.header__nav {
    display: flex;
    align-items: center;
}

/* Hide mobile-only elements on desktop */
.header__mobile-header,
.header__mobile-cta {
    display: none;
}

.header__nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nav links */
.header__nav-link {
    display: block;
    padding: 12px 18px;
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.25s ease;
    position: relative;
    letter-spacing: 0.02em;
}

.header__nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: all 0.25s ease;
    transform: translateX(-50%);
}

.header__nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.header__nav-link:hover::after {
    width: 60%;
}

.header__nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    cursor: default;
    user-select: none;
}

.header__nav-link.active::after {
    width: 60%;
}

/* Premium CTA Button */
.btn-premium {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-accent);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    z-index: 1;
    letter-spacing: 0.02em;
}

.btn-premium__text {
    position: relative;
    z-index: 2;
}

.btn-premium__border {
    position: absolute;
    inset: 0;
    border: 2px solid var(--color-accent);
    border-radius: 8px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.btn-premium:hover {
    color: #ffffff;
}

.btn-premium:hover .btn-premium__border {
    opacity: 1;
    transform: scale(1);
}

.btn-premium:active {
    transform: scale(0.98);
}

/* Burger Menu */
.header__burger {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.header__burger:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.burger-line {
    display: block;
    width: 28px;
    height: 2.5px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header__burger:hover .burger-line {
    opacity: 0.8;
}

/* Scrolled State */
.header--scrolled {
    padding: 12px 0;
    background: rgba(12, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Ensure content doesn't hide behind fixed header */
body.has-sticky-header .main-wrapper {
    padding-top: 96px;
}

@media (max-width: 1023px) {
    body.has-sticky-header .main-wrapper {
        padding-top: 76px;
    }
}

/* Mobile Styles */
@media (max-width: 1023px) {
    .header {
        padding: 14px 0;
    }

    .container.header__inner {
        padding-left: var(--container-padding, 16px);
        padding-right: var(--container-padding, 16px);
    }

    .header__inner {
        gap: 12px;
    }

    .header__logo {
        font-size: 1.6rem;
    }

    .header__nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        visibility: hidden;
        width: min(340px, 88vw);
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        background: rgba(12, 22, 40, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.4s;
        z-index: 1050;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        overscroll-behavior: contain;
    }

    .header__nav.active {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
    }

    /* Overlay */
    .header-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0s 0.4s;
        z-index: 1040;
        -webkit-tap-highlight-color: transparent;
    }

    .header-overlay.active {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.4s ease, visibility 0s 0s;
    }

    /* Mobile Header Section */
    .header__mobile-header {
        display: block;
        padding: 24px 28px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(0, 0, 0, 0.2);
    }

    .header__logo--mobile {
        font-size: 2rem;
        display: inline-block;
    }

    .header__mobile-contacts {
        display: flex;
        flex-direction: column;
        gap: 14px;
        margin-top: 20px;
    }

    .header__contact-link {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 14px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none;
        transition: all 0.25s ease;
        border: 1px solid rgba(255, 255, 255, 0.06);
        font-family: var(--font-body);
        font-size: 1.15rem;
    }

    .header__contact-link:hover {
        background: rgba(200, 164, 94, 0.15);
        border-color: rgba(200, 164, 94, 0.3);
        color: #ffffff;
        transform: translateX(4px);
    }

    .header__contact-link svg {
        flex-shrink: 0;
        color: var(--color-accent);
    }

    /* Navigation List */
    .header__nav-list {
        flex: 1;
        padding: 20px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        overflow-y: auto;
    }

    .header__nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 22px;
        font-size: 1.4rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.95);
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        text-decoration: none;
        white-space: nowrap;
        position: relative;
        overflow: hidden;
        letter-spacing: 0.02em;
    }

    .header__nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--color-accent);
        transform: none;
        transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .header__nav-link:hover,
    .header__nav-link:focus-visible {
        color: #ffffff;
        background: rgba(200, 164, 94, 0.12);
        border-color: rgba(200, 164, 94, 0.3);
        transform: translateX(6px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    }

    .header__nav-link:hover::after,
    .header__nav-link:focus-visible::after {
        width: 100%;
    }

    .header__nav-link:active {
        transform: translateX(2px) scale(0.98);
        background: rgba(200, 164, 94, 0.18);
    }

    .header__nav-link.active {
        color: #ffffff;
        background: rgba(200, 164, 94, 0.18);
        border-color: var(--color-accent);
        cursor: default;
        user-select: none;
    }

    .header__nav-link.active::after {
        width: 100%;
    }

    /* Mobile CTA Button */
    .header__mobile-cta {
        display: block;
        padding: 24px 28px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(0, 0, 0, 0.2);
    }

    .btn-premium--mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 18px 28px;
        font-family: var(--font-body);
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--color-accent);
        background: transparent;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        text-decoration: none;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        z-index: 1;
        letter-spacing: 0.02em;
    }

    .btn-premium--mobile .btn-premium__text {
        position: relative;
        z-index: 2;
    }

    .btn-premium--mobile .btn-premium__border {
        position: absolute;
        inset: 0;
        border: 2px solid var(--color-accent);
        border-radius: 10px;
        opacity: 0;
        transform: scale(0.95);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1;
    }

    .btn-premium--mobile:hover {
        color: #ffffff;
    }

    .btn-premium--mobile:hover .btn-premium__border {
        opacity: 1;
        transform: scale(1);
    }

    .btn-premium--mobile:active {
        transform: scale(0.98);
    }

    .header__burger {
        display: flex;
    }

    .header__cta {
        display: none;
    }

    /* Burger animation */
    .header__burger[aria-expanded="true"] .burger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .header__burger[aria-expanded="true"] .burger-line:nth-child(2) {
        opacity: 0;
    }

    .header__burger[aria-expanded="true"] .burger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Prevent horizontal scroll on small screens */
@media (max-width: 1023px) {
    html, body {
        overflow-x: hidden;
    }
}

/* High contrast for accessibility */
@media (prefers-contrast: high) {
    .header__nav-link {
        color: #ffffff;
        font-weight: 600;
    }

    .btn-premium {
        border: 2px solid var(--color-accent);
        color: var(--color-accent);
    }

    .btn-premium:hover {
        background: var(--color-accent);
        color: #000000;
    }
}
