/* ============================================================
   响应式样式表 - Responsive Styles
   ============================================================ */

/* Large Desktop (max-width: 1366px) */
@media (max-width: 1366px) {
    :root {
        --max-width: 1200px;
    }
    
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (max-width: 1200px) */
@media (max-width: 1200px) {
    .hero-wrap {
        grid-template-columns: 220px 1fr 240px;
    }
    
    .hero-slider {
        height: 340px;
    }
    
    .slide-content h2 {
        font-size: 36px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .footer-top {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 30px;
    }
    
    .footer-col:nth-child(5) {
        display: none;
    }
}

/* Tablet Landscape (max-width: 992px) */
@media (max-width: 992px) {
    .top-bar {
        display: none;
    }
    
    .header-main {
        height: 70px;
        gap: 15px;
    }
    
    .logo img {
        height: 45px;
    }
    
    .search-box {
        height: 38px;
    }
    
    .search-box select {
        display: none;
    }
    
    .search-box button {
        padding: 0 18px;
        font-size: 14px;
    }
    
    .action-item span:not(.cart-badge) {
        display: none;
    }
    
    .action-item {
        flex-direction: row;
    }
    
    .nav-categories {
        width: 200px;
        padding: 0 15px;
        font-size: 14px;
    }
    
    .nav-menu a {
        padding: 0 16px;
        font-size: 14px;
    }
    
    .hero-wrap {
        grid-template-columns: 200px 1fr;
    }
    
    .hero-side {
        display: none;
    }
    
    .hero-slider {
        height: 300px;
    }
    
    .slide-content h2 {
        font-size: 30px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .category-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .news-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .news-card:last-child {
        display: none;
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-top {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 25px;
    }
    
    .footer-col:nth-child(4),
    .footer-col:nth-child(5) {
        display: none;
    }
    
    .list-layout {
        grid-template-columns: 200px 1fr;
    }
    
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .about-hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-image {
        height: 250px;
        order: -1;
    }
    
    .floating-sidebar {
        display: none;
    }
}

/* Tablet Portrait (max-width: 768px) */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .header-main {
        height: 60px;
        flex-wrap: wrap;
    }
    
    .logo {
        flex: 1;
    }
    
    .logo img {
        height: 40px;
    }
    
    .search-box {
        order: 3;
        flex-basis: 100%;
        max-width: 100%;
        display: none;
    }
    
    .search-box.mobile-open {
        display: flex;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .main-nav {
        display: none;
    }
    
    .main-nav.mobile-open {
        /* 导航与 header 是兄弟节点且无定位祖先，用绝对定位会让 top:100% 相对视口，菜单跑到屏幕外；
           这里直接走正常文档流，展开后紧贴 header 下方 */
        display: block;
        position: relative;
        z-index: 999;
    }
    
    .main-nav .container {
        flex-direction: column;
        height: auto;
        padding: 0;
    }
    
    .nav-inner {
        flex-direction: column;
        align-items: stretch;
        height: auto;
    }
    
    .nav-categories {
        width: 100%;
        height: 50px;
    }
    
    .nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-menu a.active::after {
        display: none;
    }
    
    .category-sidebar {
        position: static;
        width: 100%;
        display: none;
    }
    
    .nav-categories.open .category-sidebar {
        display: block;
    }
    
    .hero-section {
        padding: 15px 0;
    }
    
    .hero-wrap {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hero-categories {
        display: none;
    }
    
    .hero-slider {
        height: 220px;
        border-radius: var(--radius-md);
    }
    
    .slide-content {
        padding: 20px;
    }
    
    .slide-content h2 {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .slide-content p {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .slide-btn {
        padding: 8px 24px;
        font-size: 13px;
    }
    
    .slider-arrow {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    
    .section {
        padding: 25px 0;
    }
    
    .section-header {
        margin-bottom: 18px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .category-card {
        padding: 15px 10px;
    }
    
    .category-card .icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .category-card .name {
        font-size: 12px;
    }
    
    .category-card .count {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-image .emoji {
        font-size: 48px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-title {
        font-size: 13px;
        height: 34px;
    }
    
    .price-current {
        font-size: 17px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .brand-card {
        padding: 18px 10px;
    }
    
    .brand-logo {
        width: 60px;
        height: 60px;
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .brand-name {
        font-size: 12px;
    }
    
    .brand-location {
        display: none;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .news-card:last-child {
        display: block;
    }
    
    .news-image {
        height: 140px;
    }
    
    .advantages-section {
        padding: 35px 0;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-top: 20px;
    }
    
    .advantage-item {
        padding: 20px 15px;
    }
    
    .advantage-icon {
        width: 55px;
        height: 55px;
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .advantage-title {
        font-size: 15px;
    }
    
    .advantage-desc {
        font-size: 12px;
    }
    
    .footer {
        padding: 30px 0 0;
    }
    
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
        padding-bottom: 25px;
    }
    
    .footer-col:first-child {
        grid-column: 1 / -1;
    }
    
    .footer-col h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .footer-col li {
        margin-bottom: 8px;
        font-size: 12px;
    }
    
    .page-header {
        padding: 25px 0;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .list-layout {
        grid-template-columns: 1fr;
        padding: 20px 0;
    }
    
    .sidebar-filter {
        display: none;
    }
    
    .sidebar-filter.mobile-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        border-radius: 0;
        overflow-y: auto;
    }
    
    .list-toolbar {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .sort-options {
        overflow-x: auto;
        width: 100%;
        order: 2;
    }
    
    .list-info {
        order: 1;
        width: 100%;
        text-align: center;
    }
    
    .about-stats {
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px 10px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .contact-info-card,
    .contact-form {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}

/* Mobile Large (max-width: 576px) */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .action-item i {
        font-size: 18px;
    }
    
    .cart-badge {
        font-size: 9px;
        padding: 1px 5px;
        top: -3px;
        right: -5px;
    }
    
    .hero-slider {
        height: 180px;
    }
    
    .slide-content h2 {
        font-size: 18px;
    }
    
    .slide-content p {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .slide-btn {
        padding: 6px 18px;
        font-size: 12px;
    }
    
    .slider-dots span {
        width: 8px;
        height: 8px;
    }
    
    .slider-dots span.active {
        width: 20px;
    }
    
    .section-title {
        font-size: 18px;
        padding-left: 12px;
    }
    
    .section-title::before {
        height: 20px;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-image .emoji {
        font-size: 40px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 12px;
        height: 32px;
        margin-bottom: 5px;
    }
    
    .price-current {
        font-size: 15px;
    }
    
    .product-meta {
        font-size: 11px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-col:first-child {
        grid-column: auto;
    }
    
    .footer-bottom {
        font-size: 11px;
        padding: 15px 0;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .about-text h2 {
        font-size: 22px;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-number {
        font-size: 20px;
    }
    
    .contact-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* Mobile Small (max-width: 400px) */
@media (max-width: 400px) {
    .header-main {
        height: 56px;
        gap: 10px;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .category-card {
        padding: 12px 8px;
    }
    
    .category-card .icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .category-card .name {
        font-size: 11px;
    }
    
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
        text-align: left;
    }
    
    .stat-number {
        margin: 0;
    }
}

/* ============================================================
   布局骨架补全：头部 / 搜索 的响应式适配
   ============================================================ */
@media (max-width: 992px) {
    .header-main {
        height: auto;
        min-height: 70px;
        padding: 8px 0;
    }
    
    .search-tabs,
    .hot-search {
        display: none;
    }
    
    .search-box {
        height: auto;
    }
    
    .search-input-wrap {
        height: 38px;
        border-radius: var(--radius-md);
    }
    
    .search-input-wrap select {
        display: none;
    }
    
    .search-input-wrap button {
        padding: 0 18px;
        font-size: 14px;
    }
    
    .logo-title i {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .header-main {
        height: auto;
        min-height: 60px;
        padding: 8px 0;
    }
    
    .search-toggle {
        display: block;
    }
    
    .search-box {
        height: auto;
    }
    
    .search-box.mobile-open {
        display: block;
    }
    
    .search-tabs,
    .hot-search {
        display: none;
    }
    
    .logo-title i {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .header-actions .btn-publish,
    .header-actions .btn-buy {
        display: none;
    }
}
