/* ============================================
   零食商城 - 响应式样式
   ============================================ */

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .slide-content h1 {
        font-size: 2.5rem;
    }

    .slide-content p {
        font-size: 1.1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .regional-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* 移动设备 (< 768px) */
@media (max-width: 768px) {
    /* 导航栏 */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-md);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        width: 100%;
        padding: 1rem 0;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-light);
        margin-top: 0;
        padding: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .nav-right {
        gap: 0.5rem;
    }

    .search-box {
        display: none;
    }

    .search-box.mobile-active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        padding: 15px;
        background: var(--bg-white);
        box-shadow: var(--shadow-md);
    }

    .search-box.mobile-active input {
        width: 100%;
    }

    /* 轮播Banner */
    .hero-banner {
        height: 400px;
    }

    .slide-content h1 {
        font-size: 2rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    .slider-controls {
        padding: 0 1rem;
    }

    .slider-controls button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* 区块标题 */
    .section-header h2 {
        font-size: 2rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* 分类网格 */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .category-card {
        padding: 1.5rem 0.5rem;
    }

    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .category-card h3 {
        font-size: 1rem;
    }

    .category-card p {
        font-size: 0.8rem;
    }

    /* 商品网格 */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .product-image {
        height: 180px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .price-current {
        font-size: 1.1rem;
    }

    /* 地方特色 */
    .regional-grid {
        grid-template-columns: 1fr;
    }

    /* 用户评价 */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* 页脚 */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* 按钮 */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* 区块间距 */
    section {
        padding: 40px 0;
    }

    /* 套餐网格 */
    .packages-grid {
        grid-template-columns: 1fr !important;
    }

    .packages-preview {
        grid-template-columns: 1fr !important;
    }
}

/* 小屏移动设备 (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.5rem;
    }

    .hero-banner {
        height: 300px;
    }

    .slide-content h1 {
        font-size: 1.5rem;
    }

    .slide-content p {
        font-size: 0.9rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem 0.5rem;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
    }

    .btn-add-cart {
        width: 100%;
    }

    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }

    /* 套餐详情页 */
    .package-detail-wrapper {
        grid-template-columns: 1fr !important;
    }

    .package-main-image {
        height: 300px !important;
    }

    .products-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-banner {
        height: 350px;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .footer,
    .scroll-top,
    .slider-controls,
    .slider-dots {
        display: none;
    }

    .hero-banner {
        margin-top: 0;
        height: auto;
    }

    section {
        page-break-inside: avoid;
    }
}

