/* ====== HEADER & NAVIGATION STYLES ====== */
/* Optimized for WESTRAFO image logo and mobile menu */

:root {
    --primary-green: #2E7D32;
    --secondary-green: #4CAF50;
    --accent-green: #81C784;
    --dark-green: #1B5E20;
    --light-green: #E8F5E9;
    --dark-gray: #212121;
    --medium-gray: #424242;
    --light-gray: #FAFAFA;
    --white: #FFFFFF;
}

/* Header Container */
#main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 0;
    height: 70px;
    transition: all 0.3s ease;
}

/* Header when scrolled */
#main-header.scrolled {
    padding: 8px 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

/* Header container - Perfect alignment */
#main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    align-content: first baseline;
}

/* Logo Styles - FOR IMAGE LOGO */
#main-header .logo {
    display: flex;
    align-items: flex-start;
    height: 100%;
    text-decoration: none;
    z-index: 1001;
}

#main-header .logo img {
    height: 59px; /* Fixed height for perfect alignment */
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

#main-header .logo:hover img {
    transform: scale(1.05);
}

/* Main Navigation */
#main-nav {
    display: flex;
    align-items: center;
    height: 100%;
    float: right;
}

#main-nav ul {
    display: flex;
    list-style: none;
    
    gap: 25px;
    margin: 0;
    padding: 1px 5px 90px;
    height: 100%;
    align-items: center;
}

#main-nav a {
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    white-space: nowrap;
}

#main-nav a:hover {
    color: var(--primary-green);
    background-color: var(--light-green);
}

/* Active navigation link */
#main-nav a.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
}

/* Header Actions (menu toggle) */
.header-actions {
    display: flex;
    align-items: center;
    gap: -2px;
    height: 100%;
    float: right;
    margin-top: -2.2rem;
    align-content: last baseline;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 1px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.menu-toggle:hover {
    background-color: var(--light-gray);
}

.menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--dark-gray);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active {
    background-color: var(--light-green);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--primary-green);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--primary-green);
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
    #main-header {
        height: 65px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    #main-header .logo img {
        height: 42px; /* Slightly smaller on mobile */
    }
    
    /* Mobile menu positioning */
    #main-nav {
        position: fixed;
        top: 65px; /* Match header height */
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 999;
        height: auto;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
    }
    
    #main-nav.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    #main-nav ul {
        flex-direction: column;
        gap: 0;
        height: auto;
        width: 100%;
    }
    
    #main-nav a {
        padding: 15px 20px;
        justify-content: center;
        height: 50px;
        border-radius: 8px;
        margin-bottom: 5px;
        width: 100%;
        font-size: 1.1rem;
    }
    
    .header-actions {
        gap: 10px;
    }
}

/* ====== TABLET RESPONSIVE ====== */
@media (max-width: 992px) {
    #main-nav ul {
        gap: 15px;
    }
    
    #main-nav a {
        padding: 6px 12px;
        font-size: 0.95rem;
    }
}

/* ====== SMALL MOBILE ====== */
@media (max-width: 480px) {
    #main-header {
        height: 60px;
    }
    
    #main-header .logo img {
        height: 38px;
    }
    
    #main-nav {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
    
    #main-nav a {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* ====== DESKTOP LARGE ====== */
@media (min-width: 1200px) {
    #main-header .container {
        padding: 0;
    }
}

/* ====== SCROLL BEHAVIOR ====== */
html {
    scroll-padding-top: 80px; /* Prevents header from covering content */
}

/* ====== BODY PADDING FOR FIXED HEADER ====== */
body {
    padding-top: 70px; /* Match header height */
}

@media (max-width: 768px) {
    body {
        padding-top: 65px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
}
#menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    float: right;
    z-index: 1001;
    transition: all 0.3s ease;
}


#menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--dark-gray);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

#menu-toggle span:nth-child(1) {
    transform: translateY(-6px);
}

#menu-toggle span:nth-child(3) {
    transform: translateY(6px);
}

/* Hamburger to X Animation */
#menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background-color: var(--primary-green);
}

#menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

#menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
    background-color: var(--primary-green);
}

/* Hover effect for toggle button */
#menu-toggle:hover {
    transform: scale(1.1);
}

#menu-toggle:hover span {
    background-color: var(--primary-green);
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 768px) {
    #main-header {
        height: 65px;
    }
    
    /* Show toggle button on mobile */
    #menu-toggle {
        display: flex;
    }
    
    #main-header .logo img {
        height: 42px; /* Slightly smaller on mobile */
    }
    
    /* Mobile menu positioning */
    #main-nav {
        position: fixed;
        top: 65px; /* Match header height */
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 999;
        height: auto;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
    }
    
    #main-nav.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    #main-nav ul {
        flex-direction: column;
        gap: 0;
        height: auto;
        width: 100%;
    }
    
    #main-nav a {
        padding: 15px 20px;
        justify-content: center;
        height: 50px;
        border-radius: 8px;
        margin-bottom: 5px;
        width: 100%;
        font-size: 1.1rem;
    }
    
    .header-actions {
        gap: 10px;
    }
}

/* ====== TABLET RESPONSIVE ====== */
@media (max-width: 992px) {
    #main-nav ul {
        gap: 15px;
    }
    
    #main-nav a {
        padding: 6px 12px;
        font-size: 0.95rem;
    }
}

/* ====== SMALL MOBILE ====== */
@media (max-width: 480px) {
    #main-header {
        height: 60px;
    }
    
    #main-header .logo img {
        height: 38px;
    }
    
    #menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    #menu-toggle span {
        width: 22px;
        height: 2px;
    }
    
    #main-nav {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
    
    #main-nav a {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* ====== DESKTOP LARGE ====== */
@media (min-width: 1200px) {
    #main-header .container {
        padding: 0;
    }
}

/* ====== SCROLL BEHAVIOR ====== */
html {
    scroll-padding-top: 80px; /* Prevents header from covering content */
}

/* ====== BODY PADDING FOR FIXED HEADER ====== */
body {
    padding-top: 70px; /* Match header height */
}

@media (max-width: 768px) {
    body {
        padding-top: 65px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
}

/* ====== ANIMATION FOR PAGE LOAD ====== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#main-header {
    animation: fadeInDown 0.5s ease-out;
}