/* ==========================================================================
   NETSPACE CORE NAVIGATION & LAYOUT SUITE — CSS (v2.2.0)
   Brand Red: #ec1a23 / #c9151b | Gold Accent: #f6c85f | Typography: Roboto, Arial, sans-serif
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,700&family=Montserrat:wght@500;600;700;800&display=swap');

/* Universal Reset & High-Fidelity Typography Stack */
#ns-header-root,
#ns-footer-root,
.ftcall,
.ns-mobile-sidebar,
.ns-mobile-menu-overlay {
    box-sizing: border-box !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

#ns-header-root *,
#ns-footer-root *,
.ftcall *,
.ns-mobile-sidebar * {
    box-sizing: border-box !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.ns-wrap {
    width: min(1580px, 99.6vw);
    max-width: 1580px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================================
   1. TOPBAR — SOLID BRAND RED (#ec1a23)
   ========================================================================== */
.ns-header-top {
    background-color: #ec1a23 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    padding: 6px 0 !important;
}

.ns-topbar-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
}

.ns-header-top p {
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ns-header-top a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: opacity 0.2s ease !important;
}

.ns-header-top a:hover {
    opacity: 0.88 !important;
    text-decoration: underline !important;
}

.ns-topbar-divider {
    opacity: 0.5;
    margin: 0 4px;
}

/* ==========================================================================
   2. MAIN HEADER — STICKY, BLUR, ORIGINAL HEIGHT (76px)
   ========================================================================== */
.ns-header-main {
    position: sticky !important;
    top: 0 !important;
    z-index: 990 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid #eeeeee !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

.ns-header-row {
    min-height: 76px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
}

/* Logo */
.ns-brand.ns-brand-logo {
    min-width: 144px !important;
    width: 144px !important;
    flex: 0 0 144px !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

.ns-brand-logo .ns-logo-img {
    display: block !important;
    width: 144px !important;
    max-width: 144px !important;
    max-height: 56px !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
}

/* Desktop Menu */
.ns-menu {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
    margin-left: auto !important;
    height: 100% !important;
}

.ns-menu-item {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important;
    padding: 10px 0 !important;
}

.ns-menu a,
.ns-menu-parent {
    color: #222222 !important;
    text-decoration: none !important;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    transition: color 0.18s ease !important;
    padding: 8px 6px !important;
    border-radius: 4px !important;
}

.ns-menu a:hover,
.ns-menu a:focus,
.ns-menu-item:hover > a,
.ns-menu-item:hover > .ns-menu-parent,
.ns-menu-item.is-hover > a,
.ns-menu-item.is-hover > .ns-menu-parent {
    color: #c9151b !important;
}

.ns-menu-parent {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
}

/* Submenus with Seamless Hover Bridge & Smooth Transitions */
.ns-submenu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1000 !important;
    min-width: 270px !important;
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 42px rgba(26, 18, 18, 0.14) !important;
    padding: 10px !important;
    display: grid !important;
    gap: 2px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(6px) !important;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s !important;
}

/* Cầu nối vô hình giúp rê chuột không bao giờ bị mất menu */
.ns-submenu::before {
    content: "" !important;
    position: absolute !important;
    top: -24px !important;
    left: 0 !important;
    right: 0 !important;
    height: 24px !important;
    background: transparent !important;
    display: block !important;
    z-index: 1 !important;
}

.ns-menu-item:hover > .ns-submenu,
.ns-menu-item:focus-within > .ns-submenu,
.ns-menu-item.is-hover > .ns-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.ns-submenu a {
    display: block !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #222222 !important;
    padding: 9px 12px 9px 22px !important;
    border-radius: 10px !important;
    position: relative !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
    z-index: 2 !important;
}

.ns-submenu a:before {
    content: "" !important;
    position: absolute !important;
    left: 9px !important;
    top: 50% !important;
    width: 5px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: #c9151b !important;
    transform: translateY(-50%) !important;
}

.ns-submenu a:hover {
    background: #fff3f3 !important;
    color: #c9151b !important;
}

.ns-menu-item.ns-menu-biquyet > .ns-submenu {
    left: 50% !important;
    transform: translateX(-50%) translateY(6px) !important;
    width: min(1080px, 94vw) !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.ns-menu-item.ns-menu-biquyet:hover > .ns-submenu,
.ns-menu-item.ns-menu-biquyet:focus-within > .ns-submenu,
.ns-menu-item.ns-menu-biquyet.is-hover > .ns-submenu {
    transform: translateX(-50%) translateY(0) !important;
}

.ns-menu-item.ns-menu-biquyet > .ns-submenu a {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Mobile Tools */
.ns-header-mobile-tools {
    display: none !important;
    align-items: center !important;
    gap: 10px !important;
}

.ns-mobile-call-icon {
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
    background: #fff3f3 !important;
    color: #c9151b !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

.ns-mobile-call-icon svg {
    width: 20px !important;
    height: 20px !important;
}

.ns-mobile-menu-toggle {
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
    border: 1px solid #e5e7eb !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 0 !important;
}

.ns-mobile-menu-toggle span {
    width: 22px !important;
    height: 2.2px !important;
    background: #222222 !important;
    border-radius: 2px !important;
}

/* Responsive Breakpoints */
@media (min-width: 1321px) {
    .ns-brand.ns-brand-logo { min-width: 152px !important; width: 152px !important; }
    .ns-brand-logo .ns-logo-img { width: 152px !important; max-width: 152px !important; }
    .ns-menu { gap: 12px !important; }
    .ns-menu a, .ns-menu-parent { font-size: 13.5px !important; }
}

@media (max-width: 1180px) {
    .ns-menu { display: none !important; }
    .ns-header-mobile-tools { display: flex !important; }
}

@media (max-width: 620px) {
    .ns-header-top .ns-topbar-wrap { display: block !important; text-align: center !important; }
    .ns-header-top p + p { margin-top: 4px !important; justify-content: center !important; }
    .ns-brand.ns-brand-logo { min-width: 132px !important; width: 132px !important; }
    .ns-brand-logo .ns-logo-img { width: 132px !important; max-height: 52px !important; }
    .ns-header-row { min-height: 66px !important; }
}

/* ==========================================================================
   3. MOBILE SIDEBAR DRAWER
   ========================================================================== */
.ns-mobile-menu-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 19998 !important;
    backdrop-filter: blur(3px) !important;
}

.ns-mobile-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -320px !important;
    width: 300px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2) !important;
    z-index: 19999 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow-y: auto !important;
}

.ns-mobile-sidebar.is-open {
    right: 0 !important;
}

.ns-mobile-sidebar-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid #eeeeee !important;
}

.ns-mobile-sidebar-logo img {
    height: 38px !important;
    width: auto !important;
    object-fit: contain !important;
}

.ns-mobile-menu-close {
    background: #f3f4f6 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 24px !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
    color: #222222 !important;
}

.ns-mobile-menu {
    padding: 10px 0 !important;
    flex-grow: 1 !important;
}

.ns-m-item > a {
    display: block !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #222222 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.ns-m-parent-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

.ns-m-parent-row a {
    flex-grow: 1 !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #222222 !important;
    text-decoration: none !important;
}

.ns-m-toggle {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    color: #777777 !important;
    cursor: pointer !important;
}

.ns-m-sub {
    display: none !important;
    background: #f9fafb !important;
}

.ns-m-has-sub.is-open .ns-m-sub {
    display: block !important;
}

.ns-m-has-sub.is-open .ns-m-toggle {
    color: #c9151b !important;
}

.ns-m-sub a {
    display: block !important;
    padding: 10px 20px 10px 32px !important;
    font-size: 13.5px !important;
    color: #444444 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #eeeeee !important;
}

.ns-mobile-sidebar-cta {
    padding: 20px !important;
    background: #f9fafb !important;
    border-top: 1px solid #eeeeee !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.ns-mobile-sidebar-cta a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

.ns-cta-call {
    background: #ec1a23 !important;
    color: #ffffff !important;
}

.ns-cta-form {
    background: #ffffff !important;
    color: #ec1a23 !important;
    border: 1px solid #ec1a23 !important;
}

/* ==========================================================================
   4. FIXED HOTLINE & STICKER BOTTOM BAR (ORIGINAL FTCALL)
   ========================================================================== */
:root {
    --onepanel-ftcall-height: 55px;
    --onepanel-ftcall-mobile-height: 60px;
}

html {
    scroll-padding-bottom: calc(var(--onepanel-ftcall-height) + 18px + env(safe-area-inset-bottom));
}

body {
    padding-bottom: calc(var(--onepanel-ftcall-height) + env(safe-area-inset-bottom)) !important;
}

.ftcall {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    min-height: var(--onepanel-ftcall-height) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 max(16px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-right)) !important;
    color: #ffffff !important;
    background: linear-gradient(180deg, #ec1a23 0%, #c5121a 100%) !important;
    border-top: 3px solid #f6c85f !important;
    box-shadow: 0 -14px 34px rgba(119, 16, 21, 0.28) !important;
}

.ftcall__inner {
    width: min(1180px, 100%) !important;
    min-height: calc(var(--onepanel-ftcall-height) - 3px) !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
    padding: 6px 0 !important;
}

.ftcall__link-home,
.ftcall__link-zalo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 6px 14px !important;
    border-radius: 999px !important;
    transition: background 0.2s ease !important;
}

.ftcall__link-home:hover,
.ftcall__link-zalo:hover {
    background: rgba(255, 255, 255, 0.28) !important;
}

.ftcall__phone {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 900 !important;
    font-size: 19px !important;
    letter-spacing: 0.5px !important;
}

.ftcall__phone-icon {
    font-size: 20px !important;
}

.ftcall__cta {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 8px 18px !important;
    border-radius: 999px !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    background: #ffffff !important;
    color: #c9151b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.ftcall__cta:hover {
    background: #f6c85f !important;
    color: #1f1f1f !important;
    transform: translateY(-1px) !important;
}

@media (max-width: 620px) {
    .ftcall__inner {
        gap: 8px !important;
        justify-content: space-between !important;
    }
    .ftcall__phone {
        font-size: 16px !important;
    }
    .ftcall__link-home span,
    .ftcall__link-zalo span {
        display: none !important;
    }
    .ftcall__link-home,
    .ftcall__link-zalo {
        padding: 6px 10px !important;
    }
    .ftcall__cta {
        min-height: 34px !important;
        padding: 6px 14px !important;
        font-size: 12.5px !important;
    }
}
