html, body {
    overscroll-behavior: none;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.product-archive {
    min-height: 100vh;
    background: #f5f5f7;
    margin-top: 75px;
    overscroll-behavior: auto;
}

.product-archive__loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.product-archive__loading--active {
    display: flex;
}

.product-archive__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 113, 227, 0.2);
    border-top: 3px solid #0071e3;
    border-radius: 50%;
    animation: productArchiveSpin 1s linear infinite;
    margin-bottom: 16px;
}

.product-archive__loading-text {
    font-size: 17px;
    font-weight: 500;
    color: #1d1d1f;
    letter-spacing: -0.24px;
}

@keyframes productArchiveSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Products Grid Local Loading */
.products-grid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: #86868b;
    font-size: 16px;
    font-weight: 500;
}

.products-grid-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(0, 113, 227, 0.2);
    border-top: 2px solid #0071e3;
    border-radius: 50%;
    animation: productArchiveSpin 1s linear infinite;
    margin-bottom: 16px;
}

/* Top Bar */
.product-archive__top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    background: #f5f5f7;
}

/* Cuisine Options - Centered */
.cuisine-ops {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: #ffffff;
    border-radius: 980px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin: 0 auto; /* Center the cuisine options */
}

.cuisine-link {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 500;
    color: #6e6e73;
    background: transparent;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 1px solid transparent;
}

.cuisine-link[is-active="true"] {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.cuisine-link:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.05);
}

/* Sort Select - Fixed text overflow */
.product-archive__sort {
    display: flex;
    align-items: center;
}

.sort-select {
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-size: 15px;
    color: #1d1d1f;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    appearance: none;
    background: #ffffff url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%231d1d1f' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>") no-repeat right 16px center;
    background-size: 12px;
    padding: 12px 40px 12px 16px;
}

.sort-select:focus {
    outline: none;
    border-color: #0071e3;
}

/* Main Container */
.product-archive__container {
    display: flex;
    gap: 0;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px 24px;
    min-height: calc(100vh - 160px);
    background: #f5f5f7;
}

/* Sidebar */
.product-archive__sidebar {
    flex: 0 0 280px;
    background: #ffffff;
    padding: 24px;
    border-radius: 18px 0 0 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 0;
}

.filter-section__header {
    margin-bottom: 20px;
}

.filter-section__title {
    font-size: 20px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.28px;
    margin: 0;
}

/* Category Filter - Unified with cuisine-link style */
.category-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.category-filter__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f5f5f7;
    border-radius: 980px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.category-filter__item:hover {
    background: #e8e8ed;
}

.category-filter__item--active {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.category-filter__content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-filter__name {
    font-size: 16px;
    font-weight: 500;
    color: #6e6e73;
}

.category-filter__item--active .category-filter__name {
    color: #1d1d1f;
    font-weight: 600;
}

.category-filter__count {
    font-size: 14px;
    color: #86868b;
    font-weight: 400;
}

.category-filter__item--active .category-filter__count {
    color: #1d1d1f;
}

/* Main Content */
.product-archive__main {
    flex: 1;
    min-width: 0;
    background: #ffffff;
    border-radius: 0 18px 18px 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Tags Section - Unified with cuisine-link style */
.tags-section {
    padding: 24px 24px 0;
}

.tags-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-filter {
    padding: 12px 16px;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 980px;
    font-size: 16px;
    font-weight: 500;
    color: #6e6e73;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-filter:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.05);
}

.tag-filter--active {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Products Section */
.products-section {
    padding: 24px;
}

.products-section__header {
    margin-bottom: 24px;
}

.results-count {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.24px;
}

/* Products Grid - 4 columns */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.no-product {
    text-align: center;
    padding: 80px 24px;
    font-size: 18px;
    color: #86868b;
    grid-column: 1 / -1;
}

.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.products-pagination a,
.products-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
    font-weight: 500;
    color: #1d1d1f;
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-pagination a:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: translateY(-1px);
}

.products-pagination .current {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .product-archive__top-bar {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    .cuisine-ops {
        width: fit-content;
        margin: 0 auto;
    }

    .product-archive__container {
        flex-direction: column;
        gap: 0;
    }

    .product-archive__sidebar {
        border-radius: 18px 18px 0 0;
        margin-bottom: 0;
    }

    .product-archive__main {
        border-radius: 0 0 18px 18px;
    }

    .category-filter {
        max-height: 200px;
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-archive__container {
        padding: 0 16px 16px;
    }

    .product-archive__top-bar {
        padding: 20px 16px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-archive__container {
        padding: 0 12px 12px;
    }

    .product-archive__top-bar {
        padding: 16px 12px;
    }

    .product-archive__sidebar,
    .product-archive__main {
        padding: 20px;
    }

    .cuisine-ops {
        width: 100%;
        justify-content: center;
    }

    .sort-select {
        min-width: 100%;
    }

    /* 移动端禁用拖拽优化 */
    html, body {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: none;
    }

    .product-archive {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: auto;
    }
}

@media (max-width: 480px) {
    .product-archive {
        margin-top: 60px;
    }

    .product-archive__container {
        padding: 0 8px 8px;
    }

    .product-archive__top-bar {
        padding: 12px 8px;
    }

    .product-archive__sidebar,
    .product-archive__main {
        padding: 16px;
        border-radius: 14px;
    }

    .cuisine-link {
        padding: 10px 24px;
        font-size: 14px;
    }

    .tag-filter {
        padding: 10px 14px;
        font-size: 14px;
    }

    .category-filter__item {
        padding: 10px 14px;
    }

    .filter-section__title {
        font-size: 18px;
    }
}