/* 产品列表页 */
#hcn-products-page .scroll-animate {
    opacity: 1 !important;
    transform: none !important;
}

.hcn-products-page {
    background: #ececea;
    margin: 0;
    padding: 0;
}

.hcn-products-breadcrumb {
    background: linear-gradient(90deg, #1a1d21 0%, #2d3436 100%);
    border-bottom: 3px solid #f47629;
    padding: 14px 20px;
}

.hcn-products-breadcrumb .hcn-breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1280px;
    font-size: 13px;
    line-height: 1.5;
}

.hcn-products-breadcrumb .hcn-breadcrumb__item {
    color: rgba(255, 255, 255, 0.55);
}

.hcn-products-breadcrumb .hcn-breadcrumb__item:not(:last-child)::after {
    content: "/";
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.35);
}

.hcn-products-breadcrumb .hcn-breadcrumb__item a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hcn-products-breadcrumb .hcn-breadcrumb__item a:hover {
    color: #f47629;
}

.hcn-products-breadcrumb .hcn-breadcrumb__item--current {
    color: #fff;
    font-weight: 500;
}

.hcn-products-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f4f4f2 100%);
    border-bottom: 1px solid #ddd;
    padding: 40px 20px 36px;
}

.hcn-products-hero__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.hcn-products-hero__eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: #f47629;
}

.hcn-products-hero__title {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    color: #1a1d21;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.hcn-products-hero__desc {
    margin: 0;
    max-width: 640px;
    font-size: 15px;
    line-height: 1.7;
    color: #5c5c5c;
}

.hcn-products-hero__desc strong {
    color: #f47629;
    font-weight: 700;
}

.hcn-products-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e0e0dc;
    box-shadow: 0 2px 12px rgba(26, 29, 33, 0.06);
    padding: 16px 20px;
    backdrop-filter: blur(8px);
}

.hcn-products-toolbar__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hcn-products-toolbar__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    width: 100%;
}

.hcn-products-search {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    max-width: 320px;
    width: 100%;
    background: #f5f5f4;
    border: 1px solid #d4d4d0;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hcn-products-search:focus-within {
    border-color: #f47629;
    box-shadow: 0 0 0 3px rgba(244, 118, 41, 0.15);
}

.hcn-products-search__icon {
    width: 18px;
    height: 18px;
    fill: #71717a;
    flex-shrink: 0;
    margin-left: 12px;
}

.hcn-products-search__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 9px 10px;
    font-size: 13px;
    color: #1a1d21;
    outline: none;
    font-family: inherit;
}

.hcn-products-search__input::placeholder {
    color: #a1a1aa;
}

.hcn-products-search__btn {
    flex-shrink: 0;
    border: none;
    background: #1a1d21;
    color: #fff;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.hcn-products-search__btn:hover {
    background: #f47629;
}

.hcn-products-cats {
    width: 100%;
    padding: 14px 16px;
    background: #f7f7f5;
    border: 1px solid #e5e5e0;
    border-radius: 8px;
    box-sizing: border-box;
}

.hcn-products-cats__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.hcn-products-cats__row:last-of-type {
    margin-bottom: 0;
}

.hcn-products-cats__row--sub {
    padding-top: 10px;
    border-top: 1px solid #e8e8e4;
}

.hcn-products-cats__row--sub[hidden] {
    display: none !important;
}

.hcn-products-cats__row--legacy {
    padding-top: 10px;
    border-top: 1px dashed #e0e0dc;
}

.hcn-products-cats__label {
    flex: 0 0 72px;
    margin-top: 15px;
    font-size: 12px;
    font-weight: 700;
    color: #71717a;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.hcn-products-cats__row--sub .hcn-products-cats__label {
    color: #f47629;
}

.hcn-products-cats__track {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.hcn-products-cats__track::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(247, 247, 245, 0), #f7f7f5);
}

.hcn-products-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 28px 6px 2px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d0 transparent;
}

.hcn-products-filters::-webkit-scrollbar {
    height: 5px;
}

.hcn-products-filters::-webkit-scrollbar-thumb {
    background: #d4d4d0;
    border-radius: 4px;
}

.hcn-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #3f3f46;
    background: #fff;
    border: 1px solid #d4d4d0;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
}

.hcn-filter-btn--child {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    background: #fff;
}

.hcn-filter-btn--legacy {
    background: #fafaf9;
    border-style: dashed;
}

.hcn-filter-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: #71717a;
    background: #f0f0ee;
    border-radius: 999px;
}

.hcn-filter-btn:hover {
    border-color: #f47629;
    color: #c45f1f;
    box-shadow: 0 2px 8px rgba(244, 118, 41, 0.12);
}

.hcn-filter-btn.active {
    background: #1a1d21;
    border-color: #1a1d21;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 29, 33, 0.18);
}

.hcn-filter-btn.active .hcn-filter-btn__count {
    color: #1a1d21;
    background: #f47629;
}

.hcn-filter-btn--child.active {
    background: #f47629;
    border-color: #f47629;
    color: #fff;
}

.hcn-filter-btn--child.active .hcn-filter-btn__count {
    color: #f47629;
    background: #fff;
}

.hcn-products-cats__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e4;
    font-size: 13px;
    color: #52525b;
}

.hcn-products-cats__status[hidden] {
    display: none !important;
}

.hcn-products-cats__status-text strong {
    color: #1a1d21;
    font-weight: 700;
}

.hcn-products-cats__clear {
    border: none;
    background: transparent;
    color: #f47629;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hcn-products-cats__clear:hover {
    color: #c45f1f;
}

.hcn-products-count {
    margin: 0;
    font-size: 13px;
    color: #71717a;
    white-space: nowrap;
}

.hcn-products-grid-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.hcn-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

.hcn-product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e5e5e0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(26, 29, 33, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hcn-product-card:hover {
    transform: translateY(-4px);
    border-color: #f47629;
    box-shadow: 0 12px 28px rgba(244, 118, 41, 0.15);
}

.hcn-product-card--hidden {
    display: none !important;
}

.hcn-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(180deg, #fafaf9 0%, #f0f0ee 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

.hcn-product-card__media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #f47629, #2d3436);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.hcn-product-card:hover .hcn-product-card__media::after {
    transform: scaleX(1);
}

.hcn-product-card__media img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.35s ease;
}

.hcn-product-card:hover .hcn-product-card__media img {
    transform: scale(1.04);
}

.hcn-product-card__tag {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: rgba(26, 29, 33, 0.82);
    border-radius: 3px;
    border-left: 3px solid #f47629;
    line-height: 1.3;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hcn-product-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    border-top: 1px solid #f0f0ee;
}

.hcn-product-card__name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1d21;
    text-align: center;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}

.hcn-product-card__cta {
    font-size: 12px;
    font-weight: 500;
    color: #f47629;
    text-align: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.hcn-product-card:hover .hcn-product-card__cta {
    opacity: 1;
    transform: translateY(0);
}

.hcn-products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    font-size: 16px;
    color: #71717a;
    background: #fff;
    border-radius: 6px;
    border: 1px dashed #d4d4d0;
}

/* 覆盖主题外层 group 多余内边距 */
#hcn-products-page + *,
.hcn-products-page ~ .wp-block-group {
    margin: 0;
}

@media (max-width: 1100px) {
    .hcn-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hcn-products-hero {
        padding: 28px 16px 24px;
    }

    .hcn-products-toolbar {
        padding: 12px 16px;
    }

    .hcn-products-cats {
        padding: 12px;
    }

    .hcn-products-cats__row {
        flex-direction: column;
        gap: 8px;
    }

    .hcn-products-cats__label {
        flex: none;
        margin-top: 0;
    }

    .hcn-filter-btn {
        min-height: 34px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .hcn-products-grid-wrap {
        padding: 24px 16px 36px;
    }

    .hcn-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .hcn-product-card__name {
        font-size: 13px;
        min-height: auto;
    }

    .hcn-product-card__cta {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 480px) {
    .hcn-products-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .hcn-products-toolbar__top {
        flex-direction: column;
        align-items: stretch;
    }

    .hcn-products-search {
        max-width: none;
    }

    .hcn-products-count {
        text-align: center;
    }
}
