/* 基础样式 */
:root {
    --primary-color: #2E7D32;
    --primary-light: #60ad5e;
    --primary-dark: #005005;
    --secondary-color: #FFC107;
    --secondary-light: #fff350;
    --secondary-dark: #c79100;
    --text-on-primary: #FFFFFF;
    --text-on-secondary: #000000;
    --surface-color: #FFFFFF;
    --background-color: #F5F5F5;
    --error-color: #B00020;
    --success-color: #4CAF50;
    --shadow-1: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-2: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-3: 0 8px 16px rgba(0,0,0,0.14);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: rgba(0, 0, 0, 0.87);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    background-color: #EEEEEE;
    color: rgba(0, 0, 0, 0.87);
    overflow: hidden;
    position: relative;
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

.btn:hover {
    box-shadow: var(--shadow-1);
    background-color: #E0E0E0;
    transform: translateY(-2px);
}

.btn.primary:hover {
    background-color: var(--primary-light);
}

.btn:active, 
.btn.clicked {
    transform: translateY(0);
    box-shadow: var(--shadow-1);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 0 0;
}

.btn:active::after,
.btn.clicked::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        opacity: 1;
        transform: scale(0) translate(-50%, -50%);
    }
    100% {
        opacity: 0;
        transform: scale(20) translate(-50%, -50%);
    }
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    box-shadow: var(--shadow-2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar .logo {
    height: 40px;
}

.menu ul {
    display: flex;
    list-style: none;
}

.menu li {
    margin-left: 24px;
}

.menu a {
    color: var(--text-on-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.menu a:hover,
.menu a.active {
    opacity: 1;
}

.menu a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--text-on-primary);
}

.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle.active {
    transform: rotate(180deg);
}

.mobile-menu-toggle .material-icons {
    transition: transform var(--transition-normal);
}

.mobile-menu-toggle.active .material-icons {
    transform: rotate(180deg);
}

/* 懒加载图片样式 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* 轮播图样式 */
.carousel {
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
}

.carousel-container {
    height: 400px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    text-align: center;
    z-index: 2;
}

.carousel-caption h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.carousel-caption p {
    font-size: 16px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.carousel-controls {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.carousel-prev,
.carousel-next {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.carousel-prev:active,
.carousel-next:active {
    transform: scale(0.9);
}

.carousel-indicators {
    display: flex;
    gap: 8px;
    margin: 0 16px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.indicator.active {
    background-color: white;
    transform: scale(1.2);
}

.indicator:hover {
    transform: scale(1.3);
    background-color: rgba(255, 255, 255, 0.8);
}

/* 产品展示区样式 */
.featured-products {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 32px;
    color: var(--primary-dark);
    position: relative;
    font-size: 28px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-3);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    transition: transform var(--transition-fast);
}

.product-badge.hot {
    background-color: var(--secondary-color);
    color: var(--text-on-secondary);
}

.product-card:hover .product-badge {
    transform: translateY(-3px);
}

.product-info {
    padding: 16px;
}

.product-title {
    font-size: 18px;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.87);
    transition: color var(--transition-fast);
}

.product-card:hover .product-title {
    color: var(--primary-color);
}

.product-description {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 16px;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.price {
    font-size: 20px;
    font-weight: 500;
    color: var(--primary-color);
}

.original-price {
    margin-left: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    text-decoration: line-through;
}

.add-to-cart {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
}

/* 悬浮购物车图标 */
.floating-cart {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: var(--text-on-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-2);
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 100;
}

.floating-cart:hover,
.floating-cart.hovered {
    background-color: var(--secondary-light);
    transform: scale(1.1);
    box-shadow: var(--shadow-3);
}

.floating-cart.bounce {
    animation: bounce 0.5s;
}

.cart-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error-color);
    color: white;
    font-size: 12px;
    font-weight: 500;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 6px;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.cart-counter.updating {
    transform: scale(0);
}

.cart-counter.updated {
    transform: scale(1.2);
    background-color: var(--success-color);
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* 飞入购物车动画元素 */
.fly-item {
    position: fixed;
    width: 50px;
    height: 50px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0.8;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* 响应式样式 */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar .container {
        height: 56px;
    }
    
    .menu {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background-color: var(--primary-color);
        height: 0;
        overflow: hidden;
        transition: height var(--transition-normal);
        box-shadow: var(--shadow-2);
    }
    
    .menu.active {
        height: auto;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    
    .menu ul {
        flex-direction: column;
        padding: 16px;
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .menu.active ul {
        opacity: 1;
        transform: translateY(0);
    }
    
    .menu li {
        margin: 0 0 16px 0;
        opacity: 0;
        transform: translateX(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .menu.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    .menu.active li:nth-child(1) {
        transition-delay: 0.1s;
    }
    
    .menu.active li:nth-child(2) {
        transition-delay: 0.2s;
    }
    
    .menu.active li:nth-child(3) {
        transition-delay: 0.3s;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .carousel-container {
        height: 300px;
    }
    
    .carousel-caption h2 {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-container {
        height: 250px;
    }
    
    .carousel-caption h2 {
        font-size: 20px;
    }
    
    .carousel-caption p {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .floating-cart {
        width: 50px;
        height: 50px;
        right: 16px;
        bottom: 16px;
    }
} 