/* 全局样式 */
:root {
    --primary-color: #0066cc;
    --secondary-color: #004080;
    --accent-color: #ff9900;
    --text-color: #333333;
    --light-text: #ffffff;
    --light-bg: #f8f9fa;
    --dark-bg: #333333;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --error-color: #dc3545;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    text-align: center;
}

.btn:hover {
    background-color: var(--secondary-color);
    color: var(--light-text);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-header p {
    color: #777;
    font-size: 1.1rem;
}

/* 顶部信息栏 */
.top-bar {
    background-color: var(--secondary-color);
    color: var(--light-text);
    padding: 10px 0;
    font-size: 0.9rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info span {
    margin-right: 20px;
}

.contact-info i {
    margin-right: 5px;
}

.social-links a {
    color: var(--light-text);
    margin-left: 15px;
    font-size: 1rem;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* 导航栏 */
.header {
    background-color: #fff;
    box-shadow: var(--box-shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 5px;
}

.logo p {
    color: #777;
    font-size: 0.9rem;
}

.main-nav ul {
    display: flex;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 600;
    padding: 10px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.cart a {
    color: var(--text-color);
    font-size: 1.2rem;
    position: relative;
}

.cart a span {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--accent-color);
    color: var(--light-text);
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 横幅 */
.banner {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../images/banner.jpg');
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--light-text);
}

.banner-content {
    max-width: 800px;
    margin: 0 auto;
}

.banner-content h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* 产品部分 */
.featured-products,
.all-products {
    padding: 80px 0;
}

/* 初始隐藏全部产品，用于滚动显示动画 */
.all-products.initially-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.all-products.initially-hidden.revealed {
    opacity: 1;
    transform: translateY(0);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

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

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--accent-color);
    color: var(--light-text);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-info {
    padding: 20px;
}

.product-category {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.product-price {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.view-details {
    color: var(--primary-color);
    font-weight: 600;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: var(--light-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.add-to-cart:hover {
    background-color: var(--secondary-color);
}

.view-more {
    text-align: center;
    margin-top: 50px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.filter-category,
.filter-sort {
    width: 48%;
}

.filter-bar select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: var(--text-color);
    font-size: 1rem;
}

.pagination {
    text-align: center;
    margin-top: 50px;
}

/* 关于我们 */
.about {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image img {
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.about-text p {
    margin-bottom: 20px;
}

.about-text ul {
    margin-top: 20px;
}

.about-text li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

.about-text li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* 服务 */
.services {
    padding: 80px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.service-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

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

.service-icon {
    width: 80px;
    height: 80px;
    background-color: var(--light-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
}

.service-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.service-item h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* 客户评价 */
.testimonials {
    padding: 80px 0;
    background-color: var(--light-bg);
}

.testimonials-slider {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.testimonial-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--box-shadow);
}

.testimonial-content {
    margin-bottom: 20px;
    position: relative;
}

.testimonial-content::before {
    content: '\f10d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: rgba(0, 102, 204, 0.1);
    font-size: 3rem;
    position: absolute;
    top: -20px;
    left: -10px;
    z-index: 0;
}

.testimonial-content p {
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.author-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.author-info p {
    color: #777;
    font-size: 0.9rem;
}

/* 联系我们 */
.contact {
    padding: 80px 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-item {
    display: flex;
    margin-bottom: 30px;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background-color: var(--light-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
}

.contact-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-text h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* 页脚 */
.footer {
    background-color: var(--dark-bg);
    color: #ccc;
    padding: 80px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.footer h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer h3::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
    bottom: 0;
    left: 0;
}

.footer-about p {
    margin-bottom: 20px;
}

.footer-links ul li,
.footer-products ul li {
    margin-bottom: 10px;
}

.footer-links a,
.footer-products a {
    color: #ccc;
    transition: var(--transition);
}

.footer-links a:hover,
.footer-products a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-newsletter p {
    margin-bottom: 20px;
}

.footer-newsletter form {
    display: flex;
}

.footer-newsletter input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px 0 0 4px;
}

.footer-newsletter button {
    border-radius: 0 4px 4px 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
}

/* 购物车弹窗 */
.cart-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.cart-popup.active {
    display: flex;
}

.cart-popup-content {
    background-color: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.cart-popup-header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-popup-header h3 {
    font-size: 1.5rem;
}

.close-cart {
    font-size: 1.8rem;
    cursor: pointer;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.cart-item-quantity button {
    width: 25px;
    height: 25px;
    background-color: var(--light-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.cart-item-quantity input {
    width: 40px;
    height: 25px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin: 0 5px;
}

.cart-item-remove {
    color: var(--error-color);
    cursor: pointer;
    margin-left: 15px;
}

.cart-total {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: right;
}

.cart-buttons {
    padding: 0 20px 20px;
    display: flex;
    justify-content: space-between;
}

/* 产品详情弹窗 */
.product-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.product-popup.active {
    display: flex;
}

.product-popup-content {
    background-color: #fff;
    width: 100%;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.product-popup-header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-popup-header h3 {
    font-size: 1.5rem;
}

.close-product {
    font-size: 1.8rem;
    cursor: pointer;
}

.product-popup-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.product-popup-image img {
    width: 100%;
    border-radius: 8px;
}

.product-popup-price {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.product-popup-category {
    color: #777;
    margin-bottom: 20px;
}

.product-popup-description,
.product-popup-specs {
    margin-bottom: 20px;
}

.product-popup-description h4,
.product-popup-specs h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.product-popup-specs ul li {
    margin-bottom: 5px;
    position: relative;
    padding-left: 20px;
}

.product-popup-specs ul li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.product-popup-quantity {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.product-popup-quantity label {
    margin-right: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    background-color: var(--light-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.quantity-selector input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin: 0 5px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: 1;
    }

    .about-text {
        order: 2;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }

    .logo {
        margin-bottom: 15px;
    }

    .main-nav {
        margin-bottom: 15px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav li {
        margin: 5px 10px;
    }

    .banner-content h2 {
        font-size: 2.5rem;
    }

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

@media (max-width: 576px) {
    .top-bar .container {
        flex-direction: column;
    }

    .contact-info {
        margin-bottom: 10px;
    }

    .testimonials-slider {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-newsletter form {
        flex-direction: column;
    }

    .footer-newsletter input {
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .footer-newsletter button {
        border-radius: 4px;
    }
}