/* ============================================================
   AutoScore — Layout (header, footer, main)
   ============================================================ */

/* ---- Header ---- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    transition:
        box-shadow var(--transition-base),
        background var(--transition-base);
    border-bottom: 1px solid transparent;
}
.site-header.scrolled {
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.97);
    border-bottom-color: var(--color-gray-100);
}
.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
}

/* ---- Brand / Logo ---- */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    color: var(--color-gray-900);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.brand img {
    height: 46px;
    width: auto;
}

/* ---- Nav ---- */
.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}
.nav a {
    padding: 9px 11px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--color-gray-700);
    border-radius: 8px;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
    white-space: nowrap;
}
.nav a:hover,
.nav a.active {
    color: var(--color-primary);
    background: var(--color-gray-50);
}
.nav-cta {
    display: flex;
    gap: 8px;
    margin-left: 4px;
}

/* ---- Mega menu ---- */
.has-mega {
    position: relative;
}
.has-mega::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 18px;
}
.mega {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    transform: translateY(8px);
    background: #fff;
    border: 1px solid var(--color-gray-100);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 18px;
    min-width: 340px;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity var(--transition-base),
        transform var(--transition-base);
    z-index: 200;
}
.has-mega.open .mega {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.mega a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--color-gray-700);
    font-size: 14px;
}
.mega a:hover {
    background: var(--color-gray-50);
    color: var(--color-primary);
}
.mega [role="separator"] {
    height: 1px;
    background: var(--color-gray-100);
    margin: 8px 0;
}

/* ---- Mobile menu toggle ---- */
.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--color-gray-200);
    align-items: center;
    justify-content: center;
    margin-left: auto;
}
.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-gray-800);
    position: relative;
    transition: background var(--transition-fast);
}
.menu-toggle span::before,
.menu-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--color-gray-800);
    transition: transform var(--transition-fast);
}
.menu-toggle span::before {
    top: -6px;
}
.menu-toggle span::after {
    top: 6px;
}

/* ---- Main ---- */
main {
    padding-top: var(--header-h);
}

/* ---- Footer ---- */
.site-footer {
    background: var(--color-gray-900);
    color: rgba(255, 255, 255, 0.75);
    padding: 80px 0 32px;
    margin-top: 80px;
}
.site-footer .brand img {
    filter: brightness(0) invert(1);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 40px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}
.footer-grid h4 {
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
}
.footer-grid a:not(.btn) {
    display: block;
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14.5px;
    transition: color var(--transition-fast);
}
.footer-grid a:not(.btn):hover {
    color: #fff;
}
.footer-grid p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14.5px;
}
.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.footer-brand-space {
    margin-bottom: 16px;
}
.footer-cnpj {
    margin-top: 10px;
    font-size: 13px;
}
.footer-badges-space {
    margin-top: 16px;
}
.footer-link-muted {
    color: rgba(255, 255, 255, 0.7);
}
.footer-cta-space {
    margin-top: 12px;
}
.footer-badges span {
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 10px;
    border-radius: 99px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}
.footer-bottom {
    max-width: var(--container);
    margin: 48px auto 0;
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}
.footer-bottom a {
    color: rgba(255, 255, 255, 0.5);
}
.footer-bottom a:hover {
    color: #fff;
}
