/* ========================================
   工厂/批发商风格 - 列表式布局
   设计理念：窄屏、小图、信息密集、表格化
   图片不占主导，突出产品信息
   ======================================== */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, "Microsoft YaHei", "SimHei", sans-serif;
    line-height: 1.5;
    color: #333;
    background: #e8e8e8;
    font-size: 13px;
}

.container {
    max-width: 1100px;  /* 窄屏设计 */
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== 头部样式 ==================== */
.header {
    background: #003366;
    color: #fff;
    border-bottom: 3px solid #0066cc;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h1 {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logo a {
    text-decoration: none;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 搜索框 */
.search-box {
    background: #fff;
    border-radius: 2px;
    padding: 2px;
}

.search-box form {
    display: flex;
}

.search-box input {
    border: none;
    padding: 5px 10px;
    width: 250px;
    font-size: 12px;
}

.search-box button {
    background: #ff6600;
    color: #fff;
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.search-box button:hover {
    background: #ff5500;
}

/* 询盘车按钮 */
.cart-btn {
    background: #ff6600;
    color: #fff;
    padding: 6px 14px;
    text-decoration: none;
    border-radius: 2px;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.cart-btn:hover {
    background: #ff5500;
}

.cart-count {
    background: #fff;
    color: #ff6600;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* 主导航 */
.main-nav {
    background: #0066cc;
}

.main-nav ul {
    list-style: none;
    display: flex;
    padding: 0;
    margin: 0;
}

.main-nav li {
    border-right: 1px solid rgba(255,255,255,0.2);
}

.main-nav a {
    display: block;
    padding: 10px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.main-nav a:hover,
.main-nav a.active {
    background: #0055aa;
}

/* ==================== 主要内容区 ==================== */
.main-content {
    margin: 12px 0;
}

/* 欢迎区域 */
.welcome-section {
    background: #fff;
    padding: 12px 15px;
    border: 1px solid #d0d0d0;
    margin-bottom: 12px;
}

.welcome-section h2 {
    color: #003366;
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: bold;
}

.welcome-section p {
    color: #666;
    font-size: 12px;
    line-height: 1.6;
}

/* 页面标题 */
.page-header {
    background: #f5f5f5;
    padding: 10px 15px;
    border: 1px solid #d0d0d0;
    border-bottom: 2px solid #0066cc;
}

.page-header h1 {
    color: #003366;
    font-size: 16px;
    font-weight: bold;
}

/* 面包屑导航 */
.breadcrumb {
    background: #f9f9f9;
    padding: 8px 15px;
    border: 1px solid #d0d0d0;
    border-top: none;
    font-size: 11px;
    color: #666;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 产品统计信息 */
.product-count {
    background: #fffef0;
    border: 1px solid #e0e0a0;
    padding: 6px 15px;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

/* ==================== 产品列表式布局 ==================== */
.products-grid {
    background: #fff;
    border: 1px solid #d0d0d0;
    margin-bottom: 15px;
}

/* 产品卡片 - 横向列表式 */
.product-card {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    padding: 10px;
    transition: background 0.2s;
    align-items: center;
}

.product-card:last-child {
    border-bottom: none;
}

.product-card:hover {
    background: #f9f9f9;
}

/* 产品图片 - 小图 */
.product-image {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    margin-right: 15px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 产品信息区 - 占主要位置 */
.product-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 产品名称和型号 */
.product-info h3 {
    flex: 0 0 280px;
    font-size: 13px;
    margin: 0;
    line-height: 1.4;
}

.product-info h3 a {
    color: #333;
    text-decoration: none;
}

.product-info h3 a:hover {
    color: #0066cc;
}

/* 产品型号 */
.product-model {
    flex: 0 0 120px;
    font-size: 12px;
    color: #666;
    font-family: "Courier New", monospace;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 2px;
}

/* 产品价格 */
.product-price {
    flex: 0 0 100px;
    color: #ff6600;
    font-size: 16px;
    font-weight: bold;
    text-align: right;
}

/* 产品操作按钮 */
.product-actions {
    flex: 0 0 200px;
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.product-actions .btn {
    padding: 5px 10px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-block;
    padding: 6px 12px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #0066cc;
    color: #fff;
}

.btn-primary:hover {
    background: #0055aa;
}

.btn-secondary {
    background: #ff6600;
    color: #fff;
}

.btn-secondary:hover {
    background: #ff5500;
}

.btn-large {
    padding: 10px 20px;
    font-size: 14px;
}

/* ==================== 产品详情页（表格式布局）==================== */
.product-detail {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 15px;
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 280px 1fr;  /* 图片在左，信息在右 */
    gap: 15px;
}

/* 产品信息表格（左侧主要内容）*/
.product-info-table {
    width: 100%;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d0d0d0;
}

.detail-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.detail-table tr:last-child {
    border-bottom: none;
}

/* 产品标题行 */
.product-title-row {
    background: #f5f5f5;
    padding: 12px 15px;
    border-bottom: 2px solid #0066cc;
}

.product-title-row h1 {
    margin: 0;
    font-size: 18px;
    color: #003366;
    font-weight: bold;
}

/* 表格标签和值 */
.table-label {
    width: 150px;
    padding: 10px 15px;
    background: #f9f9f9;
    color: #666;
    font-weight: 500;
    font-size: 12px;
    vertical-align: top;
}

.table-value {
    padding: 10px 15px;
    color: #333;
    font-size: 13px;
}

.table-value a {
    color: #0066cc;
    text-decoration: none;
}

.table-value a:hover {
    text-decoration: underline;
}

/* 型号用等宽字体 */
.model-number {
    font-family: "Courier New", monospace;
    font-size: 14px;
    background: #f5f5f5;
    padding: 4px 8px;
    display: inline-block;
    border-radius: 2px;
}

/* 价格行突出 */
.price-row {
    background: #fffef0;
}

.price-value {
    color: #ff6600;
    font-size: 20px;
    font-weight: bold;
}

/* 操作按钮行 */
.action-row {
    padding: 15px;
    background: #f5f5f5;
    text-align: center;
}

.action-row .btn {
    margin: 0 5px;
}

/* 产品图片区（右侧小图）*/
.product-images-side {
    width: 280px;
}

.main-image-small {
    width: 100%;
    height: 280px;
    border: 1px solid #d0d0d0;
    background: #f9f9f9;
    margin-bottom: 10px;
    overflow: hidden;
}

.main-image-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.no-image-placeholder {
    width: 100%;
    height: 280px;
    border: 1px solid #d0d0d0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
}

/* 缩略图网格 */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.thumbnail-grid img {
    width: 100%;
    height: 65px;
    object-fit: cover;
    border: 1px solid #d0d0d0;
    cursor: pointer;
}

.thumbnail-grid img:hover {
    border-color: #0066cc;
}

/* 产品描述 */
.product-description {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 15px;
    margin-bottom: 15px;
}

.product-description h2 {
    color: #003366;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0066cc;
    font-weight: bold;
}

.product-description p {
    line-height: 1.7;
    margin-bottom: 10px;
    font-size: 13px;
}

/* 产品画廊 */
.product-gallery {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 15px;
    margin-bottom: 15px;
}

.product-gallery h3 {
    color: #003366;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0066cc;
    font-weight: bold;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.gallery-grid a {
    display: block;
    border: 1px solid #d0d0d0;
}

.gallery-grid a:hover {
    border-color: #0066cc;
}

.gallery-grid img {
    width: 100%;
    display: block;
}

/* 相关产品 - 列表式 */
.related-products {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 15px;
    margin-bottom: 15px;
}

.related-products h2 {
    color: #003366;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0066cc;
    font-weight: bold;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 15px 0;
}

.pagination .page-link {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d0d0d0;
    color: #0066cc;
    text-decoration: none;
    font-size: 12px;
}

.pagination .page-link:hover {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.pagination .page-link.active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
    font-weight: bold;
}

/* ==================== 询盘车页面 ==================== */
.inquiry-cart {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 20px;
    margin-bottom: 15px;
}

.inquiry-cart h1 {
    color: #003366;
    font-size: 18px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0066cc;
    font-weight: bold;
}

.inquiry-cart h2 {
    color: #003366;
    font-size: 15px;
    margin: 20px 0 12px 0;
    font-weight: bold;
}

/* 询盘产品表格 */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table th {
    background: #f5f5f5;
    padding: 8px;
    text-align: left;
    border: 1px solid #d0d0d0;
    font-weight: bold;
    color: #003366;
    font-size: 12px;
}

.cart-table td {
    padding: 8px;
    border: 1px solid #d0d0d0;
    font-size: 12px;
    vertical-align: middle;
}

.cart-table tr:hover {
    background: #f9f9f9;
}

/* 询盘车产品显示 */
.cart-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-product img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    background: #f9f9f9;
    flex-shrink: 0;
}

.cart-product h4 {
    font-size: 13px;
    color: #003366;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.cart-product .price {
    font-size: 14px;
    font-weight: bold;
    color: #ff6600;
    margin: 0;
}

.remove-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 2px;
    font-size: 11px;
}

.remove-btn:hover {
    background: #c82333;
}

/* 询盘表单 */
.inquiry-form {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #d0d0d0;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-weight: 500;
    font-size: 12px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    font-size: 12px;
    font-family: Arial, sans-serif;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0066cc;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.empty-cart {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-cart p {
    font-size: 14px;
    margin-bottom: 15px;
}

/* ==================== 联系我们页面 ==================== */
.contact-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-info,
.contact-form {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 15px;
}

.contact-info h2,
.contact-form h2 {
    color: #003366;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0066cc;
    font-weight: bold;
}

.info-item {
    margin-bottom: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-left: 3px solid #0066cc;
}

.info-item strong {
    display: block;
    color: #003366;
    margin-bottom: 4px;
    font-size: 12px;
}

.info-item p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

/* ==================== 底部 ==================== */
.footer {
    background: #003366;
    color: #fff;
    border-top: 3px solid #0066cc;
    padding: 20px 0 12px 0;
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 15px;
}

.footer-section h3 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-weight: bold;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 6px;
    font-size: 12px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    font-size: 11px;
}

/* ==================== 提示消息 ==================== */
.alert {
    padding: 10px 15px;
    margin-bottom: 12px;
    border-radius: 2px;
    border-left: 3px solid;
    font-size: 12px;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* 空状态 */
.empty-message {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border: 1px solid #d0d0d0;
    color: #999;
}

.empty-message p {
    font-size: 14px;
    margin-bottom: 15px;
}

/* ==================== 搜索页面 ==================== */
.search-header {
    background: #fff;
    border: 1px solid #d0d0d0;
    padding: 12px 15px;
    margin-bottom: 12px;
}

.search-header h1 {
    color: #003366;
    font-size: 16px;
    margin-bottom: 6px;
    font-weight: bold;
}

.search-header p {
    color: #666;
    font-size: 12px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .container {
        max-width: 100%;
    }
    
    .product-info {
        flex-wrap: wrap;
    }
    
    .product-info h3 {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }
    
    /* 产品详情页改为上下布局 */
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-images-side {
        width: 100%;
        /* 移动端图片已经在HTML上方，无需调整order */
    }
    
    .main-image-small {
        height: 250px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .contact-page {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* 手机端产品列表改为2列网格卡片 */
    .products-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        background: transparent;
        border: none;
    }
    
    .product-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: #fff;
        border: 1px solid #d0d0d0;
        padding: 8px;
        margin: 0;
        width: auto;
    }
    
    /* 产品图片 - 上方，正方形 */
    .product-image {
        position: relative;
        width: 100% !important;
        height: 0 !important;
        padding-top: 100% !important;  /* 1:1 正方形 */
        margin-right: 0 !important;
        margin-bottom: 8px;
        background: #f5f5f5;
        border: 1px solid #e0e0e0;
        overflow: hidden;
    }
    
    .product-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 产品信息区 - 下方 */
    .product-info {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        align-items: flex-start !important;
        flex: none !important;
    }
    
    .product-info h3 {
        font-size: 12px !important;
        height: auto !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        flex: none !important;
        width: 100% !important;
    }
    
    .product-model {
        flex: none !important;
        width: auto !important;
        font-size: 10px !important;
        padding: 2px 5px !important;
        margin: 0 !important;
    }
    
    .product-price {
        flex: none !important;
        width: 100% !important;
        text-align: left !important;
        font-size: 14px !important;
        margin: 0 !important;
    }
    
    .product-actions {
        flex: none !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        margin: 0 !important;
    }
    
    .product-actions .btn {
        width: 100% !important;
        padding: 6px 5px !important;
        font-size: 10px !important;
        margin: 0 !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
    }
    
    .search-box input {
        width: 180px;
    }
    
    /* 询盘车页面移动端优化 - 紧凑横向布局 */
    .cart-table thead {
        display: none;
    }
    
    .cart-table tbody tr {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
        border: 1px solid #d0d0d0;
        background: #fff;
        padding: 8px;
        gap: 8px;
    }
    
    .cart-table tbody td {
        border: none;
        padding: 0;
    }
    
    /* 第一列：产品信息（图片+文字） */
    .cart-table tbody td:nth-child(1) {
        flex: 1;
        min-width: 0;
    }
    
    /* 第二列：型号 */
    .cart-table tbody td:nth-child(2) {
        display: none !important; /* 移动端隐藏型号列 */
    }
    
    /* 第三列：操作按钮 */
    .cart-table tbody td:nth-child(3) {
        flex-shrink: 0;
    }
    
    .cart-product {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .cart-product img {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
        object-fit: contain;
        border: 1px solid #e0e0e0;
        background: #f9f9f9;
    }
    
    .cart-product div {
        flex: 1;
        min-width: 0;
    }
    
    .cart-product h4 {
        font-size: 13px;
        margin: 0 0 3px 0;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .cart-product .price {
        font-size: 14px;
        font-weight: bold;
        color: #ff6600;
        margin: 0;
    }
    
    .cart-table tbody td:nth-child(3) .btn {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .header-top {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box input {
        width: 100%;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .header,
    .footer,
    .product-actions,
    .btn {
        display: none;
    }
    
    body {
        background: #fff;
    }
    
    .product-card {
        border: 1px solid #000;
    }
}
