/* ==========================================
   NARESH ENGINEERING CORPORATION
   HEADER
   FONT: LEAGUE SPARTAN
   Desktop  (>= 1000px): logo panel + nav pill (+ MORE overflow) + phone
   Tablet / Mobile (< 1000px): logo + hamburger -> right off-canvas drawer
   Scrolled: white sticky bar, shrinks, nav pill turns blue
========================================== */

@import url("https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700&display=swap");

.nec-header,
.nec-header * {
    box-sizing: border-box;
}

.nec-header {
    --nec-blue: #20399c;
    --nec-blue-dark: #182d7e;
    --nec-cyan: #00adef;
    --nec-pill: rgba(44, 45, 45, 0.5);
    --nec-sticky-bg: #ffffff;
    --nec-trigger: #508bec;
    --nec-panel-bg: #faf9fe; /* = page background, set from JS */
    --nec-header-h: 75px;
    --nec-logo-w: 190px;

    position: fixed;
    top: 15px;
    left: 0;
    width: 100%;
    z-index: 9999;

    font-family: "League Spartan", sans-serif;

    transition:
        top 0.25s ease,
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.nec-header-inner {
    position: relative;

    display: flex;
    align-items: center;

    width: calc(100% - 20px);
    max-width: 1860px;
    height: var(--nec-header-h);
    margin: 0 auto;

    transition: height 0.25s ease;
}

/* ==========================================
   LOGO WHITE PANEL (with inverted corners)
========================================== */

.nec-logo-panel {
    position: relative;
    flex: 0 0 var(--nec-logo-w);
    align-self: flex-start;

    width: var(--nec-logo-w);
    height: var(--nec-header-h);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 5px 22px;

    background: var(--nec-panel-bg);
    border-radius: 0 0 25px 0;

    text-decoration: none;
    color: inherit;
    line-height: 0;

    z-index: 6;

    transition:
        height 0.25s ease,
        border-radius 0.25s ease;
}

/* Concave corners that fill the hero's rounded corners so the panel
   blends into the page. Size/offset are measured from the hero in JS
   (--nec-corner / --nec-corner-left); these are fallbacks. */
.nec-logo-panel::after,
.nec-logo-panel::before {
    content: "";
    position: absolute;
    width: var(--nec-corner, 22px);
    height: var(--nec-corner, 22px);
    background: radial-gradient(
        circle at 100% 100%,
        transparent calc(var(--nec-corner, 22px) - 0.5px),
        var(--nec-panel-bg) var(--nec-corner, 22px)
    );
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* right of the panel, along the hero's top edge */
.nec-logo-panel::after {
    top: var(--nec-corner-top, 0px);
    left: 100%;
}

/* below the panel, along the hero's left edge */
.nec-logo-panel::before {
    top: 100%;
    left: var(--nec-corner-left, 5px);
}

/* If the hero starts left of the panel, extend the panel colour over it */
.nec-logo-panel {
    box-shadow: min(var(--nec-corner-left, 0px), 0px) 0 0 0 var(--nec-panel-bg);
}

.nec-logo-panel img {
    display: block;

    width: 150px;
    height: 68px;
    max-width: 100%;

    object-fit: contain;
    object-position: center;

    transition: transform 0.25s ease;
}

/* ==========================================
   DESKTOP NAVIGATION PILL
========================================== */

.nec-navigation {
    position: relative;
    flex: 0 1 auto;
    min-width: 0;

    height: 50px;
    margin: 0 auto;

    display: flex;
    align-items: center;

    padding: 0 12px;

    background: var(--nec-pill);
    border-radius: 50px;

    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);

    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease;

    z-index: 4;
}

.nec-menu {
    height: 100%;

    display: flex;
    flex-wrap: nowrap;
    align-items: center;

    gap: 0;

    margin: 0;
    padding: 0;

    list-style: none;
}

.nec-menu > li {
    position: relative;

    display: flex;
    align-items: center;
    flex: 0 0 auto;

    height: 100%;

    margin: 0;
    padding: 0;
}

.nec-menu > li[hidden] {
    display: none;
}

/* Main links */

.nec-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 50px;
    padding: 0 15px;

    color: #ffffff;
    background: transparent;
    border: 0;

    font-family: "League Spartan", sans-serif;
    font-size: 15px;
    font-weight: 500;

    line-height: 1.3;
    white-space: nowrap;

    text-decoration: none;
    text-transform: uppercase;

    cursor: pointer;

    transition: color 0.25s ease;
}

.nec-nav-link.active,
.nec-nav-link:hover,
.nec-nav-link:focus-visible,
.nec-has-dropdown:hover > .nec-products-row > .nec-nav-link {
    color: var(--nec-cyan);
}

/* ==========================================
   DROPDOWN (PRODUCTS / MORE)
========================================== */

.nec-products-row {
    display: flex;
    align-items: center;
    height: 50px;
}

.nec-products-row > .nec-nav-link {
    padding-right: 4px;
}

.nec-dropdown-toggle {
    width: 22px;
    height: 30px;
    margin-right: 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    background: transparent;
    color: #ffffff;

    cursor: pointer;
}

/* CSS chevron (no inline SVG: dev servers inject scripts into </svg>) */
.nec-chevron {
    display: block;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease, margin 0.3s ease;
}

.nec-has-dropdown:hover .nec-dropdown-toggle,
.nec-has-dropdown.is-open .nec-dropdown-toggle {
    color: var(--nec-cyan);
}

.nec-has-dropdown.is-open > .nec-products-row .nec-chevron {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.nec-dropdown {
    position: absolute;
    top: 100%;
    left: 0;

    min-width: 200px;

    display: block;

    margin: 0;
    padding: 0;

    list-style: none;

    background: #ffffff;
    border-radius: 0 0 2px 2px;

    box-shadow: 0 10px 20px rgba(41, 51, 61, 0.1);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(10px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;

    z-index: 20;
}

.nec-more-dropdown {
    left: auto;
    right: 0;
}

.nec-dropdown li {
    width: 100%;
    margin: 0;
    padding: 0;
}

.nec-dropdown li a,
.nec-dropdown .nec-nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    width: 100%;
    height: auto;
    min-height: 42px;

    padding: 10px 18px;

    color: #313131;

    font-family: "League Spartan", sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-transform: none;
    white-space: nowrap;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.nec-dropdown li a:hover,
.nec-dropdown li a:focus-visible,
.nec-dropdown li a.active {
    background: #204da6;
    color: #ffffff;
}

/* Items moved into MORE keep their own sub-menu inline */
.nec-more-dropdown .nec-products-row {
    height: auto;
}

.nec-more-dropdown .nec-dropdown-toggle {
    display: none;
}

.nec-more-dropdown .nec-dropdown {
    position: static;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
}

.nec-more-dropdown .nec-dropdown li a {
    padding-left: 34px;
    font-size: 15px;
}

/* Desktop: open on hover / keyboard focus / click */

@media (min-width: 1000px) {

    .nec-has-dropdown:hover > .nec-dropdown,
    .nec-has-dropdown:focus-within > .nec-dropdown,
    .nec-has-dropdown.is-open > .nec-dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nec-drawer-close,
    .nec-drawer-contact,
    .nec-drawer-backdrop {
        display: none;
    }

}

/* ==========================================
   PHONE AREA - RIGHT SIDE
========================================== */

.nec-header-phone {
    flex: 0 0 auto;

    display: flex;
    align-items: center;

    gap: 12px;

    margin-right: 50px;

    z-index: 5;
}

.nec-phone-icon {
    flex: 0 0 50px;

    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--nec-blue);
    border-radius: 50%;

    color: #ffffff;

    text-decoration: none;

    transition:
        background-color 0.25s ease,
        transform 0.25s ease;
}

.nec-phone-glyph {
    display: block;
    font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    margin-top: -2px;
}

.nec-phone-icon:hover {
    background: var(--nec-blue-dark);
    transform: scale(1.05);
}

.nec-phone-numbers {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
}

.nec-phone-numbers a {
    display: block;

    color: #ffffff;

    font-family: "League Spartan", sans-serif;
    font-size: 17px;
    font-weight: 600;

    line-height: 1.4;
    white-space: nowrap;

    text-decoration: none;

    transition: color 0.3s ease;
}

.nec-phone-numbers a:hover {
    color: var(--nec-cyan);
}

/* ==========================================
   SCROLLED (STICKY) STATE
========================================== */

.nec-header.is-scrolled {
    top: 0;
    background-color: var(--nec-sticky-bg);
    box-shadow: 0 2px 10px rgba(15, 30, 60, 0.05);
}

.nec-header.is-scrolled .nec-header-inner {
    --nec-header-h: 68px;
}

.nec-header.is-scrolled .nec-logo-panel {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.nec-header.is-scrolled .nec-logo-panel::before,
.nec-header.is-scrolled .nec-logo-panel::after {
    opacity: 0;
}

.nec-header.is-scrolled .nec-logo-panel img {
    transform: scale(0.85);
}

.nec-header.is-scrolled .nec-navigation {
    background: var(--nec-blue);
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.12);
}

.nec-header.is-scrolled .nec-phone-numbers a {
    color: #000000;
}

.nec-header.is-scrolled .nec-phone-numbers a:hover {
    color: var(--nec-blue);
}

/* ==========================================
   HAMBURGER (hidden on desktop)
========================================== */

.nec-mobile-toggle {
    display: none;

    flex: 0 0 44px;

    width: 44px;
    height: 44px;
    margin-left: auto;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 8px;

    color: var(--nec-trigger);

    cursor: pointer;
    z-index: 10;

    -webkit-tap-highlight-color: transparent;
}

.nec-mobile-toggle span {
    display: block;

    width: 20px;
    height: 2px;

    background: currentColor;
    border-radius: 1px;
}

.nec-mobile-toggle:hover,
.nec-mobile-toggle:focus-visible {
    color: var(--nec-blue);
}

/* Over a hero image: soft white chip so the icon is always visible */
.nec-header:not(.is-scrolled) .nec-mobile-toggle {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* ==========================================
   MID DESKTOP (1000px - 1279px): tighten
========================================== */

@media (max-width: 1279px) {

    .nec-header {
        --nec-logo-w: 175px;
    }

    .nec-logo-panel img {
        width: 135px;
    }

    .nec-navigation {
        margin: 0 auto 0 28px;
        padding: 0 6px;
    }

    .nec-nav-link {
        padding: 0 12px;
        font-size: 14.5px;
    }

    .nec-header-phone {
        margin-right: 14px;
        gap: 10px;
    }

    .nec-phone-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .nec-phone-numbers a {
        font-size: 15px;
    }

}

/* ==========================================
   TABLET / MOBILE (< 1000px): OFF-CANVAS DRAWER
========================================== */

@media (max-width: 999.98px) {

    .nec-header-phone {
        display: none;
    }

    .nec-mobile-toggle {
        display: flex;
        margin-right: 14px;
    }

    /* Drawer */

    .nec-navigation {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;

        width: min(65vw, 500px);
        height: 100vh;
        height: 100dvh;
        margin: 0;

        display: block;

        padding: 75px 26px 30px;

        background: rgba(18, 21, 25, 0.98);
        border-radius: 0;

        box-shadow: 0 0 70px rgba(0, 0, 0, 0.35);

        backdrop-filter: none;
        -webkit-backdrop-filter: none;

        overflow-y: auto;
        overscroll-behavior: contain;

        transform: translateX(100%);
        visibility: hidden;

        transition:
            transform 0.35s ease,
            visibility 0.35s ease;

        z-index: 10001;
    }

    .nec-header.is-scrolled .nec-navigation {
        background: rgba(18, 21, 25, 0.98);
    }

    .nec-navigation.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .nec-drawer-close {
        position: absolute;
        top: 22px;
        right: 22px;

        width: 36px;
        height: 36px;

        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0;

        background: transparent;
        border: 0;
        border-radius: 50%;

        color: #ffffff;

        cursor: pointer;

        transition: background-color 0.2s ease;
    }

    .nec-drawer-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .nec-icon-close {
        position: relative;
        display: block;
        width: 16px;
        height: 16px;
    }

    .nec-icon-close::before,
    .nec-icon-close::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        height: 2px;
        margin-top: -1px;
        background: currentColor;
        border-radius: 2px;
        transform: rotate(45deg);
    }

    .nec-icon-close::after {
        transform: rotate(-45deg);
    }

    .nec-menu {
        height: auto;

        flex-direction: column;
        align-items: stretch;

        gap: 2px;
    }

    .nec-menu > li {
        display: block;
        width: 100%;
        height: auto;
    }

    .nec-menu > li.nec-more {
        display: none;
    }

    .nec-nav-link,
    .nec-menu > li > .nec-nav-link {
        display: flex;
        justify-content: flex-start;

        width: 100%;
        height: auto;
        min-height: 44px;

        padding: 8px 20px;

        font-size: 20px;
        font-weight: 600;

        border-radius: 30px;
    }

    .nec-nav-link.active {
        background: rgba(255, 255, 255, 0.06);
        color: #5b8def;
    }

    .nec-products-row {
        height: auto;
        justify-content: space-between;
    }

    .nec-products-row > .nec-nav-link {
        flex: 1 1 auto;
        width: auto;
    }

    .nec-dropdown-toggle {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        margin-right: 4px;
        border-radius: 50%;
    }

    .nec-chevron {
        width: 8px;
        height: 8px;
        border-width: 2px;
    }

    .nec-dropdown {
        display: none;

        position: static;

        width: 100%;
        min-width: 0;
        padding: 4px 0 8px;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: none;

        background: transparent;
        box-shadow: none;
    }

    .nec-has-dropdown.is-open > .nec-dropdown {
        display: block;
    }

    .nec-dropdown li a {
        min-height: 40px;
        padding: 8px 20px 8px 38px;

        color: rgba(255, 255, 255, 0.82);

        font-size: 17px;
        font-weight: 500;

        border-radius: 30px;
    }

    .nec-dropdown li a:hover,
    .nec-dropdown li a.active {
        background: rgba(255, 255, 255, 0.06);
        color: var(--nec-cyan);
    }

    .nec-drawer-contact {
        display: flex;
        flex-direction: column;
        gap: 6px;

        margin: 26px 20px 0;
        padding-top: 20px;

        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .nec-drawer-contact span {
        color: rgba(255, 255, 255, 0.6);
        font-size: 14px;
    }

    .nec-drawer-contact a {
        color: #ffffff;
        font-size: 18px;
        font-weight: 600;
        text-decoration: none;
    }

    .nec-drawer-contact a:hover {
        color: var(--nec-cyan);
    }

    .nec-drawer-backdrop {
        position: fixed;
        inset: 0;

        background: rgba(0, 0, 0, 0.5);

        opacity: 0;
        visibility: hidden;

        transition:
            opacity 0.35s ease,
            visibility 0.35s ease;

        z-index: 10000;
    }

    .nec-header.nav-open .nec-drawer-backdrop {
        opacity: 1;
        visibility: visible;
    }

}

/* ==========================================
   MOBILE (< 690px)
========================================== */

@media (max-width: 689.98px) {

    .nec-header {
        top: 10px;
        --nec-header-h: 64px;
        --nec-logo-w: 150px;
    }

    .nec-header-inner {
        width: calc(100% - 20px);
    }

    .nec-logo-panel {
        padding: 4px 15px;
        border-radius: 0 0 20px 0;
    }

    .nec-logo-panel img {
        width: 118px;
        height: 56px;
    }

    .nec-header.is-scrolled .nec-header-inner {
        --nec-header-h: 60px;
    }

    .nec-mobile-toggle {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
        margin-right: 10px;
    }

    .nec-navigation {
        width: 90vw;
        padding: 70px 14px 26px;
    }

    .nec-nav-link,
    .nec-menu > li > .nec-nav-link {
        font-size: 18px;
    }

    .nec-dropdown li a {
        font-size: 16px;
    }

}

@media (max-width: 380px) {

    .nec-header {
        --nec-logo-w: 136px;
    }

    .nec-logo-panel img {
        width: 106px;
    }

}

/* Lock page scroll while the drawer is open */
body.nec-nav-locked {
    overflow: hidden !important;
}

@media (prefers-reduced-motion: reduce) {

    .nec-header,
    .nec-header * {
        transition: none !important;
    }

}
