/**
 * Washington Home Improvements - Header & Footer Styles
 * Navigation, topbar, mobile menu, footer layout
 */

/* ========================================
   HEADER TOPBAR
   ======================================== */

.header-topbar {
    background: #1a2332; /* Dark blueprint blue */
    padding: var(--space-sm) 0;
    font-size: var(--text-xs);
    border-bottom: 3px solid var(--color-yellow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topbar-content {
    flex-wrap: wrap;
}

.topbar-text {
    color: var(--color-yellow);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topbar-link {
    color: var(--color-white);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: color var(--transition-fast);
}

.topbar-link:hover {
    color: var(--color-yellow);
}

.topbar-social a {
    color: var(--color-white);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.topbar-social a:hover {
    color: var(--color-yellow);
    transform: scale(1.1);
}

/* ========================================
   MAIN NAVIGATION
   ======================================== */

.site-header {
    position: relative;
    z-index: var(--z-header);
}

.main-navigation {
    background: var(--color-white);
    box-shadow: 0 2px 12px rgba(26, 35, 50, 0.08);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 145, 0, 0.1);
}

/* Hide any WordPress-generated site titles in header */
.main-navigation .site-title,
.main-navigation h1.site-title,
.main-navigation p.site-title {
    display: none !important;
}

.nav-wrapper {
    position: relative;
}

/* Logo */
.site-logo {
    max-width: 300px;
    flex-shrink: 0;
}

.site-logo a {
    display: inline-block;
    transition: transform var(--transition-fast);
}

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

.site-logo img {
    max-height: 60px;
    width: auto;
}

.logo-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #1a2332;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logo-text strong {
    color: #ff9100;
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ff9100 0%, #ff7c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Desktop Menu */
.nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 var(--space-lg);
    position: relative;
}

.nav-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 145, 0, 0.1) 20%,
        rgba(255, 145, 0, 0.2) 50%,
        rgba(255, 145, 0, 0.1) 80%,
        transparent 100%);
}

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

.nav-items > li {
    margin: 0;
    position: relative;
}

/* Remove yellow dot */
.nav-items > li::before {
    display: none;
}

.nav-items > li > a {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a2332;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    position: relative;
}

/* Remove emoji icons on desktop menu items */
.nav-items > li > a::before {
    display: none;
}

.nav-items > li > a:hover {
    color: #ff9100;
    border-bottom-color: #ff9100;
}

.nav-items li.current-menu-item > a,
.nav-items li.current_page_item > a {
    color: #ff9100;
    border-bottom-color: #ff9100;
}

.nav-items li.current-menu-item > a::before,
.nav-items li.current_page_item > a::before {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.nav-items li.current-menu-item > a::after,
.nav-items li.current_page_item > a::after {
    display: none;
}

/* ========================================
   MEGA MENU - SERVICES DROPDOWN
   ======================================== */

.nav-items .menu-item-has-children {
    position: relative;
}

/* Services mega menu container */
.nav-items .sub-menu {
    position: absolute;
    top: calc(100% + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(26, 35, 50, 0.15);
    padding: var(--space-xl);
    min-width: 600px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all var(--transition-base);
    border: 2px solid rgba(255, 145, 0, 0.1);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: var(--space-xl);
}

.nav-items .sub-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ff9100;
}

.nav-items .menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mega menu items */
.nav-items .sub-menu li {
    margin: 0;
    padding: 0;
}

.nav-items .sub-menu li::before {
    display: none;
}

.nav-items .sub-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 145, 0, 0.15);
    transition: all var(--transition-base);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    min-height: 120px;
    justify-content: center;
    gap: var(--space-sm);
    text-transform: none;
    letter-spacing: 0;
}

.nav-items .sub-menu a:hover {
    background: linear-gradient(135deg, #ff9100 0%, #ff7c00 100%);
    color: white;
    border-color: #ff9100;
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(255, 145, 0, 0.35);
}

/* Service icons in mega menu - use icon class instead */
.nav-items .sub-menu a .menu-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 145, 0, 0.1);
    border-radius: 50%;
    transition: all var(--transition-base);
    font-size: 24px;
}

.nav-items .sub-menu a:hover .menu-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.15) rotate(5deg);
}

/* ========================================
   MOBILE MENU
   ======================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background: var(--color-darker);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
}

.mobile-menu[aria-hidden="false"] {
    display: block;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-alpha-70);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 400px;
    height: 100%;
    background: var(--color-white);
    box-shadow: var(--shadow-2xl);
    overflow-y: auto;
    animation: slideInRight 0.3s ease-out;
    padding: var(--space-lg);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--yellow-alpha-20);
}

.mobile-menu-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a2332;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    color: var(--color-grey);
    transition: color var(--transition-fast);
}

.mobile-menu-close:hover {
    color: var(--color-red);
}

.mobile-nav-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-items > li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 145, 0, 0.1);
}

.mobile-nav-items > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #1a2332;
    transition: all var(--transition-fast);
    position: relative;
}

.mobile-nav-items > li > a::after {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-fast);
    color: #ff9100;
    font-size: 1.25rem;
}

.mobile-nav-items > li > a:hover {
    background: rgba(255, 145, 0, 0.05);
    color: #ff9100;
    padding-left: calc(var(--space-lg) + 8px);
}

.mobile-nav-items > li > a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav-items li.current-menu-item > a,
.mobile-nav-items li.current_page_item > a {
    background: linear-gradient(135deg, #ff9100 0%, #ff7c00 100%);
    color: white;
    font-weight: 700;
}

.mobile-nav-items li.current-menu-item > a::after,
.mobile-nav-items li.current_page_item > a::after {
    color: white;
    opacity: 1;
}

/* Mobile submenu styling */
.mobile-nav-items .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(255, 145, 0, 0.03);
}

.mobile-nav-items .sub-menu li {
    border-bottom: 1px solid rgba(255, 145, 0, 0.08);
}

.mobile-nav-items .sub-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    padding-left: calc(var(--space-lg) * 2);
    font-size: 0.9rem;
    color: #1a2332;
}

.mobile-nav-items .sub-menu .menu-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 145, 0, 0.1);
    border-radius: 50%;
    font-size: 18px;
    flex-shrink: 0;
}

.mobile-nav-items .sub-menu a:hover {
    background: rgba(255, 145, 0, 0.1);
    color: #ff9100;
}

.mobile-nav-items .sub-menu a:hover .menu-icon {
    background: #ff9100;
    transform: scale(1.1);
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: linear-gradient(180deg, #1a2332 0%, #0f1823 100%);
    padding: var(--space-4xl) 0 var(--space-xl) 0;
    position: relative;
    border-top: 4px solid #ff9100;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(52, 152, 219, 0.3) 25%,
        rgba(52, 152, 219, 0.5) 50%,
        rgba(52, 152, 219, 0.3) 75%,
        transparent 100%);
}

.footer-grid {
    margin-bottom: var(--space-2xl);
}

.footer-column {
    min-width: 0; /* Prevent flex overflow */
}

.footer-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
    color: var(--color-white);
    position: relative;
    padding-bottom: var(--space-sm);
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #ff9100 0%, rgba(255, 145, 0, 0) 100%);
}

.footer-tagline {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    color: var(--color-yellow);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.footer-social {
    margin-top: var(--space-md);
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 145, 0, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    transition: all var(--transition-base);
}

.social-link:hover {
    background: linear-gradient(135deg, #ff9100 0%, #ff7c00 100%);
    border-color: #ff9100;
    color: var(--color-white);
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 145, 0, 0.4);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    display: inline-block;
}

.footer-links a:hover {
    color: #ff9100;
    padding-left: var(--space-xs);
    transform: translateX(4px);
}

.footer-links a::before {
    content: '→';
    opacity: 0;
    margin-right: 0;
    transition: all var(--transition-fast);
    color: #ff9100;
}

.footer-links a:hover::before {
    opacity: 1;
    margin-right: var(--space-xs);
}

.footer-contact {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.contact-item svg {
    flex-shrink: 0;
    margin-top: 4px;
    fill: #ff9100;
    filter: drop-shadow(0 0 4px rgba(255, 145, 0, 0.3));
}

.contact-item a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.contact-item a:hover {
    color: #ff9100;
    text-decoration: underline;
}

.footer-hours {
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 145, 0, 0.2);
}

.footer-hours strong {
    color: #ff9100;
    font-size: var(--text-base);
}

.footer-service-areas {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 145, 0, 0.2);
}

.footer-service-areas p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
}

.footer-service-areas .text-yellow {
    color: #ff9100 !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 145, 0, 0.15);
}

.footer-bottom-content {
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-copyright,
.footer-credits {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-xs);
    margin: 0;
}

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

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Hide desktop menu, show mobile toggle */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide desktop mega menu on mobile - will use mobile menu drawer instead */
    .nav-menu .sub-menu {
        display: none !important;
    }

    /* Show sub-menu in mobile drawer */
    .mobile-nav-items .sub-menu {
        display: block !important;
    }

    /* Topbar responsive */
    .header-topbar {
        font-size: var(--text-xs);
        padding: var(--space-xs) 0;
    }

    .topbar-content {
        justify-content: center;
        gap: var(--space-sm);
    }

    .topbar-left,
    .topbar-right {
        font-size: 11px;
    }

    .topbar-social {
        gap: var(--space-xs);
    }

    /* Navigation responsive */
    .main-navigation {
        padding: var(--space-sm) 0;
    }

    .nav-cta {
        gap: var(--space-sm);
    }

    .btn-phone {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--text-xs);
    }

    .btn-phone svg {
        width: 14px;
        height: 14px;
    }

    /* Footer responsive */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-topbar {
        display: none; /* Hide topbar on very small screens */
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-text strong {
        font-size: 1rem;
    }

    .mobile-menu-content {
        width: 90%;
    }
}
