/* ==========================================================================
   🧱 1. 基础基础重置与全局变量
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary-color: #FF9800;
    --text-primary: #333333;
    --text-secondary: #666666;
    --light-bg: #F9F9F9;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   导航栏样式
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
    font-family: 'Noto Serif SC', serif;
}

.logo i {
    margin-right: 8px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    background: rgba(46, 125, 50, 0.1);
}

.cart-btn {
    position: relative;
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

/* 🌟 英雄首屏区域 - 替换淡绿为图片背景 */
.hero {
    position: relative;
    width: 100%;
    height: 100vh; /* 撑满首屏高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 60px;
    /* 替换淡绿色背景为自定义图片，以下是关键修改 */
    background: url('images/hunan-tea-bg.jpg') no-repeat center center; /* 替换为你的图片路径 */
    background-size: cover; /* 图片铺满容器，保持比例 */
    background-attachment: fixed; /* 可选：视差固定效果 */
}
/* 保留遮罩层（保证文字清晰），可根据图片亮度调整透明度 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25); /* 透明度可调整：0.1-0.5 */
    z-index: 2;
}
/* 轮播图外包裹盒：绝对定位铺满首屏，置于 z-index 最底层 */
.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
}

/* 单张背景图片的核心安全尺寸策略 */
.hero-slideshow .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* 💡 宽度放大至 110%，高度保持自适应。
       这能为你 HTML 底部 JS 计算的视差位移预留足够的平移空间，向下滚动时绝不露白 */
    background-size: calc(100% * 1.1) auto; 
    background-position: center 0px;
    background-repeat: no-repeat;
    
    /* 动效：利用 opacity 实现丝滑的淡入淡出渐隐过渡 */
    opacity: 0;
    transition: opacity 1.5s ease-in-out; 
}

/* 被 JavaScript 赋予 active 类时的显示状态 */
.hero-slideshow .slide.active {
    opacity: 1;
}

/* 防眩光暗色遮罩：多色插画背景较复杂，加一层 35% 透明度的滤镜，死死护住文字清晰度 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35); 
    z-index: 2; /* 压在图片的上面，文字的下面 */
}

/* 文字及内容容器：将层级提至最高，保证文字清晰且按钮可正常点击 */
.hero-content {
    position: relative;
    z-index: 3; 
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    /* 💡 关键调整：由于换成了高饱和的图片背景，文字统一改为白色 */
    color: #ffffff; 
}

/* 配合动画与文本阴影，确保字迹任何时候都极易阅读 */
.hero-content h1 {
    font-size: 3.5rem;
    font-family: 'Noto Serif SC', serif;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s 0.3s forwards;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6); 
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeInUp 1s 0.6s forwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 1s 0.9s forwards;
}

/* 优化图片背景下的次级按钮（变成高级感满满的玻璃拟态半透明样式） */
.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
}
.btn-secondary:hover {
    background: #ffffff;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* 下滑箭头层级同步提升 */
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    z-index: 3;
}

.hero-scroll i {
    font-size: 1.5rem;
    color: #ffffff; /* 箭头由绿变白 */
}

/* ==========================================================================
   产品区域
   ========================================================================== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-family: 'Noto Serif SC', serif;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.product-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-type {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    min-height: 60px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(46, 125, 50, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.add-to-cart {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.add-to-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.section-center {
    text-align: center;
    margin: 2rem 0;
}

/* ==========================================================================
   品牌特色
   ========================================================================== */
.brand-features {
    background: var(--light-bg);
    padding: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: rgba(46, 125, 50, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

/* ==========================================================================
   订阅计划
   ========================================================================== */
.subscription {
    padding: 5rem 0;
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
    color: var(--white);
}

.subscription-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.subscription h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-family: 'Noto Serif SC', serif;
}

.subscription p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

.subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.plan {
    background: var(--white);
    color: var(--text-primary);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
}

.plan:hover {
    transform: translateY(-10px);
}

.plan.popular {
    transform: scale(1.05);
    border: 2px solid var(--secondary-color);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.plan h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.plan-price span {
    font-size: 1rem;
    color: var(--text-secondary);
}

.plan ul {
    list-style: none;
    text-align: left;
    margin-bottom: 2rem;
}

.plan li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.plan li:last-child {
    border-bottom: none;
}

.plan li:before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 10px;
}

.subscribe-btn {
    width: 100%;
    margin-top: 1rem;
}

/* ==========================================================================
   页脚与购物车区域
   ========================================================================== */
footer {
    background: #1A1A1A;
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    font-family: 'Noto Serif SC', serif;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col a {
    color: #CCCCCC;
    text-decoration: none;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--primary-light);
}

.footer-col i {
    margin-right: 10px;
    color: var(--primary-light);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
    font-size: 0.9rem;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close-cart:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* ==========================================================================
   动画与响应式设计
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-btns {
        flex-direction: column;
        align-items: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .subscription-plans {
        grid-template-columns: 1fr;
    }
    
    .plan.popular {
        transform: none;
    }
}