/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0;
}

/* 头部样式 */
header {
    background-color: #0066cc;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 5px 10px;
    border: none;
    border-radius: 3px 0 0 3px;
    outline: none;
}

.search-box button {
    padding: 5px 10px;
    background-color: #0052a3;
    color: #fff;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
}

/* 导航栏样式 */
.nav-bar {
    background-color: #0052a3;
    padding: 5px 0;
}

.nav-bar nav ul {
    display: flex;
    list-style: none;
    padding: 0 20px;
}

.nav-bar nav ul li {
    margin-right: 20px;
}

.nav-bar nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.nav-bar nav ul li a:hover {
    color: #ffd700;
}



/* 推荐产品轮播图样式 */
.featured-products {
    padding: 40px 0;
    background-color: #fff;
}

.featured-products h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
    font-weight: bold;
}

.carousel {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 400px;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-item.active {
    opacity: 1;
    position: relative;
}

.carousel-content {
    display: flex;
    height: 100%;
}

.carousel-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
}

.carousel-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carousel-text {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #fff;
}

.carousel-text h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
}

.carousel-text p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

.product-specs {
    margin-top: 15px;
}

.spec-row {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
}

.spec-label {
    font-weight: bold;
    color: #333;
    min-width: 80px;
    margin-right: 10px;
}

.spec-value {
    color: #666;
    flex: 1;
}

.carousel-btn {
    align-self: flex-start;
    padding: 10px 20px;
    background-color: #0066cc;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: #0052a3;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-indicators button.active {
    background-color: #fff;
}

/* 水平滚动推荐产品轮播图样式 */
.featured-products-horizontal {
    padding: 40px 0;
    background-color: #f5f5f5;
}

.featured-products-horizontal h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

.carousel-horizontal {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 auto;
    max-width: 600px;
}

.carousel-inner-horizontal {
    display: flex;
    width: max-content;
    will-change: transform;
}

.carousel-item-horizontal {
    width: 300px;
    flex-shrink: 0;
    padding: 0 15px;
    box-sizing: border-box;
}

.carousel-product-horizontal {
    background-color: #fff;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: none;
    text-align: center;
    transition: transform 0.3s ease;
}

.carousel-product-horizontal:hover {
    transform: translateY(-5px);
}

.carousel-product-horizontal .product-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
}

.carousel-product-horizontal .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.carousel-product-horizontal:hover .product-image img {
    transform: scale(1.05);
}

.carousel-product-horizontal h3 {
    font-size: 1rem;
    margin-bottom: 0;
    color: #333;
    font-weight: normal;
    line-height: 1.4;
    text-align: center;
    padding: 0 10px;
}

.carousel-control-horizontal {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-control-horizontal:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-control-horizontal.prev {
    left: 10px;
}

.carousel-control-horizontal.next {
    right: 10px;
}

/* 产品展示区域样式 */
.products {
    padding: 40px 0;
    background-color: #f5f5f5;
}

.products h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

.products-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* 产品分类标签 */
.product-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.product-tabs button {
    padding: 8px 16px;
    margin: 0 5px;
    border: none;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.product-tabs button.active {
    background-color: #ff3300;
    color: #fff;
}

.product-tabs button:hover {
    background-color: #e0e0e0;
}

.product-tabs button.active:hover {
    background-color: #ff3300;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
}

/* 产品卡片 */
.product-item {
    background-color: #fff;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: none;
    position: relative;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-item.selected {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 2px solid #000;
}

/* 产品图片 */
.product-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 价格标签 */
.price {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 8px 15px;
    font-size: 1rem;
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 产品标题 */
.product-item h3 {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: #333;
    font-weight: normal;
    line-height: 1.4;
    text-align: center;
}

/* 产品按钮 */
.product-btn {
    width: 100%;
    padding: 6px 0;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border-radius: 3px;
}

.product-btn:hover {
    background-color: #f5f5f5;
    border-color: #0066cc;
    color: #0066cc;
}

/* 关于我们区域样式 */
.about {
    padding: 60px 0;
    background-color: #fff;
}

.about h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
    font-weight: bold;
}

.about p {
    max-width: 800px;
    margin: 0 auto 20px;
    color: #666;
    text-align: center;
    line-height: 1.8;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

footer p {
    font-size: 0.9rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: #333;
}

.modal-content {
    position: relative;
    background-color: transparent;
    margin: 5% auto;
    padding: 0;
    border: none;
    width: 80%;
    max-width: 800px;
    text-align: center;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: #ccc;
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.modal-body img {
    max-width: 80%;
    max-height: 600px;
    object-fit: contain;
    margin-bottom: 30px;
}

.modal-price {
    position: relative;
    background-color: transparent;
    padding: 10px 20px;
    font-size: 1.5rem;
    color: #fff;
    font-weight: bold;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 推荐产品轮播图 - 垂直轮播图 */
    .featured-products {
        padding: 30px 0;
    }

    .featured-products h2,
    .featured-products-horizontal h2 {
        font-size: 1.5rem;
    }

    .carousel {
        max-width: 100%;
        position: relative;
    }

    .carousel-content {
        flex-direction: column;
        padding: 20px;
    }

    .carousel-image,
    .carousel-text {
        flex: none;
        width: 100%;
    }

    .carousel-image {
        height: 250px;
    }

    .carousel-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .carousel-text {
        padding: 20px;
    }

    .carousel-text h3 {
        font-size: 1.3rem;
    }

    .carousel-text p {
        font-size: 0.95rem;
    }

    .carousel-inner {
        height: auto;
        min-height: 500px;
    }

    .carousel-control {
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .carousel-control.prev {
        left: 10px;
    }

    .carousel-control.next {
        right: 10px;
    }

    .carousel-indicators {
        bottom: 10px;
    }

    /* 水平轮播图 */
    .carousel-horizontal {
        max-width: 100%;
    }

    .carousel-inner-horizontal {
        width: 100%;
    }

    .carousel-item-horizontal {
        width: 280px;
        min-width: 280px;
        padding: 0 10px;
    }

    .carousel-product-horizontal {
        padding: 15px;
    }

    .carousel-product-horizontal .product-image {
        height: 180px;
    }

    .carousel-product-horizontal h3 {
        font-size: 0.9rem;
    }

    /* 产品展示区域 */
    .products h2 {
        font-size: 1.5rem;
    }

    .product-tabs {
        flex-wrap: wrap;
    }

    .product-tabs button {
        margin: 5px;
        font-size: 0.8rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
        padding: 0 10px;
    }

    .product-item {
        padding: 15px;
    }

    .product-image {
        height: 180px;
    }

    .product-item h3 {
        font-size: 0.9rem;
    }

    .price {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    /* 轮播控制按钮 */
    .carousel-control,
    .carousel-control-horizontal {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .carousel-control.prev {
        left: 10px;
    }

    .carousel-control.next {
        right: 10px;
    }

    .carousel-control-horizontal.prev {
        left: 5px;
    }

    .carousel-control-horizontal.next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    /* 全局样式 */
    .container {
        padding: 10px;
    }

    /* 推荐产品轮播图 - 垂直轮播图 */
    .featured-products {
        padding: 20px 0;
    }

    .featured-products h2,
    .featured-products-horizontal h2 {
        font-size: 1.3rem;
    }

    .products-subtitle {
        font-size: 0.8rem;
    }

    .carousel {
        position: relative;
    }

    .carousel-content {
        flex-direction: column;
        padding: 15px;
    }

    .carousel-image {
        height: 200px;
    }

    .carousel-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .carousel-text {
        padding: 15px;
    }

    .carousel-text h3 {
        font-size: 1.1rem;
    }

    .carousel-text p,
    .carousel-text .product-specs {
        font-size: 0.85rem;
    }

    .carousel-inner {
        min-height: 450px;
    }

    .carousel-control {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .carousel-indicators {
        bottom: 5px;
    }

    .carousel-indicators button {
        width: 8px;
        height: 8px;
    }

    /* 水平轮播图 */
    .carousel-horizontal {
        max-width: 100%;
    }

    .carousel-item-horizontal {
        width: 260px;
        min-width: 260px;
    }

    .carousel-product-horizontal {
        padding: 12px;
    }

    .carousel-product-horizontal .product-image {
        height: 160px;
    }

    .carousel-product-horizontal h3 {
        font-size: 0.85rem;
    }

    /* 产品展示区域 */
    .products {
        padding: 30px 0;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-item {
        padding: 12px;
    }

    .product-image {
        height: 160px;
    }

    .product-item h3 {
        font-size: 0.85rem;
    }

    .price {
        font-size: 0.85rem;
        padding: 5px 10px;
        bottom: 10px;
        right: 10px;
    }

    /* 轮播控制按钮 */
    .carousel-control,
    .carousel-control-horizontal {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    /* 轮播指示器 */
    .carousel-indicators button {
        width: 8px;
        height: 8px;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .carousel {
        max-width: 90%;
    }

    .carousel-horizontal {
        max-width: 95%;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}