/* 移动端响应式样式 */

/* 移动端导航菜单 */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 999;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.mobile-nav-close:hover {
    background: #e9ecef;
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #eee;
}

.mobile-nav-menu a {
    display: block;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease, color 0.3s ease;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a.active {
    background: #007cba;
    color: white;
}

.mobile-nav-menu .nav-icon {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* 移动端搜索 */
.mobile-search {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.mobile-search input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

/* 移动端产品卡片优化 */
@media (max-width: 768px) {
    /* 显示移动端元素 */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .mobile-nav {
        display: block;
    }
    
    /* 隐藏桌面端导航 */
    .nav-menu {
        display: none !important;
    }
    
    .nav-search {
        display: none !important;
    }
    
    /* 优化容器 */
    .container {
        padding: 0 1rem;
    }
    
    /* 优化导航头部 */
    .main-nav {
        padding: 1rem 0;
    }
    
    .nav-brand .logo {
        font-size: 1.2rem;
    }
    
    /* 优化英雄区域 */
    .hero {
        padding: 2rem 0;
    }
    
    .hero-layout {
        flex-direction: column;
        gap: 2rem;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-features {
        display: none; /* 在小屏幕上隐藏特性列表 */
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .btn-premium,
    .btn-outline {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    /* 优化产品网格 */
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 1.5rem 0;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .product-actions .btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }
    
    /* 优化分类网格 */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .category-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .category-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .category-card p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* 优化特性网格 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-item {
        text-align: center;
        padding: 1.5rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    /* 优化页脚 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 1.5rem;
    }
    
    .footer-section h3 {
        margin-bottom: 1rem;
    }
    
    .footer-section ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-section ul li {
        margin: 0;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .mobile-nav {
        width: 280px;
        right: -280px;
    }
    
    .footer-section ul {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 移动端产品详情页优化 */
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-gallery {
        order: 1;
    }
    
    .product-details {
        order: 2;
    }
    
    .main-image {
        height: 300px;
    }
    
    .gallery-images {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
    
    .product-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .buy-buttons {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .btn-amazon-primary {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    /* 推荐产品移动端优化 */
    .recommendation-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .bought-together-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .bought-together-item {
        width: 100%;
    }
    
    .bought-together-summary {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 1rem;
        border-top: 1px solid #eee;
        margin-top: 1rem;
    }
    
    /* 产品图片gallery移动端优化 */
    .product-images {
        order: 1;
        margin-bottom: 1.5rem;
    }
    
    .product-info {
        order: 2;
    }
    
    /* 确保主图在移动端有合适的高度 */
    .main-image-container {
        min-height: 250px;
        max-height: 400px;
    }
    
    /* 缩略图滚动区域优化 */
    .image-gallery {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* 当图片很多时，确保滚动流畅 */
    .image-gallery.many-images {
        scroll-snap-type: x mandatory;
    }
    
    .image-gallery.many-images .gallery-thumb {
        scroll-snap-align: center;
    }
}

/* 触摸友好的按钮 */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* iOS 推荐的最小触摸目标 */
        padding: 0.75rem 1.5rem;
    }
    
    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 3px 0;
    }
}

/* 移动端动画优化 */
@media (max-width: 768px) {
    /* 减少动画以提高性能 */
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-image img {
        transform: none;
    }
    
    .feature-item:hover {
        transform: none;
    }
    
    /* 简化过渡效果 */
    * {
        transition-duration: 0.2s !important;
    }
}

/* 移动端加载优化 */
@media (max-width: 768px) {
    .lazy {
        opacity: 1; /* 移动端直接显示，减少布局抖动 */
    }
} 