/* 2. Header Styles ========================= */
/* Styles for the top navigation/header, including logo, slogan, and contact info. */

/* Fixed header - always visible at top */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-md) 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    width: 100%;
    transform: none;
    margin: 0;
    /* Ensure header stays on top */
    will-change: transform;
}

/* Two-row header layout */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--spacing-sm);
}

/* Ensure logo image displays at a sensible size */
.site-logo {
    height: 64px;
    width: auto;
    display: inline-block;
    margin-right: var(--spacing-md);
    vertical-align: middle;
    flex-shrink: 0;
}

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Align logo image and brand text side-by-side */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Desktop Navigation Styles */
.desktop-nav {
    display: flex;
}

.desktop-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing-xl);
    align-items: center;
}

.desktop-nav li {
    margin: 0;
}

.desktop-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    position: relative;
    white-space: nowrap;
}

.desktop-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.desktop-nav a:active {
    transform: translateY(0);
}

/* Add subtle underline animation */
.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.desktop-nav a:hover::after {
    width: 80%;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-xs);
    color: #ffffff;
}

.slogan {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.header-contact {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    color: #ffffff;
}

.contact-item i {
    color: #ffffff;
}

/* Header contact icons specifically */
.header .contact-item i {
    color: #ffffff;
}

/* Ensure header contact info is always visible and properly styled */
.header .contact-item span,
.header .contact-item p,
.header .contact-item a {
    color: #ffffff;
    opacity: 1;
    visibility: visible;
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: color 0.2s ease;
    transform: none;
    text-decoration: none;
}

/* Phone link styling for header */
.header .phone-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Email link styling for header */
.header .email-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Override any contact section styling for header */
.header .contact-item {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    transition: none;
    transform: none;
}

.cta-button {
    background: var(--accent-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-normal);
    display: inline-block;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background: var(--accent-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

/* Header scrolled state */
.header.scrolled {
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
}

/* Mobile burger menu styles */
.burger-menu {
    display: none;
    cursor: pointer;
    z-index: 1001;
    background: transparent;
    border: none;
    padding: 0;
}

.burger-icon {
    width: 30px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.burger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-icon.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.burger-icon.active span:nth-child(2) {
    opacity: 0;
}

.burger-icon.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile sidebar styles - Optimized for low power mode */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    z-index: 1002;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    will-change: transform;
}

.mobile-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: white;
}

.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    padding: var(--spacing-lg);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: var(--spacing-md);
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    padding: var(--spacing-sm) 0;
    transition: color 0.3s ease;
}

.sidebar-nav a:hover {
    color: var(--accent-color);
}

.sidebar-contact {
    padding: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.sidebar-contact .contact-item {
    margin-bottom: var(--spacing-sm);
    color: white;
}

/* Phone link styling for mobile sidebar */
.sidebar-contact .phone-link {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.sidebar-contact .phone-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Email link styling for mobile sidebar */
.sidebar-contact .email-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.sidebar-contact .email-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Optimized overlay animation */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .header {
        padding: var(--spacing-sm) 0;
    }

    /* Mobile: Convert back to single row layout */
    .header-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--spacing-sm);
        text-align: left;
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    /* Hide desktop navigation and bottom row on mobile */
    .header-bottom {
        display: none;
    }

    .desktop-nav {
        display: none;
    }

    .logo {
        gap: var(--spacing-xs);
    }

    /* Show brand text on one compact line; hide slogan */
    .logo h1 {
        display: block;
        font-size: 1rem;
        line-height: 1.1;
        margin: 0;
        white-space: nowrap;
        max-width: 60vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .slogan {
        display: none;
    }

    .site-logo {
        height: 40px;
    }

    .header-contact {
        display: none;
    }

    .burger-menu {
        display: block;
    }
}

/* Tablet adjustments for navigation */
@media (max-width: 1024px) and (min-width: 769px) {
    .desktop-nav ul {
        gap: var(--spacing-lg);
    }

    .desktop-nav a {
        font-size: 0.9rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .header {
        padding: var(--spacing-xs) 0;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .slogan {
        font-size: 0.75rem;
    }

    .site-logo {
        height: 36px;
    }

    .contact-info {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .contact-item {
        font-size: 0.75rem;
    }

    .cta-button {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* Ensure header stays fixed on all screen sizes */
@media (max-width: 768px) {
    .header {
        /* Header positioning handled by base styles above */
        will-change: transform;
    }
}

@media (max-width: 480px) {
    .header {
        /* Header positioning handled by base styles above */
        will-change: transform;
    }
}

/* Header positioning is now handled by the base .header rule above */
/* The high specificity of .header should be sufficient */