/* ============================================================
   A Plus Auto Shop — Shared Header, Footer & Base Styles
   common.css — linked from every page
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1a1a2e;
    line-height: 1.6;
    background: #fff;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ===== CSS VARIABLES ===== */
:root {
    --primary: #1a56db;
    --primary-dark: #1240a8;
    --accent: #e63946;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 12px 28px rgba(0,0,0,0.09);
    --radius: 12px;
    --max-width: 1200px;
}

/* ===== CONTAINER ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ===== TOP BAR ===== */
.top-bar {
    background: var(--dark);
    color: var(--gray-400);
    font-size: 0.85rem;
    padding: 8px 0;
}
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.top-bar a { color: var(--gray-200); transition: color 0.2s; }
.top-bar a:hover { color: var(--white); }
.top-bar .hours { display: flex; align-items: center; gap: 6px; }
.top-bar .phone { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--white); }

/* ===== HEADER / NAV ===== */
header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}
.logo {
    font-family: 'League Spartan', sans-serif;
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
}
.nav-links { display: flex; gap: 32px; align-items: center; list-style: none; }
.nav-links a {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s;
}
.nav-links a:hover::after { width: 100%; }
/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-dropdown > a .chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}
.nav-dropdown:hover > a .chevron { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    transform: translateX(-50%) translateY(8px);
    z-index: 200;
}
/* Services dropdown — multi-column for 23 services */
.nav-dropdown:first-child .dropdown-menu {
    columns: 2;
    column-gap: 0;
    min-width: 420px;
}
.nav-dropdown:first-child .dropdown-menu a {
    break-inside: avoid;
}
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--gray-600) !important;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.dropdown-menu a::after { display: none !important; }
.dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary) !important;
}

.nav-cta {
    background: var(--primary);
    color: var(--white) !important;
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}
.nav-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }
.nav-cta::after { display: none !important; }

/* Mobile menu toggle */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    margin: 5px 0;
    transition: 0.3s;
}

/* ===== FOOTER ===== */
footer {
    background: var(--dark);
    color: var(--gray-400);
    padding: 56px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand .logo { color: var(--white); margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; max-width: 300px; }
.footer-col h4 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--gray-400); font-size: 0.9rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.85rem;
}
.footer-bottom a { color: var(--gray-400); }
.footer-bottom a:hover { color: var(--white); }

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26,86,219,0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 99;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26,86,219,0.45);
}

/* ===== SHARED RESPONSIVE — Header, Footer, Top Bar ===== */
@media (max-width: 768px) {
    .top-bar .container { justify-content: center; text-align: center; }
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-lg);
    }
    .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        border-left: 2px solid var(--primary);
        border-radius: 0;
        padding: 4px 0 4px 8px;
        min-width: unset;
        margin-top: 8px;
    }
    .dropdown-menu a { padding: 6px 12px; font-size: 0.88rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

