/* ===============================================
   RESPONSIVE HEADER & NAVIGATION STYLES
   =============================================== */

/* CSS Variables for consistent theming */
:root {
    --header-bg: #ffffff;
    --header-border: #e0e0e0;
    --nav-bg: #f8f9fa;
    --nav-link-color: #333333;
    --nav-link-hover: var(--primary-color);
    --nav-link-active: var(--driving-rookie);
    --social-icon-color: #666666;
    --social-icon-hover: #ff4500;
    --mobile-menu-bg: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --nav-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===============================================
   MAIN HEADER STYLES
   =============================================== */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    transition: all 0.3s ease;
}

/* Header Top Section */
.header-top {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 12px 0;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Logo Styles */
.header-logo {
    flex-shrink: 0;
}

.logo-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-image {
    height: 100px;
    width: auto;
    max-width: 400px;
    object-fit: contain;
}

/* Header Contact Section */
.header-contact {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--nav-bg);
    color: var(--social-icon-color);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 1px solid var(--header-border);
}

.social-link:hover {
    background: var(--social-icon-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

/* Phone Number */
.header-phone {
    flex-shrink: 0;
}

.phone-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.phone-link:hover {
    transform: scale(1.05);
}

.phone-image {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* ===============================================
   NAVIGATION STYLES
   =============================================== */

.main-navigation {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--header-border);
    position: relative;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0;
    min-height: 60px;
}

/* Desktop Navigation Menu */
.desktop-menu {
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 18px 24px;
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--nav-link-hover);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
    color: var(--nav-link-active);
    background: rgba(255, 69, 0, 0.05);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.nav-toggle-bar {
    width: 24px;
    height: 3px;
    background: var(--nav-link-color);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger Animation */
.nav-toggle.active .nav-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .nav-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation Menu */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--mobile-menu-bg);
    box-shadow: var(--nav-shadow);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, box-shadow 0.3s ease;
}

.mobile-menu.active {
    max-height: 600px;
    overflow-y: auto;
}

/* Mobile menu base styles */
.mobile-menu .nav-links {
    flex-direction: column;
    padding: 20px 0;
}

.mobile-menu .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--header-border);
}

.mobile-menu .nav-item:last-child {
    border-bottom: none;
}

.mobile-menu .nav-link {
    padding: 16px 30px;
    border-radius: 0;
    text-align: left;
}

.mobile-menu .nav-link::after {
    display: none;
}

.mobile-menu .nav-link:hover,
.mobile-menu .nav-link.active {
    background: rgba(255, 69, 0, 0.1);
    padding-left: 40px;
}

/* Navigation Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Header scroll state */
.main-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.main-header.scrolled .header-top {
    padding: 8px 0;
}

.main-header.scrolled .logo-image {
    height: 45px;
}

.main-header.scrolled .phone-image {
    height: 35px;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablet Styles */
@media (max-width: 1024px) {
    .header-top-content {
        gap: 15px;
    }

    .social-links {
        gap: 12px;
    }

    .social-link {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .nav-link {
        padding: 16px 20px;
        font-size: 15px;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Adjust body padding for smaller header */
    body {
        padding-top: 100px;
    }

    /* Header Top Section */
    .header-top {
        padding: 10px 0;
    }

    .header-top-content {
        gap: 10px;
        justify-content: space-between;
    }

    /* Logo adjustments */
    .logo-image {
        height: 60px;
        max-width: 250px;
    }

    /* Scrolled state logo */
    .main-header.scrolled .logo-image {
        height: 50px;
    }

    /* Header Contact Section */
    .header-contact {
        gap: 12px;
    }

    /* Social Links */
    .social-links {
        gap: 8px;
    }

    .social-link {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Phone Number */
    .phone-image {
        height: 32px;
        max-width: 120px;
    }

    .main-header.scrolled .phone-image {
        height: 28px;
    }

    /* Navigation */
    .nav-content {
        min-height: 50px;
    }

    /* Hide desktop menu on mobile */
    .desktop-menu {
        display: none;
    }

    /* Show mobile menu toggle */
    .nav-toggle {
        display: flex;
    }

    /* Show overlay when needed */
    .nav-overlay {
        display: block;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    /* Further reduce body padding */
    body {
        padding-top: 90px;
    }

    /* Header Top */
    .header-top {
        padding: 8px 0;
    }

    .header-top-content {
        gap: 8px;
    }

    /* Logo */
    .logo-image {
        height: 50px;
        max-width: 200px;
    }

    .main-header.scrolled .logo-image {
        height: 40px;
    }

    /* Hide social links on very small screens to save space */
    .social-links {
        display: none;
    }

    /* Phone Number */
    .phone-image {
        height: 28px;
        max-width: 100px;
    }

    .main-header.scrolled .phone-image {
        height: 24px;
    }

    /* Navigation */
    .nav-toggle {
        right: 10px;
        width: 44px;
        height: 44px;
    }

    .nav-toggle-bar {
        width: 22px;
    }

    /* Mobile menu links */
    .mobile-menu .nav-link {
        padding: 14px 20px;
        font-size: 15px;
    }

    .mobile-menu .nav-link:hover,
    .mobile-menu .nav-link.active {
        padding-left: 30px;
    }
}

/* ===============================================
   ACCESSIBILITY & FOCUS STYLES
   =============================================== */

.nav-link:focus,
.social-link:focus,
.logo-link:focus,
.phone-link:focus,
.nav-toggle:focus {
    outline: 2px solid var(--nav-link-hover);
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===============================================
   ANIMATION UTILITIES
   =============================================== */

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===============================================
   PRINT STYLES
   =============================================== */

@media print {
    .main-header {
        position: static;
        box-shadow: none;
    }
    
    .nav-toggle,
    .nav-overlay,
    .social-links {
        display: none;
    }
    
    .mobile-menu {
        display: none;
    }
    
    .desktop-menu {
        display: block;
    }
    
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Body padding for fixed header */
body {
    padding-top: 130px; /* Adjust based on header height */
}
