/* 汽车配件B2B外贸系统 - 前台样式 */

/* 基础响应式配置 */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* 通用样式 */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 容器响应式设置 */
.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

/* 大屏幕容器 */
@media (min-width: 1400px) {
    .container {
        max-width: 1800px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* 顶部通知栏 */
.top-notification-bar {
    background-color: #007bff;
}

/* 网站头部 */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 0;
}

/* 大屏幕头部样式 */
@media (min-width: 1200px) {
    .site-header {
        padding: 25px 0;
    }
}

@media (min-width: 1400px) {
    .site-header {
        padding: 30px 0;
    }
}

/* 语言选择器 */
.language-selector select {
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #fff;
}

/* Logo */
.logo img {
    max-height: 80px;
}

/* 大屏幕Logo尺寸 */
@media (min-width: 1200px) {
    .logo img {
        max-height: 90px;
    }
}

@media (min-width: 1400px) {
    .logo img {
        max-height: 100px;
    }
}

@media (min-width: 1600px) {
    .logo img {
        max-height: 110px;
    }
}

@media (min-width: 1920px) {
    .logo img {
        max-height: 120px;
    }
}

/* 搜索框 */
.search-container {
    position: relative;
    width: 100%;
}

.search-form {
    width: 100%;
    display: flex;
    justify-content: center;
}

.search-form .input-group {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: stretch;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-form .form-control {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.search-form .form-control:focus {
    border-color: #007bff;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(0, 123, 255, 0.2);
}

.search-form .form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

.search-form button {
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 0 4px 4px 0;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button:hover {
    background-color: #0056b3;
}

.search-form button:active {
    transform: scale(0.98);
}

/* 主导航 */
.main-navigation {
    background-color: #fff;
    border-top: 1px solid #e5e5e5;
    margin-top: 15px;
}

.main-navigation ul.nav {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.main-navigation ul.nav > li {
    position: relative;
}

.main-navigation ul.nav > li > a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.main-navigation ul.nav > li > a:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

/* 下拉菜单样式 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #333;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 20px;
    clear: both;
    font-weight: 400;
    color: #333;
    text-align: inherit;
    white-space: nowrap;
    background: none;
    border: 0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu .dropdown-item:hover {
    color: #007bff;
    background-color: #f8f9fa;
}

/* 多级下拉菜单样式 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
}

/* 当hover时显示下拉菜单 */
.nav-item.dropdown:hover > .dropdown-menu,
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* 用户操作 */
.user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.user-actions a,
.user-actions button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cart-icon,
.wishlist-icon {
    font-size: 20px;
    color: #333;
    transition: color 0.3s ease;
}

.cart-icon:hover,
.wishlist-icon:hover {
    color: #007bff;
}

.cart-icon .badge {
    position: relative;
    top: -10px;
    right: -5px;
    font-size: 10px;
    padding: 2px 5px;
}

/* 页面标题 */
.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

/* 面包屑导航 */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* 产品卡片 */
.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card .product-image {
    height: 240px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 首页产品卡片样式 */
.product-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.product-item:hover {
     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
     transform: translateY(-5px);
 }
 
 .product-item .product-image {
    height: 200px !important;
    background-color: #f8f8f8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
}

 .product-item .product-image img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    transition: transform 0.3s ease !important;
}

/* 确保所有产品图片容器都有正确的高度设置和居中显示 */
 
  .product-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.product-image {
    position: relative;
    overflow: hidden;
}

.product-image img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    transition: transform 0.3s ease !important;
}

.product-image:hover img {
    transform: scale(1.05) !important;
    transition: transform 0.3s ease !important;
    transform-origin: center center !important;
}

/* 产品详情页图片 */

/* 确保所有产品图片容器都有正确的高度设置和居中显示 */
.product-images .main-image {
    position: relative;
    overflow: hidden;
    padding-top: 75%; /* 4:3 宽高比 */
    height: 0;
    margin-bottom: 15px;
}

.product-images .main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f5f5f5;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: #007bff;
}

.product-sku {
    font-size: 12px;
    color: #000000;
    margin-bottom: 8px;
    display: block;
}

.product-category {
    font-size: 13px;
    color: #000000;
    margin-bottom: 8px;
    display: block;
}

.product-keywords {
    font-size: 12px;
    color: #000000;
    margin-top: 8px;
    display: block;
}

/* 产品信息样式优化 */
.product-item .product-info {
    padding: 15px;
}

.product-item .product-title {
    font-size: 16px;
    margin-bottom: 10px;
    height: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.product-item .product-title a {
    color: #1527aeff;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.product-item .product-sku, 
.product-item .product-category, 
.product-item .product-keywords {
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-item .small {
    font-size: 12px;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #007bff;
}

.product-price .line-through {
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

/* 团购进度条 */
.group-buy-progress .progress-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #28a745;
    transition: width 0.3s ease;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #004085;
}

.btn-outline-primary {
    color: #007bff;
    background-color: transparent;
    background-image: none;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

/* 表格样式 */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
}

.table tbody + tbody {
    border-top: 2px solid #dee2e6;
}

/* 表单样式 */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 50%; }

.border { border: 1px solid #dee2e6; }
.border-0 { border: 0; }
.border-top { border-top: 1px solid #dee2e6; }
.border-right { border-right: 1px solid #dee2e6; }
.border-bottom { border-bottom: 1px solid #dee2e6; }
.border-left { border-left: 1px solid #dee2e6; }

/* 响应式布局 - 针对不同屏幕和缩放级别 */

/* ==================== 大屏幕正向断点 (从大到小) ==================== */

/* 超大屏幕 (1920px+) */
@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }
    
    .container {
        max-width: 2000px;
        padding-left: 3rem;
        padding-right: 3rem;
    }
    
    .site-header {
        padding: 35px 0;
    }
    
    .search-form .input-group {
        max-width: 1000px;
    }
    
    .search-form .form-control {
        padding: 16px 20px;
        font-size: 1.1rem;
    }
    
    .search-form button {
        padding: 16px 24px;
        font-size: 1.1rem;
        min-width: 60px;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 18px 25px;
        font-size: 1.1rem;
    }
}

/* 大屏幕 (1600px+) */
@media (min-width: 1600px) and (max-width: 1919px) {
    html {
        font-size: 17px;
    }
    
    .container {
        max-width: 1700px;
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
    
    .site-header {
        padding: 32px 0;
    }
    
    .search-form .input-group {
        max-width: 900px;
    }
    
    .search-form .form-control {
        padding: 14px 18px;
        font-size: 1.05rem;
    }
    
    .search-form button {
        padding: 14px 22px;
        font-size: 1.05rem;
        min-width: 55px;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 16px 22px;
        font-size: 1.05rem;
    }
}

/* 中等大屏幕 (1400px+) */
@media (min-width: 1400px) and (max-width: 1599px) {
    html {
        font-size: 16.5px;
    }
    
    .container {
        max-width: 1500px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .site-header {
        padding: 30px 0;
    }
    
    .search-form .input-group {
        max-width: 850px;
    }
}

/* 标准大屏幕 (1200px+) */
@media (min-width: 1200px) and (max-width: 1399px) {
    html {
        font-size: 16px;
    }
    
    .container {
        max-width: 1320px;
    }
    
    .site-header {
        padding: 28px 0;
    }
    
    .search-form .input-group {
        max-width: 800px;
    }
}

/* ==================== 小屏幕反向断点 (从大到小) ==================== */

/* 大屏幕 (1200px以下) */
@media (max-width: 1199px) {
    html {
        font-size: 15px;
    }
    
    .container {
        max-width: 1140px;
    }
    
    .site-header {
        padding: 22px 0;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 14px 18px;
    }
    
    .search-form .input-group {
        max-width: 750px;
    }
}

/* 中等屏幕 (992px以下) */
@media (max-width: 991px) {
    html {
        font-size: 14px;
    }
    
    .container {
        max-width: 960px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .site-header {
        padding: 18px 0;
    }
    
    .main-navigation ul.nav {
        flex-direction: column;
    }
    
    .main-navigation ul.nav > li {
        width: 100%;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 12px 14px;
        font-size: 1rem;
    }
    
    .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        padding-left: 1rem;
    }
    
    .dropdown-submenu > .dropdown-menu {
        position: static;
        margin-left: 10px;
        padding-left: 1rem;
    }
    
    .user-actions {
        justify-content: center;
        margin-top: 12px;
    }
    
    .search-form .input-group {
        max-width: 100%;
    }
}

/* 小屏幕 (768px+) */
@media (max-width: 767px) {
    html {
        font-size: 12px;
    }
    
    .container {
        max-width: 720px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .site-header {
        padding: 8px 0;
    }
    
    .top-notification-bar {
        padding: 6px 0;
        font-size: 0.875rem;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .search-form .input-group {
        flex-direction: row;
        gap: 0;
        max-width: 100%;
    }
    
    .search-form .form-control {
        flex: 1;
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .search-form button {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-width: 45px;
    }
    
    /* Logo区域响应式 */
    .logo img {
        max-height: 60px;
    }
}

/* 超小屏幕 (576px+) */
@media (max-width: 575px) {
    html {
        font-size: 11px;
    }
    
    .container {
        max-width: 100%;
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }
    
    .site-header {
        padding: 6px 0;
    }
    
    .top-notification-bar {
        padding: 4px 0;
        font-size: 0.75rem;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    .search-form .input-group {
        flex-direction: row;
        gap: 0;
        max-width: 100%;
    }
    
    .search-form .form-control {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .search-form button {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 40px;
    }
    
    /* Logo区域响应式 */
    .logo img {
        max-height: 50px;
    }
}

/* 极小屏幕 (360px以下) */
@media (max-width: 359px) {
    html {
        font-size: 10px;
    }
    
    .container {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .site-header {
        padding: 4px 0;
    }
    
    .top-notification-bar {
        padding: 3px 0;
        font-size: 0.65rem;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 4px 6px;
        font-size: 0.8rem;
    }
    
    /* Logo区域响应式 */
    .logo img {
        max-height: 22px;
    }
}

/* 针对高DPI屏幕和缩放的优化 */
@media screen and (-webkit-min-device-pixel-ratio: 1.5),
       screen and (min-resolution: 144dpi) {
    html {
        font-size: 17px;
    }
}

/* 针对极低缩放级别 (150%+) */
@media (max-width: 800px) and (min-width: 768px) {
    html {
        font-size: 11px;
    }
}

/* 针对极高缩放级别 (200%+) */
@media (max-width: 600px) and (min-width: 576px) {
    html {
        font-size: 10px;
    }
}

/* 产品卡片响应式 */
.product-card {
    margin-bottom: 20px;
}

/* 代码热门图标样式 */
.category-icon {
    color: #ff6b35;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    width: 100%;
    background: linear-gradient(135deg, #fff7e6 0%, #fff 100%);
    border-radius: 4px;
}

.category-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 160px;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}