/* Navigation Styles for Automotive Parts Supplier Website */
/* Built on top of Bootstrap 5.3.0 */
/* Consistent with styles.css design system */

/* ===============================
   Top Contact Bar Styles
   =============================== */

.top-contact-bar {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 0.75rem 0;
    font-size: 0.875rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1001;
    transition: all 0.3s ease;
    margin: 0;
    border: 0;
    height: 60px;
    display: flex;
    align-items: center;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 减少顶部联系栏的左右间距 */
.top-contact-bar .container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: none;
}

/* 大屏幕时更紧凑的布局 */
@media (min-width: 1200px) {
    .top-contact-bar .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.contact-info .contact-item {
    color: var(--white);
    font-weight: 500;
    opacity: 0.95;
}

.contact-info .contact-item i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

.social-links .social-link {
    color: var(--white);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

.social-links .social-link:hover {
    background-color: var(--white);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 在首页start section中隐藏顶部联系栏 - 通过JavaScript控制 */
body.start-page-active .top-contact-bar {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: all 0.5s ease;
}

/* 当start page不活跃时显示顶部联系栏 */
body:not(.start-page-active) .top-contact-bar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.5s ease;
}

/* 当顶部联系栏显示时，调整navbar的位置 */
.navbar.custom-navbar {
    top: 0;
    transition: all 0.5s ease;
    margin-top: 0;
}

/* 当顶部联系栏存在且可见时，navbar紧贴在下方 */
body:not(.start-page-active) .navbar.custom-navbar {
    top: 60px;
    margin-top: 0;
    opacity: 1;
    visibility: visible;
}

/* 在start page活跃时，navbar在顶部且隐藏 */
body.start-page-active .navbar.custom-navbar {
    top: 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
}

/* 调整页面内容的padding，以适应固定的顶部联系栏和navbar */
body:not(.start-page-active) {
    padding-top: 120px; /* 60px (contact bar) + 60px (navbar) */
}

/* start page活跃时不需要额外的padding */
body.start-page-active {
    padding-top: 0;
}

/* 移动端顶部联系栏样式 */
@media (max-width: 1400px) {
    .top-contact-bar {
        padding: 0.5rem 0;
        font-size: 0.75rem;
        height: 45px;
        display: flex;
        align-items: center;
    }
    
    .mobile-contact-layout {
        padding: 0 0.5rem;
    }
    
    .mobile-contact-info {
        flex: 1;
    }
    
    .mobile-contact-item {
        color: var(--white);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        transition: all 0.2s ease;
        font-size: 0.7rem;
        font-weight: 500;
        white-space: nowrap;
    }
    
    .mobile-contact-item:hover {
        color: var(--white);
        background-color: rgba(255, 255, 255, 0.1);
        text-decoration: none;
    }
    
    .mobile-contact-item i {
        font-size: 0.65rem;
        width: 14px;
        text-align: center;
    }
    
    .mobile-social-links {
        flex-shrink: 0;
    }
    
    .mobile-social-link {
        color: var(--white);
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s ease;
        text-decoration: none;
        background-color: rgba(255, 255, 255, 0.1);
        font-size: 0.7rem;
    }
    
    .mobile-social-link:hover {
        background-color: var(--white);
        color: var(--primary-blue);
        transform: translateY(-1px);
        text-decoration: none;
    }
    
    /* 移动端时调整navbar位置 */
    body:not(.start-page-active) .navbar.custom-navbar {
        top: 45px;
    }
    
    /* 移动端start page活跃时navbar在顶部 */
    body.start-page-active .navbar.custom-navbar {
        top: 0;
    }
    
    /* 移动端时调整body padding */
    body:not(.start-page-active) {
        padding-top: 105px; /* 45px (contact bar) + 60px (navbar) */
    }
    
    /* 移动端start page活跃时不需要额外padding */
    body.start-page-active {
        padding-top: 0;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .top-contact-bar {
        padding: 0.375rem 0;
        height: 40px;
        font-size: 0.7rem;
    }
    
    .mobile-contact-item {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
        gap: 0.2rem;
    }
    
    .mobile-contact-item i {
        font-size: 0.6rem;
        width: 12px;
    }
    
    .mobile-social-link {
        width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }
    
    /* 超小屏幕时调整navbar位置 */
    body:not(.start-page-active) .navbar.custom-navbar {
        top: 40px;
    }
    
    /* 超小屏幕时调整body padding */
    body:not(.start-page-active) {
        padding-top: 100px; /* 40px (contact bar) + 60px (navbar) */
    }
}

/* Navbar Customizations */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    padding: 0.1rem 0;
    margin: 0;
}

/* 减少导航栏容器的左右间距 */
.navbar .container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: none;
}

/* 大屏幕时更紧凑的布局 */
@media (min-width: 1200px) {
    .navbar .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--primary-blue) !important;
    letter-spacing: -0.02em;
}

/* Logo Image Styles - 简单清晰 */
.navbar-brand .logo-img {
    width: 240px;
    height: 100px;
    object-fit: contain;
}

/* Logo hover effect - 使用更轻微的效果避免模糊 */
.navbar-brand:hover .logo-img {
    opacity: 0.8;
    transform: translateY(-1px); /* 使用位移而不是缩放 */
}

/* Mobile logo adjustments */
@media (max-width: 1400px) {
    .navbar-brand .logo-img {
        height: 50px; /* 移动端适当尺寸 */
        width: auto;
        max-width: 200px;
        margin-left: 0; /* 移除额外的左边距 */
    }
    
    .navbar-brand {
        margin-left: 0 !important; /* 强制移除brand容器的左边距 */
        margin-right: auto; /* 让logo靠左对齐 */
        padding-left: 0 !important; /* 移除额外的左边距 */
    }
}

/* Small mobile adjustments */
@media (max-width: 576px) {
    .navbar-brand .logo-img {
        height: 45px; /* 小屏幕适当调整 */
        width: auto;
        max-width: 180px;
        margin-left: 0; /* 移除额外的左边距 */
    }
    
    .navbar-brand {
        margin-left: 0 !important; /* 强制移除brand容器的左边距 */
        margin-right: auto; /* 让logo靠左对齐 */
        padding-left: 0 !important; /* 移除额外的左边距 */
    }
}

/* 高DPI屏幕优化 - 区分电脑端和移动端 */
@media (-webkit-min-device-pixel-ratio: 2) and (min-width: 1401px), (min-resolution: 192dpi) and (min-width: 1401px) {
    /* 电脑端高DPI - SVG图像优化 */
    .navbar-brand .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        shape-rendering: geometricPrecision;
    }
}

@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 1400px), (min-resolution: 192dpi) and (max-width: 1400px) {
    /* 移动端高DPI - PNG图像优化 */
    .navbar-brand .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: auto; /* PNG图像使用auto渲染 */
        image-rendering: high-quality;
    }
}

/* Logo hover effect for mobile - 使用位移效果 */
@media (max-width: 1400px) {
    .navbar-brand:hover .logo-img {
        opacity: 0.8;
        transform: translateY(-1px); /* 使用位移而不是缩放 */
    }
}

@media (max-width: 576px) {
    .navbar-brand:hover .logo-img {
        opacity: 0.8;
        transform: translateY(-1px); /* 使用位移而不是缩放 */
    }
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
    margin-left: 10px;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

.nav-link.active {
    color: var(--primary-blue) !important;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    width: 30px;
    height: 3px;
    background-color: var(--primary-blue);
    transform: translateX(-50%);
    border-radius: var(--border-radius);
}

/* Custom Navigation Right Section */
.custom-nav-right {
    gap: 1.5rem;
}

.custom-search-container {
    position: relative;
}

.custom-search-input {
    width: 220px;
    padding: 0.5rem 2.5rem 0.5rem 0.875rem;
    background-color: var(--search-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.custom-search-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
    background-color: var(--white);
}

.custom-search-input::placeholder {
    color: var(--text-muted);
}

.custom-search-icon {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: var(--transition);
}

.custom-search-icon-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: var(--transition);
}

.custom-search-icon-btn:hover {
    background-color: var(--primary-blue);
}

.custom-search-icon-btn:hover .custom-search-icon {
    color: white;
}

.custom-search-icon-btn:focus {
    outline: none;
    background-color: var(--primary-blue);
}

.custom-search-icon-btn:focus .custom-search-icon {
    color: white;
}

/* Enhanced Language Selector */
.custom-language-selector {
    background-color: transparent;
    border: 0px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
}

.custom-language-selector:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background-color: transparent;
}

/* 桌面端hover时显示语言选择器下拉菜单 - 最高优先级 */
@media (min-width: 1401px) {
    .dropdown.custom-language-dropdown.language-dropdown:hover .custom-language-menu,
    .nav-item.dropdown.language-dropdown:hover .custom-language-menu {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }
    
    /* 确保下拉菜单本身hover时也保持显示 */
    .custom-language-menu:hover {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }
    
    /* 整个语言选择器区域hover时显示 - 组合选择器 */
    .dropdown.custom-language-dropdown.language-dropdown:hover .custom-language-menu,
    .dropdown.custom-language-dropdown.language-dropdown .custom-language-menu:hover,
    .nav-item.dropdown.language-dropdown:hover .custom-language-menu,
    .nav-item.dropdown.language-dropdown .custom-language-menu:hover {
        display: block !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }
}

/* 隐藏Bootstrap默认的dropdown箭头，使用自定义箭头 */
.custom-language-selector.dropdown-toggle::after {
    display: none !important;
}

/* 全局隐藏所有Bootstrap dropdown箭头 */
.dropdown-toggle::after {
    display: none !important;
}

/* Products链接中的箭头样式 */
.mobile-dropdown-toggle .dropdown-indicator,
.dropdown-toggle .fa-chevron-down {
    transition: transform 0.3s ease, color 0.2s ease;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

/* 箭头hover效果 */
.mobile-dropdown-toggle .dropdown-indicator:hover,
.dropdown-toggle .fa-chevron-down:hover {
    color: var(--primary-blue);
    background-color: transparent;
    transform: scale(1.1);
}

/* 下拉菜单展开时箭头旋转 */
.nav-link[aria-expanded="true"] .dropdown-indicator,
.dropdown-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.custom-language-selector i.fa-chevron-down {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    opacity: 0.7;
}

.custom-language-text {
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Language Dropdown Menu */
.custom-language-menu {
    background-color: var(--white);
    border: 0px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 200px;
    max-width: 220px;
    padding: 0.25rem 0;
    margin-top: 0.125rem;
    margin-left: 0;
    margin-right: 0;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    visibility: hidden;
    right: 0;
    left: auto;
}

.custom-language-menu.show {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.custom-language-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.875rem;
    margin: 0.125rem 0.3rem;
    position: relative;
}

/* Hover state for language items ONLY */
.dropdown-item.custom-language-item:hover {
    background-color: transparent;
    color: var(--text-dark);
}

/* Active state when clicked for language items ONLY */
.dropdown-item.custom-language-item:active {
    background-color: transparent;
}

/* Selected/Current language state */
.dropdown-item.custom-language-item.active {
    background-color: transparent;
    color: var(--primary-blue);
    font-weight: 600;
}

.language-flag {
    font-size: 1.25rem;
    margin-right: 0.7rem;
    display: inline-block;
    width: 25px;
    text-align: center;
}

.language-name {
    flex: 1;
    font-weight: 500;
    margin-right: 0.7rem;
}

.language-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    background-color: var(--light-bg);
    padding: 0.25rem 0.45rem;
    border-radius: 0.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    min-width: 29px;
    text-align: center;
}

/* Bootstrap 会自动处理 .show 类，不需要自定义规则 */

/* Mega Menu Styles - 与现有风格一致 */
.mega-menu {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    margin-top: 0.75rem !important;
    min-width: 750px;
    width: auto;
    background-color: var(--white);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s ease-out;
    pointer-events: none;
    display: none !important; /* 默认完全隐藏 */
    z-index: 1000;
    position: absolute !important;
    top: 100% !important;
    left: -200px !important; /* 固定定位 */
    right: auto !important;
}

/* Mega Menu Container */
.mega-menu-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mega Menu Section (Top section with main link) */
.mega-menu-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.mega-menu-title {
    margin-bottom: 0;
}

.mega-menu-main-link {
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background-color: rgba(49, 130, 206, 0.05);
}

.mega-menu-main-link:hover {
    background-color: transparent;
    color: var(--primary-blue);
    text-decoration: none;
    transform: translateX(4px);
}

/* Mega Menu Grid */
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: start;
}

/* Mega Menu Columns */
.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mega-menu-category {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mega-menu-item {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: block;
    position: relative;
}

.mega-menu-item:hover {
    color: var(--primary-blue);
    background-color: transparent;
    text-decoration: none;
    transform: translateX(4px);
    padding-left: 1rem;
}

.mega-menu-item::before {
    content: '→';
    position: absolute;
    left: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--primary-blue);
}

.mega-menu-item:hover::before {
    opacity: 1;
}

/* 移动端强制隐藏mega menu */
@media (max-width: 1400px) {
    .mega-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* 只在桌面端显示mega menu */
@media (min-width: 1401px) {
    /* 强制隐藏移动端products链接 */
    .mobile-dropdown-toggle.d-lg-none {
        display: none !important;
    }
    
    /* 确保桌面端products链接显示 */
    .dropdown-toggle.d-none.d-lg-inline-block {
        display: inline-block !important;
    }
    
    .mega-menu {
        display: block !important; /* 桌面端可显示 */
    }
    
    .mega-menu.show {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }
}

/* 大屏幕桌面端优化 */
@media (min-width: 1200px) {
    .mega-menu {
        min-width: 850px;
        left: -250px;
    }
    
    .mega-menu-grid {
        gap: 2.5rem;
    }
}

/* 小桌面端适配 */
@media (min-width: 1401px) and (max-width: 1599px) {
    .mega-menu {
        min-width: 700px;
        left: -150px;
    }
    
    .mega-menu-grid {
        gap: 1.5rem;
    }
    
    .mega-menu-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* 桌面端特定定位 */
@media (min-width: 1401px) {
    .custom-nav-right .custom-language-dropdown .custom-language-menu {
        right: 0;
        left: auto;
    }
}

/* ===============================
   简化的语言切换Loading样式
   =============================== */

.language-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.language-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.language-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 90vw;
}

.language-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.language-loading-text {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .language-loading-content {
        padding: 1rem 1.5rem;
        gap: 0.75rem;
    }
    
    .language-loading-spinner {
        width: 24px;
        height: 24px;
        border-width: 2px;
    }
    
    .language-loading-text {
        font-size: 0.85rem;
    }
}

/* ===============================
   简单语言切换按钮样式
   =============================== */

.simple-lang-toggle {
    padding: 8px 12px !important;
    font-size: 0.875rem !important;
    border-radius: 6px !important;
    border: 0px solid #dee2e6 !important;
    background: white !important;
    color: #333 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s ease !important;
    width: 70px !important; /* 稍微增加宽度 */
    height: 40px !important; /* 稍微增加高度以匹配社交链接 */
    min-width: 70px !important;
    max-width: 70px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important; /* 右边距 */
}

.simple-lang-toggle:hover,
.simple-lang-toggle:focus,
.simple-lang-toggle:active {
    border-color: transparent !important;
    background: white !important;
    color: #333 !important;
    box-shadow: none !important;
    outline: none !important;
    width: 60px !important;
    height: 36px !important;
}

.simple-lang-toggle .lang-flag {
    font-size: 14px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

.simple-lang-toggle .lang-text {
    font-weight: 500 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

/* ===============================
   移动端导航样式 (根据设计图)
   =============================== */

/* 移动端导航容器样式 */
@media (max-width: 1400px) {
    /* 强制隐藏桌面端products链接 */
    .dropdown-toggle.d-none.d-lg-inline-block {
        display: none !important;
    }
    
    /* 确保移动端products链接显示 */
    .mobile-dropdown-toggle.d-lg-none {
        display: flex !important;
    }
    
    /* 确保导航栏在移动端正确显示 */
    .navbar {
        padding: 0.1rem 0.5rem; /* 减少内边距，让logo更靠左 */
        background-color: var(--white) !important;
    }
    
    /* 移动端navbar容器布局 */
    .navbar .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between; /* logo靠左，toggle button靠右 */
        max-width: none;
    }
    
    /* 重置Bootstrap默认的navbar-collapse样式 */
    .navbar-nav {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .navbar-collapse:not(.show) {
        display: flex !important;
    }
    
    /* 自定义移动端切换按钮 */
    .custom-mobile-toggle {
        background: none !important;
        border: none !important;
        padding: 0.5rem !important;
        position: relative !important; /* 改为相对定位，配合flexbox布局 */
        z-index: 1002 !important;
        display: block !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 0.375rem !important;
        transition: all 0.2s ease !important;
        margin-left: auto; /* 确保toggle button靠右对齐 */
    }
    
    .custom-mobile-toggle:hover {
        background-color: transparent !important;
    }
    
    .custom-mobile-toggle:focus {
        outline: none !important;
        box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2) !important;
    }
    
    .custom-toggler-icon {
        display: block;
        width: 25px;
        height: 20px;
        position: relative;
    }
    
    .custom-toggler-icon span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: var(--text-dark);
        margin-bottom: 4px;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    .custom-toggler-icon span:last-child {
        margin-bottom: 0;
    }
    
    /* 当菜单打开时，汉堡菜单变为X */
    .navbar-toggler[aria-expanded="true"] .custom-toggler-icon span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .navbar-toggler[aria-expanded="true"] .custom-toggler-icon span:nth-child(2) {
        opacity: 0;
    }
    
    .navbar-toggler[aria-expanded="true"] .custom-toggler-icon span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* 移动端菜单容器 - 全屏显示 */
    .navbar-collapse {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 100% !important;
        height: 100vh !important;
        background-color: var(--white) !important;
        z-index: 1000 !important;
        padding: 1rem !important; /* 减少菜单容器内边距，为导航项目腾出更多空间 */
        transition: left 0.3s ease-in-out !important;
        overflow-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        /* 确保滚动功能在所有设备上正常工作 */
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }
    
    /* 横屏模式下的菜单容器优化 */
    @media (max-width: 1400px) and (orientation: landscape) {
        .navbar-collapse {
            padding: 1rem !important; /* 减少内边距以节省空间 */
        }
    }
    
    /* 极小高度横屏优化 */
    @media (max-height: 450px) and (orientation: landscape) {
        .navbar-collapse {
            padding: 0.75rem !important;
        }
    }
    
    .navbar-collapse.show {
        left: 0 !important;
    }
    
    .navbar-collapse.collapsing {
        left: -100% !important;
        transition: left 0.3s ease-in-out !important;
    }
    
    /* 移动端关闭按钮已移除 - 使用汉堡菜单按钮的变换 */
    
    /* 移动端菜单项 */
    .custom-nav-menu {
        margin-top: 3rem !important; /* 进一步减少顶部边距，为更多导航项目腾出空间 */
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        max-height: calc(100vh - 5rem) !important; /* 进一步增加可用高度 */
        overflow-y: auto !important; /* 允许整个菜单滚动 */
        -webkit-overflow-scrolling: touch !important; /* iOS平滑滚动 */
    }
    
    /* 确保所有导航项目字体大小一致 */
    .custom-nav-menu .nav-link,
    .custom-nav-menu .mobile-dropdown-toggle {
        font-size: 1rem !important; /* 进一步减小字体 */
        font-weight: 600 !important;
        color: var(--text-dark) !important;
        padding: 0.5rem 0 !important; /* 进一步减少内边距 */
        border-bottom: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: 0 !important;
        text-align: center !important;
        min-height: 40px !important; /* 大幅减小最小高度，让更多项目同时可见 */
        line-height: 1.1 !important; /* 压缩行高 */
        box-sizing: border-box !important;
    }
    
    /* 横屏模式优化 - 减少导航项目高度 */
    @media (max-width: 1400px) and (orientation: landscape) {
        .custom-nav-menu {
            margin-top: 4rem !important; /* 减少顶部边距 */
            max-height: calc(100vh - 5rem) !important; /* 增加可用高度 */
        }
        
        .custom-nav-menu .nav-link,
        .custom-nav-menu .mobile-dropdown-toggle {
            font-size: 1.1rem !important; /* 稍微减小字体 */
            padding: 0.75rem 0 !important; /* 减少内边距 */
            min-height: 45px !important; /* 减少最小高度 */
        }
        
        .mobile-nav-bottom {
            margin-top: 1rem !important; /* 减少底部区域的顶部边距 */
            padding-top: 1rem !important; /* 减少内边距 */
        }
        
        .mobile-search-input {
            padding: 12px 45px 12px 45px !important; /* 减少搜索框内边距 */
        }
        
        .mobile-quote-btn {
            padding: 0.625rem 1.25rem !important; /* 减少按钮内边距 */
        }
    }
    
    /* 小屏幕横屏进一步优化 */
    @media (max-height: 450px) and (orientation: landscape) {
        .custom-nav-menu {
            margin-top: 3rem !important;
            max-height: calc(100vh - 4rem) !important;
        }
        
        .custom-nav-menu .nav-link,
        .custom-nav-menu .mobile-dropdown-toggle {
            font-size: 1rem !important;
            padding: 0.5rem 0 !important;
            min-height: 40px !important;
        }
        
        .mobile-nav-bottom {
            margin-top: 0.5rem !important;
            padding-top: 0.5rem !important;
        }
        
        .mobile-search-input {
            padding: 10px 40px 10px 40px !important;
            font-size: 0.9rem !important;
        }
        
        .mobile-quote-btn {
            padding: 0.5rem 1rem !important;
            font-size: 0.9rem !important;
        }
        
        .mobile-bottom-row {
            margin-top: 0.5rem !important;
        }
    }
    
    .custom-nav-menu .nav-item {
        border-bottom: 1px solid #f1f5f9;
        margin: 0 !important; /* 移除任何额外的margin */
    }
    
    .custom-nav-menu .nav-item:last-child {
        border-bottom: none;
    }
    
    .custom-nav-menu .nav-link:hover {
        color: var(--primary-blue) !important;
        background-color: transparent;
        padding-left: 1rem;
        border-radius: 0.5rem;
        margin: 0.25rem 0;
    }
    
    .custom-nav-menu .nav-link.active {
        color: var(--primary-blue) !important;
        background-color: transparent !important;
        border-radius: 0.5rem;
        margin: 0.25rem 0;
        padding-left: 1rem;
    }
    
    .custom-nav-menu .nav-link.active::after {
        display: none;
    }
    
    /* 隐藏Bootstrap默认的dropdown箭头，只显示自定义箭头 */
    .mobile-dropdown-toggle::after {
        display: none !important;
    }
    
    .dropdown-toggle::after {
        display: none !important;
    }
    
    /* Products dropdown 特殊布局 */
    .custom-nav-menu .mobile-dropdown-toggle {
        justify-content: center !important; /* 与其他导航项目保持一致 */
        display: flex !important;
        align-items: center !important;
        position: relative !important; /* 为绝对定位的箭头提供参考 */
    }
    

    
    /* Products dropdown 箭头 - 绝对定位到右侧 */
    .dropdown-indicator {
        position: absolute !important;
        right: 1rem !important;
        transition: transform 0.3s ease;
        font-size: 0.875rem;
        color: var(--text-dark);
        margin: 0 !important; /* 移除margin */
    }
    
    .nav-link[aria-expanded="true"] .dropdown-indicator {
        transform: rotate(180deg);
    }
    
    /* 移动端产品下拉菜单 */
    .mobile-products-menu {
        background-color: #f8fafc;
        border: none;
        border-radius: 0;
        box-shadow: none;
        position: static;
        width: 100%;
        margin-top: 0;
        padding: 0.5rem 0;
        display: none; /* 默认隐藏 */
        max-height: 75vh; /* 设置最大高度为视口高度的75% */
        overflow-y: auto; /* 允许垂直滚动 */
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }
    
    /* 横屏模式下的产品菜单优化 */
    @media (max-width: 1400px) and (orientation: landscape) {
        .mobile-products-menu {
            max-height: 60vh; /* 横屏时减少最大高度 */
            padding: 0.25rem 0; /* 减少内边距 */
        }
        
        .mobile-products-menu .dropdown-item {
            padding: 0.4rem 1.5rem; /* 进一步减少垂直内边距 */
            font-size: 0.9rem; /* 稍微减小字体 */
        }
    }
    
    /* 极小高度横屏下的产品菜单优化 */
    @media (max-height: 450px) and (orientation: landscape) {
        .mobile-products-menu {
            max-height: 50vh;
            padding: 0.125rem 0;
        }
        
        .mobile-products-menu .dropdown-item {
            padding: 0.3rem 1.5rem;
            font-size: 0.85rem;
            line-height: 1.2;
        }
    }
    
    /* 移动端下拉菜单显示状态 */
    .mobile-products-menu.show {
        display: block !important;
    }

    /* 移动端产品菜单滚动条样式 */
    .mobile-products-menu::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-products-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-products-menu::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    .mobile-products-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    /* 移动端主导航菜单滚动条样式 */
    .custom-nav-menu::-webkit-scrollbar {
        width: 4px;
    }

    .custom-nav-menu::-webkit-scrollbar-track {
        background: transparent;
    }

    .custom-nav-menu::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    .custom-nav-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }
    
    /* 横屏模式下增强滚动条可见性 */
    @media (max-width: 1400px) and (orientation: landscape) {
        .custom-nav-menu::-webkit-scrollbar {
            width: 6px; /* 横屏时稍微加宽滚动条 */
        }
        
        .custom-nav-menu::-webkit-scrollbar-thumb {
            background: rgba(27, 54, 93, 0.3); /* 使用主题色增强可见性 */
            border-radius: 3px;
        }
        
        .custom-nav-menu::-webkit-scrollbar-thumb:hover {
            background: rgba(27, 54, 93, 0.5);
        }
        
        /* 为导航菜单添加渐变效果，提示可滚动内容 */
        .custom-nav-menu::before {
            content: '';
            position: sticky;
            top: 0;
            left: 0;
            right: 0;
            height: 20px;
            background: linear-gradient(180deg, var(--white) 0%, transparent 100%);
            z-index: 10;
            pointer-events: none;
        }
        
        .custom-nav-menu::after {
            content: '';
            position: sticky;
            bottom: 0;
            left: 0;
            right: 0;
            height: 20px;
            background: linear-gradient(0deg, var(--white) 0%, transparent 100%);
            z-index: 10;
            pointer-events: none;
        }
    }
    
    .mobile-products-menu .dropdown-item {
        color: var(--text-dark);
        padding: 0.6rem 1.5rem; /* 减少垂直内边距以显示更多项目 */
        font-size: 1rem;
        font-weight: 500;
        border-bottom: 1px solid #e2e8f0;
        line-height: 1.3; /* 优化行高 */
    }
    
    .mobile-products-menu .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .mobile-products-menu .dropdown-item:hover {
        background-color: transparent;
        color: var(--primary-blue);
    }
    
    .mobile-products-menu .dropdown-divider {
        margin: 0.5rem 0;
        border-color: #e2e8f0;
    }
    
    /* 移动端底部区域 */
    .mobile-nav-bottom {
        margin-top: 1rem !important; /* 进一步减少顶部间距，为导航项目腾出空间 */
        padding-top: 1rem !important; /* 进一步减少内边距 */
        border-top: 1px solid #e2e8f0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 移动端搜索样式 - 优化版本 */
    .mobile-search-form {
        width: 100%;
    }
    
    .mobile-search-container {
        width: 100%;
        position: relative;
    }
    
    .mobile-search-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        background-color: #f8f9fa;
        border: 2px solid #e9ecef;
        border-radius: 12px;
        padding: 0;
        overflow: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .mobile-search-wrapper:focus-within {
        border-color: var(--primary-blue);
        background-color: white;
        box-shadow: 0 4px 16px rgba(27, 54, 93, 0.15);
        transform: translateY(-1px);
    }
    
    .mobile-search-icon {
        position: absolute;
        left: 16px;
        color: #6c757d;
        font-size: 1rem;
        z-index: 2;
        transition: color 0.3s ease;
    }
    
    .mobile-search-wrapper:focus-within .mobile-search-icon {
        color: var(--primary-blue);
    }
    
    .mobile-search-input {
        flex: 1;
        border: none;
        background: transparent;
        padding: 12px 50px 12px 50px; /* 减少内边距 */
        font-size: 1rem;
        color: var(--text-dark);
        outline: none;
        height: auto;
        line-height: 1.4;
    }
    
    .mobile-search-input::placeholder {
        color: #9ca3af;
        font-weight: 400;
    }
    
    .mobile-search-submit {
        position: absolute;
        right: 4px;
        top: 4px;
        bottom: 4px;
        width: 44px;
        background: var(--primary-blue);
        border: none;
        border-radius: 8px;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        cursor: pointer;
        z-index: 2;
    }
    
    .mobile-search-submit:hover {
        background-color: var(--primary-dark);
        transform: scale(1.05);
    }
    
    .mobile-search-submit:active {
        transform: scale(0.95);
    }
    
    .mobile-search-submit i {
        font-size: 1rem;
        transition: transform 0.2s ease;
    }
    
    .mobile-search-submit:hover i {
        transform: translateX(2px);
    }
    
    /* 当搜索框为空时的状态 */
    .mobile-search-input:placeholder-shown + .mobile-search-submit {
        background-color: #dee2e6;
        cursor: not-allowed;
    }
    
    .mobile-search-input:placeholder-shown + .mobile-search-submit:hover {
        background-color: #dee2e6;
        transform: none;
    }
    
    /* 添加搜索框动画 */
    @keyframes searchPulse {
        0% { box-shadow: 0 4px 16px rgba(27, 54, 93, 0.15); }
        50% { box-shadow: 0 4px 20px rgba(27, 54, 93, 0.25); }
        100% { box-shadow: 0 4px 16px rgba(27, 54, 93, 0.15); }
    }
    
         .mobile-search-wrapper:focus-within {
         animation: searchPulse 2s ease-in-out infinite;
     }
     
     /* 超小屏幕优化 */
     @media (max-width: 576px) {
         .mobile-search-wrapper {
             border-radius: 10px;
         }
         
         .mobile-search-input {
             padding: 14px 45px 14px 45px;
             font-size: 16px; /* 防止iOS缩放 */
         }
         
         .mobile-search-icon {
             left: 14px;
             font-size: 0.9rem;
         }
         
         .mobile-search-submit {
             width: 40px;
             right: 3px;
             top: 3px;
             bottom: 3px;
             border-radius: 7px;
         }
         
         .mobile-search-submit i {
             font-size: 0.9rem;
         }
     }
     
     /* 触摸设备优化 */
     @media (hover: none) and (pointer: coarse) {
         .mobile-search-wrapper {
             min-height: 50px; /* 确保足够的触摸区域 */
         }
         
         .mobile-search-submit {
             min-width: 44px; /* 苹果推荐的最小触摸目标 */
             min-height: 44px;
         }
         
         /* 移除hover效果，避免在触摸设备上的粘性 */
         .mobile-search-submit:hover {
             transform: none;
             background-color: var(--primary-blue);
         }
         
         .mobile-search-submit:hover i {
             transform: none;
         }
         
         /* 添加点击反馈 */
         .mobile-search-submit:active {
             background-color: var(--primary-dark);
             transform: scale(0.95);
         }
     }
    
    .mobile-quote-btn {
        background-color: var(--primary-blue) !important;
        border-color: transparent !important;
        color: var(--white) !important;
        font-weight: 600 !important;
        font-size: 1rem !important;
        padding: 0.625rem 1.25rem !important; /* 减少内边距 */
        border-radius: 0.5rem !important;
        transition: all 0.3s ease !important;
        width: 60% !important;
        text-align: center !important;
        display: block !important; 
        margin: 0 auto !important; 
    }
    
    
    .mobile-quote-btn:hover {
        background-color: var(--primary-dark);
        border-color: transparent;
        color: var(--white);
        transform: translateY(-1px);
        box-shadow: none;
    }
    
    /* 移动端底部行 */
    .mobile-bottom-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-top: 0.75rem !important; /* 减少顶部间距 */
        gap: 1rem !important; /* 添加元素之间的间距 */
        padding: 0 0.5rem !important; /* 添加左右内边距 */
    }
    
    /* 移动端语言选择器 */
    .custom-language-selector.mobile-language {
        background-color: transparent;
        border: 0px solid #e2e8f0;
        color: var(--text-dark);
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        font-weight: 500;
        border-radius: 0.375rem;
        position: relative;
    }
    
    .custom-language-selector.mobile-language:hover {
        border-color: transparent;
        color: var(--primary-blue);
        background-color: transparent;
    }
    
    /* 确保移动端语言选择器也没有Bootstrap默认箭头 */
    .custom-language-selector.mobile-language::after {
        display: none !important;
    }
    
    /* 移动端语言菜单 */
    .custom-language-menu.mobile-menu {
        position: absolute;
        bottom: 100%;
        left: 0;
        margin-bottom: 0.5rem;
        min-width: 200px;
    }
    
    /* 移动端社交链接容器 */
    .mobile-bottom-row .d-flex {
        gap: 1.5rem !important; /* WhatsApp和Facebook之间的间距 */
    }
    
    /* 移动端社交链接 */
    .mobile-social-link {
        color: var(--text-dark) !important;
        font-weight: 500 !important;
        font-size: 0.875rem !important;
        transition: color 0.2s ease !important;
        padding: 0.5rem 0.75rem !important; /* 增加点击区域 */
        text-decoration: none !important;
        border-radius: 0.375rem !important; /* 添加圆角 */
        min-width: 80px !important; /* 最小宽度确保对齐 */
        text-align: center !important;
        background-color: white !important; /* 白色背景 */
    }
    
    .mobile-social-link:hover {
        color: var(--primary-blue);
        background-color: white !important;
        text-decoration: none !important;
    }
    
    /* 隐藏桌面端元素 */
    .custom-nav-right {
        display: none !important;
    }
    
    /* 确保mega menu在移动端隐藏 */
    .mega-menu {
        display: none !important;
    }
    

}

/* 所有导航项目的span元素 */
.custom-nav-menu .nav-link span[data-i18n],
.custom-nav-menu .mobile-dropdown-toggle span[data-i18n] {
    flex: none !important; /* 不再占用全部空间 */
    text-align: center !important;
    font-size: inherit !important; /* 继承父元素字体大小 */
    font-weight: inherit !important;
    line-height: inherit !important; /* 继承行高 */
    margin: 0 !important; /* 移除所有margin */
    padding: 0 !important; /* 移除所有padding */
    display: inline !important; /* 确保为inline显示 */
}

/* WhatsApp Contact Button Styles */
.custom-contact-btn {
    background: linear-gradient(135deg, var(--primary-blue), #2563eb);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(27, 54, 93, 0.2);
}

.custom-contact-btn:hover {
    background: linear-gradient(135deg, #1a3354, var(--primary-blue));
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 54, 93, 0.3);
    text-decoration: none;
}

/* WhatsApp Button Specific Styles - 使用主题颜色 */
.whatsapp-btn {
    background: var(--primary-blue) !important;
}

.whatsapp-btn:hover {
    background: var(--primary-dark) !important;
    color: white;
}

/* 移动端WhatsApp按钮适配 */
@media (max-width: 1400px) {
    .whatsapp-btn {
        padding: 0.5rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .whatsapp-btn i {
        font-size: 1em;
    }
    
    /* 移动端专用WhatsApp按钮 */
    .mobile-whatsapp-btn {
        background-color: var(--primary-blue) !important;
        border-color: var(--primary-blue) !important;
        text-decoration: none;
    }
    
    .mobile-whatsapp-btn:hover {
        background-color: var(--primary-dark) !important;
        border-color: var(--primary-dark) !important;
        color: white !important;
        text-decoration: none;
    }
}
