/* ===========================
   PMF FINANCE — HEADER STYLES
   =========================== */

:root {
    --header-bg: #1e1a18;
    --header-bg-hover: #2a2521;
    --red: #CC1F1F;
    --red-dark: #aa1515;
    --white: #ffffff;
    --nav-text: #d8d2cc;
    --nav-text-hover: #ffffff;
    --dropdown-bg: #2b2521;
    --dropdown-border: #3a3330;
    --header-height: 72px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; }
a { text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== HEADER WRAPPER ===== */
.site-header {
    background-color: var(--header-bg);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 32px;
}

/* ===== LOGO ===== */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    display: block;
    max-height: 56px;
    width: auto;
}

/* ===== MAIN NAV ===== */
.main-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

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

/* Nav Item */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 11px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--white) !important;
    white-space: nowrap;
    transition: color 0.18s;
    border-radius: 3px;
}

.nav-link:hover,
.nav-item.open .nav-link {
    color: var(--nav-text-hover);
    background-color: var(--header-bg-hover);
}

.nav-link.active {
    color: var(--white);
}

/* Dropdown arrow */
.dropdown-arrow {
    width: 10px;
    height: 6px;
    flex-shrink: 0;
    transition: transform 0.2s;
    opacity: 0.7;
}

.nav-item.open .dropdown-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: 2px solid var(--red);
    min-width: 210px;
    padding: 6px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
}

.nav-item.open .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 400;
    color: #2d2d2d;
    transition: background 0.15s, color 0.15s;
}

.dropdown-menu li a:hover {
    background: rgba(0,0,0,0.04);
    color: #111111;
    padding-left: 22px;
}

/* ===== RIGHT ACTIONS ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Language button — active language is red */
.lang-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border 0.2s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.lang-btn.active {
    background: var(--red);
    border-color: var(--red);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Login icon */
.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--nav-text);
    border-radius: 4px;
    transition: color 0.18s, background 0.18s;
}

.action-icon:hover {
    color: var(--white);
    background: var(--header-bg-hover);
}

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

/* Sinhala language button */
.lang-sinhala {
    font-size: 14px;
    font-weight: 500;
    color: var(--nav-text);
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.18s, background 0.18s;
    cursor: pointer;
    font-family: inherit;
}

.lang-sinhala:hover {
    color: var(--white);
    background: var(--header-bg-hover);
}

/* ===== HAMBURGER (Mobile) ===== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    margin-left: auto;
    cursor: pointer;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: all 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
    display: none;
    background: var(--dropdown-bg);
    border-top: 1px solid var(--dropdown-border);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.mobile-nav.open {
    display: block;
    max-height: 500px;
}

.mobile-nav-list {
    padding: 8px 0 16px;
}

.mobile-nav-list li a {
    display: block;
    padding: 11px 28px;
    font-size: 14px;
    color: var(--nav-text);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: color 0.15s, background 0.15s;
}

.mobile-nav-list li a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.05);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-link { padding: 8px 8px; font-size: 12.5px; }
}

@media (max-width: 860px) {
    .main-nav { display: none; }
    .header-actions { display: none; }
    .hamburger { display: flex; }
    .header-inner { gap: 16px; }
}