/* ============================================
   Pan Mondial — 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;
}

/* ---- Call / WhatsApp Dropdown ---- */
.header-phone-dropdown-wrap {
    position: relative;
    display: inline-flex;
}

.header-phone-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    color: inherit;
    font-family: inherit;
    text-decoration: none;
}

.header-phone-btn:hover,
.header-phone-dropdown-wrap.open .header-phone-btn {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(14, 165, 233, 0.12);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.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-btn-text {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.phone-caret {
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.25s ease;
    margin-left: 2px;
    flex-shrink: 0;
}

.header-phone-dropdown-wrap:hover .phone-caret,
.header-phone-dropdown-wrap.open .phone-caret {
    transform: rotate(180deg);
    color: #38bdf8;
}

/* Invisible bridge so mouse does not lose hover between button and menu */
.header-phone-menu::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
    display: block;
}

.header-phone-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #07243d;
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(14, 165, 233, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1100;
    backdrop-filter: blur(16px);
}

.header-phone-dropdown-wrap:hover .header-phone-menu,
.header-phone-dropdown-wrap.open .header-phone-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.h-phone-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.h-phone-title {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #38bdf8;
}

.h-phone-sub {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.h-phone-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.h-phone-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
}

.h-phone-card-top {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.h-phone-badge {
    display: none;
}

.h-phone-num {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.h-phone-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.h-phone-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.h-phone-action-btn.call-btn {
    background: #0284c7;
    color: #ffffff;
}

.h-phone-action-btn.call-btn:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.h-phone-action-btn.wa-btn {
    background: #16a34a;
    color: #ffffff;
}

.h-phone-action-btn.wa-btn:hover {
    background: #22c55e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.h-phone-footer {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.h-phone-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.h-phone-email:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* ---- CTA Button / Catalogue Dropdown ---- */
.header-catalogue-dropdown-wrap {
    position: relative;
}

.header-cta-btn.catalogue-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--pe-sky), var(--pe-sky-darker));
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
    transition: all 0.3s ease;
}

.header-cta-btn.catalogue-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(14, 165, 233, 0.5);
    background: linear-gradient(135deg, #38bdf8, var(--pe-sky));
}

.header-user-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
    white-space: nowrap;
    cursor: pointer;
}

.header-user-btn:hover {
    background: #0ea5e9;
    border-color: #38bdf8;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.header-user-btn.logged-in {
    background: rgba(14, 165, 233, 0.2);
    border-color: #38bdf8;
    color: #38bdf8 !important;
}

.cat-caret {
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.header-catalogue-dropdown-wrap:hover .cat-caret,
.header-catalogue-dropdown-wrap.open .cat-caret {
    transform: rotate(180deg);
}

.header-catalogue-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: #0b1329;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(14, 165, 233, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    backdrop-filter: blur(16px);
}

.header-catalogue-dropdown-wrap:hover .header-catalogue-menu,
.header-catalogue-dropdown-wrap.open .header-catalogue-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.h-cat-header {
    padding: 8px 10px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.h-cat-title {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #38bdf8;
}

.h-cat-sub {
    display: block;
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 2px;
}

.h-cat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.h-cat-item:hover {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateX(4px);
}

.h-cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.h-cat-icon svg {
    width: 18px;
    height: 18px;
}

.icon-blue {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

.icon-orange {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.icon-green {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.h-cat-text {
    flex: 1;
    min-width: 0;
}

.h-cat-text strong {
    display: block;
    font-size: 13.5px;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.3;
}

.h-cat-text span {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
    margin-top: 2px;
}

.h-cat-action {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.h-cat-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.h-cat-view-all {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.h-cat-view-all:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.mobile-cat-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-cat-heading {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #38bdf8;
    margin-bottom: 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-phone-dropdown-wrap,
    .header-catalogue-dropdown-wrap { display: none !important; }
    .header-user-btn {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
    .hamburger { display: flex; }
    .mobile-nav {
        display: flex;
        max-height: 0;
        overflow-y: auto;
        padding: 0 20px;
        visibility: hidden;
    }
    .mobile-nav.open {
        max-height: 85vh;
        padding: 16px 20px 28px;
        visibility: visible;
        box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    }
}

@media (max-width: 480px) {
    .header-inner { height: 64px; }
    .pe-logo img { width: min(170px, 50vw) !important; }
    .header-user-btn { display: none !important; } /* accessible in mobile hamburger menu */
    .hamburger { padding-right: 0; }
}
