/* ============================================
   PAN ENGINEERS — HEADER CSS
   Ultra-Premium Sticky Navigation
============================================ */

.pe-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #072f4a 0%, #0369a1 45%, #0284c7 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 6px 30px rgba(2, 132, 199, 0.35);
    transition: all 0.35s var(--ease-smooth);
}

.pe-header.scrolled {
    background: rgba(7, 47, 74, 0.98);
    border-bottom: 2px solid #38bdf8;
    box-shadow: 0 8px 40px rgba(7, 47, 74, 0.6);
}

.header-inner {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 clamp(20px, 3.5vw, 50px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 20px;
    min-width: 0;
}

/* ---- Logo ---- */
.pe-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: clamp(16px, 3vw, 48px);
}

.pe-logo img {
    height: 56px !important;
    width: auto !important;
    max-width: 270px;
    object-fit: contain;
    transition: var(--transition);
    filter: brightness(1.1);
}

.pe-logo:hover img {
    transform: scale(1.03);
    filter: brightness(1.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-pan {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 900;
    color: var(--pe-orange);
    letter-spacing: 4px;
}

.logo-engineers {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--pe-white);
    letter-spacing: 6px;
    opacity: 0.85;
}

/* ---- Navigation ---- */
.pe-nav {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.8vw, 14px);
    flex: 1;
    justify-content: center;
    margin: 0 12px;
    min-width: 0;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px clamp(8px, 0.85vw, 16px);
    font-size: clamp(13px, 1vw, 15px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.nav-parent-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

.nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
}

.nav-underline {
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: #f97316;
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-smooth);
    transform-origin: left;
}

.nav-link:hover .nav-underline,
.nav-link.active .nav-underline {
    transform: scaleX(1);
}

.nav-link span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link span svg {
    transition: transform 0.3s ease;
}

/* ---- Dropdown ---- */
.nav-dropdown-trigger {
    position: relative;
    cursor: pointer;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 250px;
    background: #072f4a;
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 14px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 25px rgba(2, 132, 199, 0.3);
    z-index: 1050;
}

/* Invisible hover bridge: covers the gap so mouse never loses hover */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
    display: block;
}

/* Show on Hover, Focus, or Click Active */
.nav-dropdown-trigger:hover .nav-dropdown,
.nav-dropdown-trigger:focus-within .nav-dropdown,
.nav-dropdown-trigger.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-trigger:hover span svg,
.nav-dropdown-trigger.open span svg {
    transform: rotate(180deg);
}

.nav-dropdown a {
    display: block;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-dropdown a:hover {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    padding-left: 20px;
    transform: translateX(4px);
}

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

.header-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    transition: all 0.3s ease;
}

.header-phone:hover {
    border-color: rgba(249,115,22,0.4);
    background: rgba(249,115,22,0.05);
}

.phone-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--pe-orange), var(--pe-orange-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phone-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.phone-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.phone-label {
    font-size: 10px;
    color: var(--pe-gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.phone-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--pe-white);
}

/* ---- CTA Button ---- */
.header-cta-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--pe-orange), var(--pe-orange-dark));
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header-cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--pe-gold), var(--pe-orange));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-cta-btn:hover::before {
    opacity: 1;
}

.header-cta-btn span,
.header-cta-btn svg {
    position: relative;
    z-index: 1;
}

.header-cta-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.header-cta-btn:hover svg {
    transform: translateX(4px);
}

.header-cta-btn:hover {
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.4);
    transform: translateY(-2px);
}

/* ---- Hamburger ---- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--pe-white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile Nav ---- */
.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(5, 8, 16, 0.98);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.mobile-nav.open {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.mobile-nav a {
    padding: 12px 16px;
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mobile-nav a:hover {
    background: rgba(249,115,22,0.1);
    border-color: rgba(249,115,22,0.2);
    color: var(--pe-orange);
}

.mobile-cta {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--pe-orange), var(--pe-orange-dark)) !important;
    color: white !important;
    text-align: center;
    font-weight: 600;
}

/* ---- Catalogue Download Button (Header) ---- */
.catalogue-download-btn {
    background: linear-gradient(135deg, var(--pe-sky), var(--pe-sky-dark)) !important;
}

.catalogue-download-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ---- Mobile Catalogue Button ---- */
.mobile-catalogue-btn {
    background: linear-gradient(135deg, var(--pe-sky), var(--pe-sky-dark)) !important;
    color: white !important;
    text-align: center;
    font-weight: 700;
    border-radius: 10px;
    padding: 12px 16px;
}

/* The full desktop header needs more room than a typical laptop provides. */
@media (max-width: 1180px) {
    .header-inner { height: 72px; }
    .pe-nav,
    .header-phone,
    .header-cta-btn { display: none; }
    .hamburger { display: flex; }
    .mobile-nav {
        display: flex;
        max-height: 0;
        overflow: hidden;
        padding: 0 20px;
        visibility: hidden;
    }
    .mobile-nav.open {
        max-height: 520px;
        padding: 14px 20px 22px;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    .header-inner { height: 64px; }
    .pe-logo img { width: min(190px, 58vw) !important; }
    .hamburger { padding-right: 0; }
}
