/**
 * Global header - 100% replica of index.html header
 * Include this on all pages for consistent header styling
 */

/* Top Contact Bar */
.top-bar {
    background: var(--dark-brown);
    color: var(--light-text);
    padding: 10px 0;
    font-size: 14px;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar a {
    color: var(--light-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: var(--bronze);
}

/* Header and nav above all content so mega menu is never covered */
#site-header {
    position: relative;
    z-index: 10000;
}

/* Navigation */
.navbar {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 4px 30px var(--shadow-color);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    overflow: visible;
}

/* Services trigger: small dropdown icon beside text */
.services-trigger { display: inline-flex; align-items: center; gap: 6px; }
.nav-dropdown-icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 2px;
    transition: transform 0.2s ease;
}
.mega-menu-item.open .nav-dropdown-icon { transform: rotate(180deg); }

/* Services mega menu */
.mega-menu-item { position: relative; }
.mega-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 640px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(205, 127, 50, 0.4);
    background: var(--dark-brown);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    z-index: 10001;
}
.mega-menu-item:hover .mega-menu,
.mega-menu-item.open .mega-menu { display: block; }
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 8px 14px;
}
.mega-menu-grid a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--light-text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}
.mega-menu-grid a::after { display: none; }
.mega-menu-grid a:hover {
    background: rgba(205, 127, 50, 0.35);
    color: var(--light-text);
}

/* Logo section - 68x68 box */
.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
    transition: color 0.3s ease;
    width: 68px;
    height: 68px;
    min-width: 68px;
    min-height: 68px;
    padding: 4px;
    box-sizing: border-box;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .logo-section {
    background: #fff;
}

.logo-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .company-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-text .tagline {
    font-size: 12px;
    font-weight: 500;
    color: var(--bronze);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--bronze);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bronze);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 60px;
    height: 30px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 3px;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.theme-toggle:hover {
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle-slider {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bronze);
    position: absolute;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(30px);
}

.theme-toggle-slider::before {
    content: '☀️';
    display: block;
}

[data-theme="dark"] .theme-toggle-slider::before {
    content: '🌙';
}

.cta-button {
    background: linear-gradient(135deg, var(--bronze) 0%, var(--primary-brown) 100%);
    color: var(--light-text);
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

/* Responsive - header */
@media (max-width: 768px) {
    .top-bar {
        position: relative;
        font-size: 11px;
        padding: 8px 0;
    }
    .top-bar-container {
        flex-direction: column;
        gap: 5px;
        padding: 0 10px;
        text-align: center;
    }
    .top-bar a {
        font-size: 11px;
    }
    .navbar {
        position: relative;
        top: 0;
        margin-top: 0;
    }
    .nav-container {
        flex-wrap: wrap;
        padding: 12px 15px;
        gap: 10px;
        justify-content: center;
    }
    .logo-section {
        flex: 1 1 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    .nav-container > div {
        flex: 1 1 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    .logo-img {
        height: 80px;
        max-width: 300px;
    }
    .logo-text .company-name {
        font-size: 20px;
    }
    .logo-text .tagline {
        font-size: 10px;
    }
    .nav-links {
        display: none;
    }
    .theme-toggle {
        width: 50px;
        height: 28px;
    }
    .theme-toggle-slider {
        width: 22px;
        height: 22px;
    }
    [data-theme="dark"] .theme-toggle-slider {
        transform: translateX(22px);
    }
    .cta-button {
        padding: 10px 16px;
        font-size: 12px;
        white-space: nowrap;
    }
}
