/* ============================================
   HEADER.CSS — Top bar, Navigation, Mobile Menu
   H&H AUTO & PLUS
   ============================================ */

/* ---- Top Bar ---- */
.topbar {
    background: var(--topbar-bg);
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.topbar-left svg, .topbar-right svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    flex-shrink: 0;
}
.topbar a {
    color: rgba(255,255,255,0.75);
    transition: color var(--transition);
}
.topbar a:hover { color: var(--accent); }
.topbar-phone {
    color: var(--accent) !important;
    font-weight: 600;
    font-size: 0.88rem;
}
.topbar-phone:hover { color: var(--accent-hover) !important; }

/* ---- Site Header ---- */
.site-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), background var(--transition);
}
.site-header.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    max-width: var(--container);
    margin: 0 auto;
    height: 72px;
}

/* ---- Logo ---- */
.site-logo {
    display: flex;
    flex-direction: column;
    gap: 0px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -0.01em;
}
.logo-name span { color: var(--accent); }
.logo-tag {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---- Main Navigation ---- */
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-parent > a {
    color: var(--primary);
    background: var(--bg-light);
}
/* Dropdown arrow */
.nav-menu > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--transition);
}
.nav-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(225deg) translateY(-2px);
}

/* ---- Dropdown Submenu ---- */
.sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 230px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 200;
    padding: 8px;
    list-style: none;
}
.nav-menu > li:hover > .sub-menu,
.nav-menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.sub-menu li a {
    display: block;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-dark);
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}
.sub-menu li a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

/* ---- Header CTA Button ---- */
.header-cta {
    margin-left: 12px;
    flex-shrink: 0;
}
.header-cta a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 700;
    transition: all var(--transition);
}
.header-cta a:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,115,10,0.4);
}
.header-cta svg {
    width: 16px; height: 16px;
    fill: none; stroke: currentColor; stroke-width: 2.5;
}

/* ---- Hamburger ---- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.hamburger:hover { background: var(--bg-light); }
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all var(--transition);
    transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- Mobile Menu Overlay ---- */
.mobile-menu-overlay {
    display: none; /* JS toggles to block when menu opens */
    position: fixed;
    inset: 0;
    background: rgba(15,18,40,0.55);
    z-index: 1010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Mobile Menu Panel ---- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(360px, 90vw);
    height: 100vh;
    background: var(--white);
    z-index: 1011;
    box-shadow: -8px 0 40px rgba(0,0,0,0.2);
    transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.mobile-menu.active { right: 0; }
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.mobile-menu-close {
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 1.2rem;
    transition: background var(--transition);
}
.mobile-menu-close:hover { background: var(--border); }
.mobile-nav {
    padding: 16px;
    flex: 1;
}
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav > ul > li { border-bottom: 1px solid var(--bg-light); }
.mobile-nav a {
    display: block;
    padding: 14px 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}
.mobile-nav a:hover { background: var(--bg-light); color: var(--primary); }
.mobile-submenu { display: none; padding: 4px 8px 8px; }
.mobile-submenu.active { display: block; }
.mobile-submenu a { font-size: 0.9rem; font-weight: 500; padding: 10px 12px; color: var(--text); }
.mobile-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}
.mobile-submenu-toggle > a {
    flex: 1;
}
.mobile-submenu-toggle .arrow {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
    color: var(--text);
    font-size: 0.9rem;
    border-radius: var(--radius);
    background: var(--bg-light);
    flex-shrink: 0;
    cursor: pointer;
}
.mobile-submenu-toggle .arrow:hover { background: var(--border); }
.mobile-submenu-toggle.open .arrow { transform: rotate(180deg); }

.mobile-menu-cta {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mobile-menu-cta a {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition);
}
.mobile-menu-cta .btn-call {
    background: var(--accent);
    color: var(--white);
}
.mobile-menu-cta .btn-call:hover { background: var(--accent-hover); }
.mobile-menu-cta .btn-contact {
    background: var(--bg-light);
    color: var(--primary);
    border: 2px solid var(--border);
}
.mobile-menu-cta .btn-contact:hover { background: var(--primary); color: var(--white); }

/* ---- Admin bar compensation ---- */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
