.soso-category-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 8px;
    color: #4f494d;
}

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

.soso-category-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    padding: 22px 24px;
    border: 1px solid #eadde2;
    border-radius: 22px;
    background:
        radial-gradient(circle at 92% 20%, rgba(238, 201, 214, .22), transparent 24%),
        linear-gradient(135deg, #fff 0%, #fffafb 100%);
    box-shadow: 0 8px 24px rgba(91, 67, 77, .045);
}

.soso-category-hero::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -58px;
    width: 150px;
    height: 150px;
    border: 24px solid rgba(237, 207, 218, .13);
    border-radius: 50%;
    pointer-events: none;
}

.soso-category-hero__icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 1px solid #f0e3e8;
    border-radius: 18px;
    background: #fff5f8;
    font-size: 26px;
    box-shadow: 0 6px 18px rgba(113, 79, 91, .06);
}

.soso-category-hero__copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.soso-category-eyebrow {
    margin: 0 0 4px;
    color: #ad8d99;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
}

.soso-category-hero__copy h1 {
    margin: 0;
    color: #463f43;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -.035em;
}

.soso-category-hero__copy > p:last-child {
    margin: 7px 0 0;
    color: #8f858a;
    font-size: 12px;
    line-height: 1.6;
}

.soso-category-hero__stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(82px, 1fr));
    gap: 8px;
}

.soso-category-hero__stat {
    min-width: 82px;
    padding: 10px 12px;
    border: 1px solid #eee6e9;
    border-radius: 15px;
    background: rgba(255, 255, 255, .9);
    text-align: center;
}

.soso-category-hero__stat--products {
    border-color: #ebd4dc;
    background: #fff5f8;
}

.soso-category-hero__stat > span {
    display: block;
    margin-bottom: 3px;
    color: #998e93;
    font-size: 9.5px;
    font-weight: 700;
}

.soso-category-hero__stat strong {
    display: block;
    color: #4a4246;
    font-size: 17px;
    line-height: 1.2;
}

.soso-category-hero__stat--products strong {
    color: #a86178;
}

.soso-category-hero__stat strong small {
    margin-left: 2px;
    color: #9c9297;
    font-size: 9px;
    font-weight: 700;
}

.soso-category-search {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e8e2e5;
    border-radius: 18px;
    background: #fff;
}

.soso-category-search__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.soso-category-search__box {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 10px 0 16px;
    border: 1px solid #ddd6d9;
    border-radius: 15px;
    background: #fbfafb;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.soso-category-search__box:focus-within {
    border-color: #e4b9c8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(228, 185, 200, .16), 0 8px 24px rgba(93, 72, 80, .06);
}

.soso-category-search__box > span {
    font-size: 17px;
}

.soso-category-search__box input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
}

.soso-category-search button,
.soso-category-no-result button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.soso-category-search__box button {
    padding: 8px 10px;
    border-radius: 10px;
    background: #efebed;
    color: #716a6e;
    font-size: 11px;
    font-weight: 700;
}

.soso-category-search__actions {
    display: flex;
    gap: 7px;
}

.soso-category-search__actions button {
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #e5dce0;
    border-radius: 13px;
    background: #fff;
    color: #71676c;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.soso-category-search__actions button:first-child {
    border-color: #ead2db;
    background: #fff7f9;
    color: #9b5f74;
}

.soso-category-search__actions button:hover {
    border-color: #d8cbd0;
    background: #faf7f8;
    color: #514a4e;
}

.soso-category-search__result {
    margin: 10px 3px 0;
    color: #91898e;
    font-size: 12px;
}

.soso-category-root-link {
    margin-top: 14px;
}

.soso-category-root-link a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #eadbe1;
    border-radius: 16px;
    background: linear-gradient(90deg, #fff9fb 0%, #fff 72%);
    color: inherit;
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.soso-category-root-link a:hover {
    transform: translateY(-1px);
    border-color: #dec7d0;
    box-shadow: 0 8px 20px rgba(91, 67, 77, .05);
}

.soso-category-root-link__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #fff0f5;
    font-size: 18px;
}

.soso-category-root-link strong,
.soso-category-root-link small {
    display: block;
}

.soso-category-root-link strong {
    color: #51484c;
    font-size: 13px;
}

.soso-category-root-link small {
    margin-top: 2px;
    color: #948b90;
    font-size: 11px;
}

.soso-category-root-link > a > b {
    color: #a17e8b;
    font-size: 15px;
}

.soso-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    margin-top: 14px;
}

.soso-category-card {
    --soso-card-accent: #eaaec2;
    --soso-card-soft: #fff6f9;
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5dfe2;
    border-radius: 18px;
    background: #fff;
    scroll-margin-top: 90px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.soso-category-card::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 14px;
    right: 14px;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: var(--soso-card-accent);
    opacity: .88;
    pointer-events: none;
    transition: left .18s ease, right .18s ease, opacity .18s ease;
}

.soso-category-card:nth-child(4n + 2) {
    --soso-card-accent: #e8c790;
    --soso-card-soft: #fffaf0;
}

.soso-category-card:nth-child(4n + 3) {
    --soso-card-accent: #a8d1c7;
    --soso-card-soft: #f4fbf9;
}

.soso-category-card:nth-child(4n + 4) {
    --soso-card-accent: #bbb1df;
    --soso-card-soft: #f8f6ff;
}

.soso-category-card[open] {
    border-color: #ddd2d7;
    box-shadow: 0 12px 28px rgba(84, 67, 74, .065);
}

.soso-category-card[open]::before {
    left: 9px;
    right: 9px;
    opacity: 1;
}

.soso-category-card[hidden],
.soso-category-group[hidden],
.soso-category-leaf[hidden] {
    display: none !important;
}

.soso-category-card__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 78px;
    padding: 17px 17px 15px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color .18s ease;
}

.soso-category-card[open] > .soso-category-card__summary {
    background: var(--soso-card-soft);
}

.soso-category-card__summary::-webkit-details-marker,
.soso-category-group__summary::-webkit-details-marker {
    display: none;
}

.soso-category-card__summary-main {
    min-width: 0;
}

.soso-category-card__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.soso-category-card__title-row > strong {
    overflow: hidden;
    min-width: 0;
    color: #494347;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soso-category-card__count {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 1px solid #ead6de;
    border-radius: 999px;
    background: var(--soso-card-soft);
    color: #8b6170;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.2;
}

.soso-category-card__summary-main > small {
    display: block;
    overflow: hidden;
    margin-top: 5px;
    color: #9b9397;
    font-size: 10.5px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soso-category-card__preview {
    color: #aaa1a6;
}

.soso-category-card__toggle,
.soso-category-group__toggle {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: #f4f1f2;
    color: #756e72;
    transition: transform .18s ease, background-color .18s ease;
}

.soso-category-card__toggle {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.soso-category-card[open] .soso-category-card__toggle,
.soso-category-group[open] > .soso-category-group__summary .soso-category-group__toggle {
    transform: rotate(180deg);
}

.soso-category-card[open] > .soso-category-card__summary .soso-category-card__toggle {
    background: #fff;
}

.soso-category-card__body {
    padding: 12px;
    border-top: 1px solid #eee9eb;
    background: #fff;
}

.soso-category-card[open] > .soso-category-card__body,
.soso-category-group[open] > .soso-category-group__body {
    animation: soso-category-reveal .2s ease both;
}

@keyframes soso-category-reveal {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.soso-category-card__all,
.soso-category-group__all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #5b5559;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.soso-category-card__all {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #eee6e9;
    border-radius: 11px;
    background: #faf8f9;
}

.soso-category-card__all-meta,
.soso-category-group__all-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.soso-category-card__all-meta small,
.soso-category-group__all-meta small {
    color: #9a8f94;
    font-size: 9.5px;
    font-weight: 750;
}

.soso-category-card__all-meta b,
.soso-category-group__all-meta b {
    color: #9b7b87;
    font-size: 13px;
}

.soso-category-card__all:hover,
.soso-category-group__all:hover {
    color: #3f3a3d;
}

.soso-category-branch-grid,
.soso-category-subgrid {
    display: grid;
    gap: 7px;
}

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

.soso-category-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
}

.soso-category-leaf,
.soso-category-group {
    min-width: 0;
}

.soso-category-leaf {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #eee9eb;
    border-radius: 11px;
    background: #fff;
    color: #575155;
    text-decoration: none;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.soso-category-leaf:hover {
    border-color: #ddcfd5;
    background: #fffafb;
}

.soso-category-leaf__name {
    overflow: hidden;
    min-width: 0;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soso-category-leaf__count {
    padding: 3px 6px;
    border-radius: 999px;
    background: #f7f2f4;
    color: #8f7f86;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

.soso-category-leaf__arrow {
    color: #aaa0a5;
    font-size: 15px;
}

.soso-category-group {
    overflow: hidden;
    border: 1px solid #eae4e7;
    border-radius: 12px;
    background: #fdfcfc;
}

.soso-category-group__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 9px 10px;
    cursor: pointer;
    list-style: none;
    transition: background-color .16s ease;
}

.soso-category-group[open] > .soso-category-group__summary {
    background: #faf6f8;
}

.soso-category-group__summary-copy {
    min-width: 0;
}

.soso-category-group__summary strong,
.soso-category-group__summary small {
    display: block;
}

.soso-category-group__summary strong {
    overflow: hidden;
    color: #514b4f;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soso-category-group__summary small {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    color: #a39ba0;
    font-size: 9.5px;
}

.soso-category-group__summary small b {
    color: #98727f;
    font-weight: 800;
}

.soso-category-group__toggle {
    width: 24px;
    height: 24px;
    font-size: 13px;
}

.soso-category-group__body {
    padding: 9px;
    border-top: 1px solid #eee8eb;
    background: #fff;
}

.soso-category-group__all {
    padding: 2px 2px 8px;
    color: #777075;
    font-size: 10.5px;
}

.soso-category-group--level-2,
.soso-category-group--level-3,
.soso-category-group--level-4,
.soso-category-group--level-5 {
    grid-column: 1 / -1;
}

.soso-category-card--empty-products,
.soso-category-group--empty-products,
.soso-category-leaf--empty-products {
    opacity: .72;
}

.soso-category-card--empty-products .soso-category-card__count,
.soso-category-leaf--empty-products .soso-category-leaf__count {
    background: #f3f1f2;
    color: #9e969a;
}

.soso-category-card__empty {
    padding: 18px 8px 8px;
    color: #938b8f;
    font-size: 12px;
    text-align: center;
}

.soso-category-no-result,
.soso-category-empty {
    margin-top: 20px;
    padding: 36px 20px;
    border: 1px solid #e7e1e4;
    border-radius: 20px;
    background: #fff;
    text-align: center;
}

.soso-category-no-result > span,
.soso-category-empty > span {
    display: block;
    margin-bottom: 8px;
    font-size: 28px;
}

.soso-category-no-result strong,
.soso-category-empty h2 {
    display: block;
    margin: 0;
    font-size: 16px;
}

.soso-category-no-result p,
.soso-category-empty p {
    margin: 7px 0 0;
    color: #8f878c;
    font-size: 12px;
    line-height: 1.6;
}

.soso-category-no-result button {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #eee9eb;
    color: #5d565a;
    font-size: 12px;
    font-weight: 700;
}

@media (hover: hover) and (pointer: fine) {
    .soso-category-card:not([open]):hover {
        transform: translateY(-2px);
        border-color: #d9cbd1;
        box-shadow: 0 10px 24px rgba(84, 67, 74, .07);
    }

    .soso-category-card:not([open]):hover::before {
        left: 9px;
        right: 9px;
        opacity: 1;
    }

    .soso-category-card:not([open]) > .soso-category-card__summary:hover {
        background: var(--soso-card-soft);
    }

    .soso-category-leaf:hover,
    .soso-category-group:hover {
        box-shadow: 0 5px 14px rgba(84, 67, 74, .045);
    }
}

@media (prefers-reduced-motion: reduce) {
    .soso-category-search__box,
    .soso-category-card,
    .soso-category-card::before,
    .soso-category-card__summary,
    .soso-category-card__toggle,
    .soso-category-group__toggle,
    .soso-category-root-link a {
        transition: none !important;
    }

    .soso-category-card[open] > .soso-category-card__body,
    .soso-category-group[open] > .soso-category-group__body {
        animation: none !important;
    }
}

@media (max-width: 900px) {
    .soso-category-page {
        width: min(100% - 24px, 760px);
        padding: 20px 0 6px;
    }

    .soso-category-grid {
        grid-template-columns: 1fr;
    }

    .soso-category-search__row {
        grid-template-columns: 1fr;
    }

    .soso-category-search__actions button {
        min-height: 40px;
    }
}

@media (max-width: 600px) {
    .soso-category-page {
        width: calc(100% - 20px);
    }

    .soso-category-hero {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        padding: 17px;
        border-radius: 18px;
    }

    .soso-category-hero__icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 22px;
    }

    .soso-category-hero__copy h1 {
        font-size: 20px;
    }

    .soso-category-hero__stats {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, 1fr);
    }

    .soso-category-hero__stat {
        padding: 8px 10px;
    }

    .soso-category-hero__stat strong {
        font-size: 15px;
    }

    .soso-category-search {
        padding: 11px;
        border-radius: 15px;
    }

    .soso-category-search__box {
        min-height: 46px;
        padding-left: 12px;
    }

    .soso-category-search__box input {
        height: 44px;
        font-size: 13px;
    }

    .soso-category-search__actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .soso-category-search__actions button {
        min-height: 38px;
        padding: 0 10px;
    }

    .soso-category-root-link a {
        padding: 12px 13px;
    }

    .soso-category-card__summary {
        min-height: 70px;
        padding: 15px 14px 13px;
    }

    .soso-category-card__title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .soso-category-card__title-row > strong {
        max-width: 100%;
        font-size: 14px;
    }

    .soso-category-card__count {
        padding: 3px 6px;
    }

    .soso-category-card__preview {
        display: none;
    }

    .soso-category-card__body {
        padding: 10px;
    }

    .soso-category-branch-grid,
    .soso-category-subgrid {
        grid-template-columns: 1fr;
    }

    .soso-category-group--level-2,
    .soso-category-group--level-3,
    .soso-category-group--level-4,
    .soso-category-group--level-5 {
        grid-column: auto;
    }

    .soso-category-leaf {
        min-height: 40px;
    }

    .soso-category-leaf__count {
        font-size: 8.5px;
    }
}

/* categories.php: page-only spacing normalization for Rebuilder shop layout. */
body.soso-category-page-active .soso-category-page {
    margin-bottom: 0 !important;
    background: transparent !important;
}

body.soso-category-page-active #wrapper,
body.soso-category-page-active #container,
body.soso-category-page-active .shop-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body.soso-category-page-active .shop-content {
    min-height: 0 !important;
}

body.soso-category-page-active footer,
body.soso-category-page-active #footer,
body.soso-category-page-active #ft {
    margin-top: 0 !important;
}
