/*
CaspiaSupply Product Catalog v1
独立商品列表页组件
*/

.pcat-page {
    --pcat-text: #15171b;
    --pcat-muted: #6f737b;
    --pcat-line: #e5e6e8;
    --pcat-soft: #f5f5f6;
    --pcat-accent: #0fbfb2;

    width: calc(100% - 48px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 46px 0 88px;
    color: var(--pcat-text);
}

.pcat-page *,
.pcat-page *::before,
.pcat-page *::after {
    box-sizing: border-box;
}

.pcat-hero {
    max-width: 820px;
    margin: 0 auto 62px;
    text-align: center;
}

.pcat-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #8a8d93;
    font-size: 13px;
}

.pcat-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.pcat-breadcrumb a:hover {
    color: var(--pcat-accent);
}

.pcat-hero h1 {
    margin: 0;
    color: #0d0f12;
    font-size: clamp(34px, 3.3vw, 52px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.045em;
}

.pcat-hero p {
    max-width: 720px;
    margin: 17px auto 0;
    color: #666a72;
    font-size: 15px;
    line-height: 1.75;
}

.pcat-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
    gap: clamp(42px, 5vw, 78px);
}

.pcat-sidebar {
    position: sticky;
    top: 96px;
    min-width: 0;
}

.pcat-filter-group {
    padding: 0 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--pcat-line);
}

.pcat-filter-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border: 0;
    color: #1c1e22;
    background: transparent;
    font-size: 15px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.pcat-filter-toggle {
    color: #555960;
    font-size: 18px;
    font-weight: 400;
}

.pcat-filter-body {
    display: grid;
    gap: 6px;
    margin-top: 15px;
}

.pcat-filter-group:not(.is-open) .pcat-filter-body {
    display: none;
}

.pcat-category {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    border: 0;
    color: #646870;
    background: transparent;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: color .2s ease, transform .2s ease;
}

.pcat-category:hover {
    color: #15171b;
    transform: translateX(3px);
}

.pcat-category.is-active {
    color: #ed5c5c;
    font-weight: 600;
}

.pcat-category em {
    color: inherit;
    font-size: 13px;
    font-style: normal;
}

.pcat-check-list,
.pcat-radio-list {
    gap: 11px;
}

.pcat-check-list label,
.pcat-radio-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #62666e;
    font-size: 14px;
    cursor: pointer;
}

.pcat-check-list input,
.pcat-radio-list input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #16181c;
}

.pcat-main {
    min-width: 0;
}

.pcat-toolbar {
    min-height: 46px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.pcat-toolbar-left {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pcat-result-count {
    margin-right: 8px;
    color: #6a6e75;
    font-size: 14px;
    white-space: nowrap;
}

.pcat-result-count strong {
    color: #1b1d21;
    font-weight: 600;
}

.pcat-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pcat-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border: 0;
    border-radius: 5px;
    color: #3f4248;
    background: #f3f3f4;
    font-size: 13px;
    cursor: pointer;
}

.pcat-filter-chip::after {
    content: "×";
    color: #60646b;
    font-size: 17px;
}

.pcat-clear {
    min-height: 38px;
    padding: 0 15px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    background: #15171b;
    font-size: 13px;
    cursor: pointer;
}

.pcat-toolbar-right {
    display: flex;
    align-items: center;
    gap: 26px;
}

.pcat-grid-switch {
    display: flex;
    align-items: center;
    gap: 3px;
}

.pcat-grid-switch button {
    width: 28px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: #c6c8cc;
    background: transparent;
    cursor: pointer;
}

.pcat-grid-switch button.is-active {
    color: #16181c;
}

.pcat-grid-icon {
    display: grid;
    grid-auto-flow: column;
    gap: 3px;
}

.pcat-grid-icon i {
    width: 4px;
    height: 15px;
    display: block;
    border-radius: 2px;
    background: currentColor;
}

.pcat-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c7077;
    font-size: 14px;
    white-space: nowrap;
}

.pcat-sort select {
    min-width: 168px;
    padding: 9px 30px 9px 10px;
    border: 0;
    color: #303238;
    background: transparent;
    font: inherit;
    outline: none;
    cursor: pointer;
}

.pcat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 42px 28px;
}

.pcat-grid[data-columns="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pcat-grid[data-columns="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 20px;
}

.pcat-card {
    min-width: 0;
}

.pcat-card[hidden] {
    display: none !important;
}

.pcat-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: #f1f2f3;
    text-decoration: none;
}

.pcat-card-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform .45s ease, filter .35s ease;
}

.pcat-card:hover .pcat-card-media img {
    transform: scale(1.045);
    filter: brightness(.96);
}

.pcat-image-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #b7bbc1;
}

.pcat-image-empty svg {
    width: 62px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.3;
}

.pcat-card-category {
    position: absolute;
    top: 13px;
    left: 13px;
    max-width: calc(100% - 26px);
    padding: 7px 10px;
    overflow: hidden;
    border-radius: 999px;
    color: #30343a;
    background: rgba(255, 255, 255, .84);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.pcat-card-view {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #fff;
    background: rgba(18, 20, 24, .9);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}

.pcat-card:hover .pcat-card-view {
    opacity: 1;
    transform: translateY(0);
}

.pcat-card-content {
    padding: 15px 3px 0;
}

.pcat-card-tags {
    min-height: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}

.pcat-card-tags span {
    padding: 4px 7px;
    border-radius: 4px;
    color: #32736e;
    background: #e9f7f5;
    font-size: 10px;
    font-weight: 600;
}

.pcat-card h2 {
    min-height: 2.8em;
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.4;
}

.pcat-card h2 a {
    color: #191b1f;
    text-decoration: none;
}

.pcat-card h2 a:hover {
    color: var(--pcat-accent);
}

.pcat-card-subtitle {
    min-height: 2.8em;
    display: -webkit-box;
    margin: 7px 0 0;
    overflow: hidden;
    color: #7b7f87;
    font-size: 12px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pcat-card-specs {
    display: grid;
    gap: 7px;
    margin: 14px 0 0;
}

.pcat-card-specs div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 7px;
    border-bottom: 1px solid #ececee;
}

.pcat-card-specs dt {
    color: #8a8e95;
    font-size: 11px;
}

.pcat-card-specs dd {
    margin: 0;
    color: #4f535a;
    font-size: 11px;
    text-align: right;
}

.pcat-card-footer {
    min-height: 48px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
}

.pcat-card-price {
    min-width: 0;
}

.pcat-card-price small {
    display: block;
    margin-bottom: 4px;
    color: #92969c;
    font-size: 10px;
}

.pcat-card-price strong {
    display: block;
    overflow: hidden;
    color: #111317;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcat-card-arrow {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #15171b;
    font-size: 18px;
    text-decoration: none;
    transition: transform .2s ease, background .2s ease;
}

.pcat-card-arrow:hover {
    background: var(--pcat-accent);
    transform: translateX(2px);
}

.pcat-empty {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #777b82;
    text-align: center;
}

.pcat-empty[hidden] {
    display: none !important;
}

.pcat-empty-icon {
    margin-bottom: 12px;
    font-size: 42px;
}

@media (max-width: 1120px) {
    .pcat-layout {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 36px;
    }

    .pcat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pcat-grid[data-columns="4"] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .pcat-page {
        width: calc(100% - 24px);
        padding-top: 30px;
    }

    .pcat-hero {
        margin-bottom: 34px;
    }

    .pcat-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pcat-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 22px;
    }

    .pcat-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .pcat-toolbar-right {
        justify-content: space-between;
    }

    .pcat-grid,
    .pcat-grid[data-columns="2"],
    .pcat-grid[data-columns="3"],
    .pcat-grid[data-columns="4"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 14px;
    }

    .pcat-grid-switch {
        display: none;
    }
}

@media (max-width: 520px) {
    .pcat-sidebar {
        grid-template-columns: 1fr;
    }

    .pcat-toolbar-right {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .pcat-sort {
        justify-content: space-between;
    }

    .pcat-sort select {
        min-width: 0;
        max-width: 62%;
    }

    .pcat-grid,
    .pcat-grid[data-columns="2"],
    .pcat-grid[data-columns="3"],
    .pcat-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }

    .pcat-card-media {
        aspect-ratio: 4 / 3;
    }
}


/* ==================================================
   Product catalog hotfix 1
   1. Entire product content area uses a white background.
   2. Ensure all filter and toolbar labels remain visible.
   ================================================== */

.pcat-page {
    position: relative;
    isolation: isolate;
    background: #ffffff;
}

.pcat-page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: -1;
    width: 100vw;
    background: #ffffff;
    transform: translateX(-50%);
}

.pcat-hero,
.pcat-sidebar,
.pcat-main,
.pcat-toolbar,
.pcat-filter-heading,
.pcat-category,
.pcat-check-list label,
.pcat-radio-list label,
.pcat-result-count,
.pcat-sort {
    visibility: visible;
    opacity: 1;
}

.pcat-filter-heading > span:first-child {
    display: inline;
    color: #1c1e22;
}

.pcat-check-list label > span,
.pcat-radio-list label > span {
    display: inline;
    color: #62666e;
}

.pcat-toolbar {
    color: #1b1d21;
}
