* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    color: #1F2937;
}

a,
a:visited,
a:hover,
a:active {
    text-decoration: none;
}

/* ===== NAVIGATION CONTAINER ===== */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #042240 0%, #024f9c 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    z-index: 1000;
    transition: all 0.4s ease;
}

/* Transparent blue when scrolled */
.nav-container.scrolled {
    background: linear-gradient(135deg, #0422407a 0%, #024f9c9c 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 102, 204, 0.2);
}

/* ===== MAIN HEADER ===== */
.main-header {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 1fr;
    grid-template-rows: auto auto;
    padding: 10px 0;
}

.logo {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-weight: bold;
    font-size: 20px;
}

.logo img {
    width: 90%;
    height: auto;
    max-height: 90px;
}

.name {

    grid-column: 2 / 4;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px;
    gap: 16px;
    flex-wrap: wrap;
}

.name h3 {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    white-space: nowrap;
}

/* Social icons — same line as company name */
.header-social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    margin-left: 8px;
}

.header-social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    font-size: 15px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.header-social-icons a:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    filter: brightness(1.15);
}

/* Per-brand colours */
.header-social-icons a[aria-label="Facebook"]    { background: #1877f2; color: #fff; }
.header-social-icons a[aria-label="X (Twitter)"] { background: #000;    color: #fff; }
.header-social-icons a[aria-label="LinkedIn"]    { background: #0a66c2; color: #fff; }
.header-social-icons a[aria-label="Instagram"]   { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); color: #fff; }
.header-social-icons a[aria-label="YouTube"]     { background: #ff0000; color: #fff; }

.search {
    grid-column: 4;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
}

/* The form itself is the flex row — both children forced to same height */
.search-form-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.search-form-header input,
.search-form-header button {
    height: 36px;
    box-sizing: border-box;
    margin: 0;
    vertical-align: middle;
}

.search-form-header input {
    width: 180px;
    padding: 0 12px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-right: none;
    background-color: #ffffff;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    color: #1a1a2e;
    flex-shrink: 1;
}

.search-form-header input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.search-form-header input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
    background-color: #ffffff;
}

.search-form-header button {
    padding: 0 14px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-form-header button:hover {
    background-color: rgba(255, 255, 255, 0.32);
}

/* ===== HAMBURGER MENU (Hidden on Desktop) ===== */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2001;
}

.hamburger-menu span {
    width: 30px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* ===== MAIN MENU ===== */
.main-menu {
    grid-column: 1 / 5;
    grid-row: 2;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.main-menu a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.main-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.main-menu a.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ===== DROPDOWN NAVIGATION ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Button */
.dropdown .dropbtn {
    background-color: transparent;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown .dropbtn i {
    font-size: 10px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

/* Dropdown Button Hover */
.dropdown .dropbtn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ===== CLICK-BASED DROPDOWN FUNCTIONALITY ===== */
/* Hide dropdown content by default */
.dropdown .dropdown-content {
    display: none;
}

/* Show dropdown content when active class is added */
.dropdown.active > .dropdown-content {
    display: block;
}

/* Ensure nested dropdowns work properly */
.dropdown .dropdown.active > .dropdown-content {
    display: block;
}

/* Dropdown Content Styling */
.dropdown-content {
    position: absolute;
    background-color: #ffffff;
    min-width: 240px;
    z-index: 1001;
    margin-top: 8px;
    opacity: 0;
    font-weight:600;
    visibility: hidden;
    transform: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

/* Show dropdown with animation when active */
.dropdown.active > .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* IMPORTANT: Create a triangular connector to prevent gap */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 16px;
    height: 8px;
    background-color: transparent;
}

/* Dropdown Links */
.dropdown-content a {
    color: #1F2937;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

/* Hover Effect on Dropdown Links */
.dropdown-content a:hover {
    color: #024f9c;
}

/* Rotate Arrow when dropdown is active */
.dropdown.active > .dropbtn i {
    transform: rotate(180deg);
}

/* ===== RESPONSIVE STYLES ===== */

/* ── Tablet (769px – 1024px) ── */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .main-header {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
    }

    .name {
        grid-column: 2;
    }

    /* Hide social icons on tablets — not enough horizontal space */
    .header-social-icons {
        display: none;
    }

    .search {
        grid-column: 3;
        padding-right: 12px;
    }

    .search-form-header input {
        width: 140px;
    }

    .main-menu {
        grid-column: 1 / 4;
        gap: 10px;
        padding: 8px 12px;
    }

    .main-menu a,
    .dropdown .dropbtn {
        font-size: 13px;
        padding: 7px 9px;
    }

    .dropdown-content {
        min-width: 200px;
    }
}

/* ===== MOBILE (≤768px) ===== */
@media screen and (max-width: 768px) {

    /* Row 1: [name · · · · · hamburger]
       Row 2: [search · · · · · · · ·  ] */
    .main-header {
        grid-template-columns: 1fr auto;
        grid-template-rows: 44px auto;
        padding: 0;
        align-items: stretch;
    }

    /* Logo — hidden */
    .logo { display: none !important; }

    /* Social icons — smaller on mobile */
    .header-social-icons {
        display: flex;
        gap: 6px;
        margin-left: 14px;
    }

    .header-social-icons a {
        width: 26px;
        height: 26px;
        font-size: 11px;
        border-width: 1px;
    }

    /* Company name — left-aligned, vertically centred in row 1 */
    .name {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 0 14px;
        gap: 10px;
    }

    .name h3 {
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.4px;
        line-height: 1;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hamburger — right side of row 1, vertically centred */
    .hamburger-menu {
        display: flex;
        grid-column: 2;
        grid-row: 1;
        align-items: center;
        justify-content: center;
        padding: 0 14px;
        height: 44px;
        z-index: 2001;
    }

    .hamburger-menu { width: 38px; height: 32px; }
    .hamburger-menu span { width: 38px; height: 3px; }

    /* Search — row 2, full width */
    .search {
        grid-column: 1 / 3;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: stretch;
        padding: 6px 10px 8px;
        z-index: 2000;
    }

    .search-form-header {
        width: 100%;
    }

    .search-form-header input,
    .search-form-header button {
        height: 34px;
    }

    .search-form-header input {
        flex: 1;
        width: auto;
        min-width: 0;
        font-size: 13px;
        background-color: #ffffff;
        color: #1a1a2e;
        border: 1.5px solid rgba(255, 255, 255, 0.5);
        border-right: none;
        border-radius: 6px 0 0 6px;
        padding: 0 10px;
    }

    .search-form-header button {
        padding: 0 13px;
        border: 1.5px solid rgba(255, 255, 255, 0.5);
        border-radius: 0 6px 6px 0;
        font-size: 14px;
    }
    
    /* Main menu - SLIDE-OUT SIDEBAR */
    .main-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, #0422407a 0%, #024f9c9c 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 0 20px 0;
        gap: 0;
        overflow-y: auto;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 2000;
    }
    
    .main-menu.active {
        right: 0;
    }
    
    .main-menu a,
    .dropdown {
        width: 100%;
        display: block;
    }
    
    .main-menu a {
        padding: 15px 25px;
        font-size: 15px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .main-menu a.active {
        background-color: rgba(255, 255, 255, 0.15);
        border-left: 4px solid #0080ff;
    }
    
    .dropdown .dropbtn {
        width: 100%;
        text-align: left;
        padding: 15px 25px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Mobile dropdown content */
    .dropdown-content {
        position: static;
        background-color: rgba(0, 0, 0, 0.2);
        width: 100%;
        transform: none;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown.active > .dropdown-content {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-content::before {
        display: none;
    }
    
    .dropdown-content a {
        color: #ffffff;
        padding: 12px 25px 12px 45px;
        font-size: 14px;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-content a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 50px;
    }
    
    /* Overlay when menu is open.
       Lives INSIDE .nav-container (stacking context z-index 1000) in the HTML.
       z-index 1999 = below .main-menu at 2000, both in the same context.
       Menu always wins hit-testing at any point it overlaps the overlay. */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        pointer-events: none;
    }

    .menu-overlay.active {
        display: block;
        pointer-events: auto;
    }
}

/* Small phones — Samsung A05, iPhone SE (360px–480px) */
@media screen and (max-width: 480px) {
    .name h3 { font-size: 12px; }

    .search-form-header input  { font-size: 12px; }
    .search-form-header button { font-size: 12px; padding: 0 10px; }

    .main-menu { width: 240px; }
    .main-menu a { padding: 13px 20px; font-size: 14px; }
    .dropdown .dropbtn { padding: 13px 20px; }
}

/* Extra small — Galaxy Fold, very small iPhones (≤360px) */
@media screen and (max-width: 360px) {
    .name h3 { font-size: 11px; }

    .search { padding: 6px 8px; }
    .search-form-header input  { font-size: 11px; padding: 0 8px; }
    .search-form-header button { font-size: 11px; padding: 0 9px; }

    .main-menu { width: 220px; }
    .main-menu a { padding: 12px 18px; font-size: 13px; }
}