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

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

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

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

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

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

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

.search-form .input-group {
    width: 100%;
}

/* 主导航 */
.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: #666;
    margin-bottom: 8px;
    display: block;
}

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

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

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

.product-item .product-title {
    font-size: 16px;
    margin-bottom: 10px;
    height: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.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; }

/* 响应式布局 */
@media (max-width: 991px) {
    .main-navigation ul.nav {
        flex-direction: column;
    }
    
    .main-navigation ul.nav > li {
        width: 100%;
    }
    
    .main-navigation ul.nav > li > a {
        padding: 10px 15px;
    }
    
    .dropdown-menu {
        position: static;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    
    .dropdown-submenu > .dropdown-menu {
        position: static;
        margin-left: 10px;
    }
    
    .user-actions {
        justify-content: center;
        margin-top: 15px;
    }
}

@media (max-width: 767px) {
    .page-title {
        font-size: 24px;
    }
    
    .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;
}