/* 响应式设计增强 */

/* 超小屏幕 (手机，小于576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        text-align: center;
    }
    
    .header-right {
        order: -1;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
}

/* 小屏幕 (手机，576px 及以上) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 中等屏幕 (平板，768px 及以上) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .header-content {
        flex-direction: row;
    }
}

/* 大屏幕 (桌面，992px 及以上) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 超大屏幕 (大桌面，1200px 及以上) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 移动端导航优化 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #333;
        cursor: pointer;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .main-nav.nav-open {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .main-nav li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #eee;
    }
    
    .main-nav a {
        display: block;
        padding: 1rem;
        width: 100%;
    }
}

/* 打印样式 */
@media print {
    .header-right,
    .mobile-menu-toggle,
    .back-to-top,
    .social-links,
    .add-to-cart-btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid #000;
    }
    
    .btn-primary,
    .add-to-cart-btn {
        border: 2px solid #000;
    }
    
    .main-nav a:hover {
        background-color: #000;
        color: #fff;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e5e5e5;
    }
    
    .product-card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    header {
        background-color: #2d2d2d;
        border-bottom-color: #404040;
    }
    
    .main-nav a {
        color: #e5e5e5;
    }
    
    .logo {
        color: #B6A083;
    }
}