/**
 * 全部商品页面样式
 * 支持亮色/暗色模式
 */

/* ========== 主体内容区域 ========== */
.allgoods-main {
    background-color: var(--bg-secondary);
    min-height: 100vh;
    padding-bottom: 48px;
    position: relative;
}

[data-theme="dark"] .allgoods-main {
    background-color: #181A20;
}

/* ========== 面包屑导航 ========== */
.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 16px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 22px;
}

.breadcrumb-link {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    color: #64748B;
    text-transform: capitalize;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--primary-green);
}

.breadcrumb-separator {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breadcrumb-separator svg {
    stroke: #64748B;
}

.breadcrumb-current {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .breadcrumb-current {
    color: #9CA3AF;
}

/* ========== 页面容器 ========== */
.allgoods-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ========== 页面标题 ========== */
.page-title-container {
    width: 100%;
    display: flex;
}

.page-title {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 36px;
    line-height: normal;
    color: #413E40;
    text-transform: capitalize;
    text-align: center;
    letter-spacing: 0.72px;
}

[data-theme="dark"] .page-title {
    color: #9CA3AF;
    font-weight: 900;
}

/* ========== 分类面板 ========== */
.allgoods-category-panel {
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .allgoods-category-panel {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.84) 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

.allgoods-category-overview {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.allgoods-category-overview__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.allgoods-category-overview__eyebrow {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #64748B;
}

.allgoods-category-overview__title {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: #0F172A;
    text-transform: capitalize;
}

[data-theme="dark"] .allgoods-category-overview__title {
    color: #F8FAFC;
}

.allgoods-category-overview__hint {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #64748B;
}

.allgoods-category-overview__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.allgoods-category-overview__toggle,
.allgoods-category-overview__reset {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.84);
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.allgoods-category-overview__reset {
    min-height: 36px;
    padding: 0 14px;
}

[data-theme="dark"] .allgoods-category-overview__toggle,
[data-theme="dark"] .allgoods-category-overview__reset {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
}

.allgoods-category-overview__toggle:hover,
.allgoods-category-overview__reset:hover {
    transform: translateY(-1px);
    color: #118A44;
    border-color: rgba(37, 212, 110, 0.4);
}

.allgoods-category-overview__reset:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.2);
}

.allgoods-category-group {
    margin-top: 24px;
}

.allgoods-category-group.is-hidden {
    display: none;
}

.allgoods-category-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.allgoods-category-group__label {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #334155;
}

[data-theme="dark"] .allgoods-category-group__label {
    color: #CBD5E1;
}

.allgoods-category-group__caption {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
}

.allgoods-category-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.allgoods-category-primary__btn {
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .allgoods-category-primary__btn {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.08);
}

.allgoods-category-primary__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 212, 110, 0.4);
}

.allgoods-category-primary__btn.is-active {
    background: linear-gradient(135deg, rgba(37, 212, 110, 0.14) 0%, rgba(37, 212, 110, 0.22) 100%);
    border-color: rgba(37, 212, 110, 0.55);
    box-shadow: 0 14px 30px rgba(37, 212, 110, 0.12);
}

.allgoods-category-primary__btn.is-context {
    border-color: rgba(37, 212, 110, 0.72);
}

.allgoods-category-primary__content,
.allgoods-category-secondary__content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.allgoods-category-primary__icon,
.allgoods-category-secondary__icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.allgoods-category-primary__icon svg {
    width: 18px;
    height: 18px;
}

.allgoods-category-primary__image,
.allgoods-category-secondary__image {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.allgoods-category-primary__text {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    white-space: nowrap;
}

.allgoods-category-primary__badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.allgoods-category-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.8);
}

[data-theme="dark"] .allgoods-category-secondary {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(255, 255, 255, 0.08);
}

.allgoods-category-secondary.is-collapsed {
    display: none;
}

.allgoods-category-secondary__btn {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .allgoods-category-secondary__btn {
    background: rgba(30, 41, 59, 0.82);
}

.allgoods-category-secondary__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 212, 110, 0.35);
}

.allgoods-category-secondary__btn.is-active {
    background: #25D46E;
    border-color: #25D46E;
    box-shadow: 0 12px 24px rgba(37, 212, 110, 0.2);
}

.allgoods-category-secondary__text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.allgoods-category-secondary__btn.is-active .allgoods-category-secondary__text {
    color: #fff;
}

.allgoods-category-secondary__empty {
    width: 100%;
    padding: 2px 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #64748B;
}

.allgoods-category-skeleton {
    width: 88px;
    height: 16px;
    display: block;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.16) 0%, rgba(148, 163, 184, 0.26) 50%, rgba(148, 163, 184, 0.16) 100%);
    background-size: 200% 100%;
    animation: allgoodsCategorySkeletonPulse 1.2s linear infinite;
}

.allgoods-category-primary__btn.is-skeleton,
.allgoods-category-secondary__btn.is-skeleton {
    pointer-events: none;
}

@keyframes allgoodsCategorySkeletonPulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========== 响应式布局 ========== */
@media (max-width: 1200px) {
    .allgoods-container {
        padding: 0 24px 48px;
    }

    .breadcrumb-container {
        padding: 32px 24px 16px;
    }
}

@media (max-width: 768px) {
    .allgoods-category-panel {
        padding: 18px 16px;
        border-radius: 22px;
    }

    .allgoods-category-overview {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .allgoods-category-overview__meta {
        min-width: 0;
        flex: 1 1 auto;
    }

    .allgoods-category-overview__title {
        font-size: 24px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .allgoods-category-overview__actions {
        width: auto;
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .allgoods-category-overview__toggle {
        display: inline-flex;
    }

    .allgoods-category-overview__reset {
        min-height: 34px;
        padding: 0 12px;
    }

    .allgoods-category-primary,
    .allgoods-category-secondary {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x;
        padding-bottom: 6px;
    }

    .allgoods-category-primary::-webkit-scrollbar,
    .allgoods-category-secondary::-webkit-scrollbar {
        display: none;
    }

    .allgoods-category-primary__btn,
    .allgoods-category-secondary__btn {
        flex: 0 0 auto;
    }

    .allgoods-category-primary__btn {
        min-height: 50px;
        padding: 0 14px;
    }

    .allgoods-category-secondary {
        padding: 14px;
        border: 1px solid rgba(148, 163, 184, 0.16);
        border-radius: 18px;
        background: rgba(248, 250, 252, 0.8);
    }

    .allgoods-category-secondary__btn {
        min-height: 38px;
        padding: 0 14px;
    }

    .allgoods-category-secondary__empty {
        min-width: 220px;
        padding: 10px 4px 0;
        font-size: 14px;
    }

    .allgoods-container {
        padding: 0 16px 32px;
    }

    .breadcrumb-container {
        padding: 24px 16px 12px;
    }

    .page-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
    }

    .allgoods-category-overview__title {
        font-size: 20px;
        line-height: 1.2;
    }

    .allgoods-category-primary__text,
    .allgoods-category-secondary__text {
        font-size: 13px;
    }
}

/* ========== 加载动画 ========== */
.allgoods-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}