.topbar,
.footer {
    --site-text: #182230;
    --site-brand: #2563eb;
    --site-brand-dark: #1d4ed8;
    --site-max: 1180px;
}

.topbar .container,
.footer .container {
    width: min(var(--site-max), calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #edf1f6;
}

.topbar-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    min-height: 74px;
}

.topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--site-text);
    font-weight: 700;
    white-space: nowrap;
}

.topbar .brand img {
    width: auto;
    height: 36px;
    max-width: none;
    object-fit: contain;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.brand-text {
    font-size: 25px;
    line-height: 1;
    letter-spacing: 0.5px;
}

.topbar .nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    min-width: 0;
    height: auto;
    padding-left: 24px;
    position: static;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    height: 74px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 600;
    color: #273244;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 2px;
    background: var(--site-brand);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-item:hover > .nav-link {
    color: var(--site-brand);
}

.nav-link:hover::after,
.nav-item:hover > .nav-link::after {
    transform: scaleX(1);
}

.nav-arrow {
    font-size: 12px;
    color: #8b97a8;
}

.nav-item:hover .nav-arrow {
    color: var(--site-brand);
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(8px);
    transform-origin: left top;
    width: min(900px, calc(100vw - 80px));
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 0 0 18px 18px;
    border-top: 0;
    padding: 22px 24px 24px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.22s ease;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.mega-col + .mega-col {
    border-left: 1px solid #f0f3f8;
    padding-left: 28px;
}

.mega-title {
    margin: 0 0 14px;
    padding-left: 12px;
    border-left: 3px solid var(--site-brand);
    font-size: 17px;
    font-weight: 700;
    color: #243042;
}

.mega-list {
    display: grid;
    gap: 12px;
}

.mega-list a {
    display: block;
    padding: 12px 16px;
    border: 1px solid #eff3f8;
    border-radius: 10px;
    background: #fff;
    color: #2f3b4c;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.mega-list a:hover {
    color: var(--site-brand);
    border-color: #d8e6ff;
    background: #f8fbff;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.topbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 600;
    transition: 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
}

.topbar .btn-primary {
    background: var(--site-brand);
    color: #fff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.topbar .btn-primary:hover {
    background: var(--site-brand-dark);
}

.topbar .btn-secondary {
    color: #fff;
    border-color: #E91E63;
    background: #E91E63;
}

.footer {
    padding: 24px 0 36px;
    background: #0b1220;
    color: rgba(255, 255, 255, 0.72);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.footer a {
    color: #fff;
    font-size: 15px;
    text-decoration: underline;
}

@media (max-width: 980px) {
    .topbar-inner {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 16px;
        padding: 14px 0;
    }

    .topbar .nav {
        display: none;
    }

    .nav-actions {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        min-height: auto;
    }

    .nav-actions {
        gap: 8px;
    }

    .topbar .btn {
        height: 40px;
        padding: 0 16px;
        font-size: 14px;
    }

    .brand-text {
        font-size: 24px;
    }
}
