@keyframes auroracard-category-legacy-fallback {
    to {
        visibility: visible;
    }
}

.aurora-home-layout > .home-main {
    position: relative;
}

.home-main.auroracard-category-content-loading::before {
    position: absolute;
    z-index: 20;
    inset: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, .7);
    content: '';
}

.auroracard-category-load-state {
    position: absolute;
    z-index: 21;
    top: 16px;
    right: 16px;
    padding: 8px 12px;
    border: 1px solid #f0ded2;
    border-radius: 999px;
    background: #fff8f3;
    box-shadow: 0 4px 14px rgba(84, 51, 34, .1);
    color: #b45e38;
    font-size: 12px;
    line-height: 1;
}

@media (min-width: 1025px) {

    .aurora-category-card {
        position: relative;
        overflow: hidden;
    }

    .auroracard-category-tree {
        position: relative;
        width: 100%;
        min-width: 0;
    }

    .aurora-category-card .category-list.single-category-list {
        height: 560px;
        max-height: 560px;
        overflow-x: hidden;
        overflow-y: auto;
        visibility: hidden;
        animation: auroracard-category-legacy-fallback 0s linear 1.5s forwards;
    }

    .aurora-category-card .category-list.auroracard-category-tree-slot {
        display: block;
        margin: 0;
    }

    .auroracard-category-tree__scroll {
        max-height: 560px;
        padding-right: 2px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-color: rgba(212, 120, 76, .42) transparent;
        scrollbar-width: thin;
    }

    .auroracard-category-tree__scroll::-webkit-scrollbar {
        width: 4px;
    }

    .auroracard-category-tree__scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .auroracard-category-tree__scroll::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(212, 120, 76, .34);
    }

    .auroracard-category-tree__scroll::-webkit-scrollbar-thumb:hover {
        background: rgba(212, 120, 76, .58);
    }

    .auroracard-category-tree__list,
    .auroracard-category-tree__children {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .auroracard-category-tree__children {
        margin-left: 9px;
        padding-left: 4px;
        border-left: 1px solid #f0e7df;
    }

    .auroracard-category-tree__item {
        min-width: 0;
    }

    .auroracard-category-tree__row {
        display: flex;
        min-width: 0;
        align-items: center;
    }

    .auroracard-category-tree__toggle {
        width: 18px;
        height: 30px;
        flex: 0 0 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: #aaa29b;
        cursor: pointer;
    }

    .auroracard-category-tree__toggle i {
        font-size: 16px;
        transition: transform .2s ease;
    }

    .auroracard-category-tree__item.is-expanded > .auroracard-category-tree__row .auroracard-category-tree__toggle i {
        transform: rotate(90deg);
    }

    .aurora-category-card .category-list .auroracard-category-tree__link,
    .aurora-category-card .category-list .auroracard-category-tree__all {
        display: flex;
        align-items: center;
        min-width: 0;
        width: auto;
        flex: 1 1 auto;
        justify-content: flex-start;
        gap: 5px;
        min-height: 30px;
        padding: 6px 4px;
        border-radius: 12px;
        background: transparent;
        color: #6b6b6b;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.35;
        text-decoration: none;
        transition: background-color .18s ease, color .18s ease;
    }

    .aurora-category-card .category-list .auroracard-category-tree__all {
        margin: 0 0 2px 18px;
    }

    .aurora-category-card .category-list .auroracard-category-tree__link:hover,
    .aurora-category-card .category-list .auroracard-category-tree__all:hover {
        background: #fff7f1;
        color: #c96e43;
    }

    .aurora-category-card .category-list .auroracard-category-tree__link[aria-current="page"],
    .aurora-category-card .category-list .auroracard-category-tree__all[aria-current="page"] {
        background: #fdf0e8;
        color: #d4784c;
        font-weight: 700;
    }

    .auroracard-category-tree__image {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        border-radius: 6px;
        object-fit: cover;
    }

    .aurora-category-card .category-list .auroracard-category-tree__name {
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .aurora-category-card .category-list .auroracard-category-tree__count {
        min-width: 20px;
        flex: 0 0 auto;
        padding: 1px 5px;
        border-radius: 999px;
        background: #f4f0ec;
        color: #8b8179;
        font-size: 11px;
        line-height: 18px;
        text-align: center;
    }

}

@media (max-width: 768px) {
    .aurora-category-card {
        overflow: hidden;
    }

    .aurora-category-card .category-list.single-category-list {
        height: 147px;
        max-height: 147px;
        overflow-x: hidden;
        overflow-y: auto;
        visibility: hidden;
        animation: auroracard-category-legacy-fallback 0s linear 1.5s forwards;
    }

    .aurora-category-card .category-list.auroracard-mobile-category-slot {
        display: block;
        margin: 0;
    }

    .auroracard-mobile-category-path {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .auroracard-mobile-category-path__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 36px;
        margin-bottom: 8px;
    }

    .auroracard-mobile-category-breadcrumb {
        display: flex;
        min-width: 0;
        flex: 1 1 auto;
        align-items: center;
        gap: 6px;
        overflow: hidden;
        color: #a19a94;
        font-size: 12px;
        line-height: 1.4;
        white-space: nowrap;
    }

    .auroracard-mobile-category-breadcrumb a,
    .auroracard-mobile-category-breadcrumb .is-current {
        min-width: 0;
        overflow: hidden;
        color: inherit;
        text-overflow: ellipsis;
        text-decoration: none;
    }

    .auroracard-mobile-category-breadcrumb a {
        flex: 0 1 auto;
    }

    .auroracard-mobile-category-breadcrumb .is-current {
        color: #5f554e;
        font-weight: 700;
    }

    .auroracard-mobile-category-separator {
        flex: 0 0 auto;
        color: #d5cec8;
    }

    .auroracard-mobile-category-level {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        max-height: 103px;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .auroracard-mobile-category-level.has-overflow::after {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 18px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .88));
        content: '';
        pointer-events: none;
    }

    .auroracard-mobile-category-level.is-expanded {
        max-height: none;
    }

    .auroracard-mobile-category-level.is-expanded::after {
        display: none;
    }

    .auroracard-mobile-category-level a {
        display: inline-flex;
        min-width: 0;
        max-width: 100%;
        min-height: 38px;
        align-items: center;
        gap: 6px;
        padding: 6px 11px;
        border: 1px solid #eee8e2;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 4px 12px rgba(84, 51, 34, .04);
        color: #6b625c;
        font-size: 12px;
        line-height: 1.35;
        text-decoration: none;
        box-sizing: border-box;
    }

    .auroracard-mobile-category-level a.is-active {
        border-color: rgba(212, 120, 76, .42);
        background: #fdf0e8;
        color: #d4784c;
        font-weight: 700;
    }

    .auroracard-mobile-category-level a > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .auroracard-mobile-category-level img {
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
        border-radius: 5px;
        object-fit: cover;
    }

    .auroracard-mobile-category-toggle {
        display: inline-flex;
        min-height: 36px;
        flex: 0 0 auto;
        align-items: center;
        gap: 4px;
        margin: 0;
        padding: 0 2px;
        border: 0;
        background: transparent;
        color: #d4784c;
        font-size: 12px;
        white-space: nowrap;
        cursor: pointer;
    }

    .auroracard-mobile-category-toggle[hidden] {
        display: none;
    }

    .auroracard-mobile-category-toggle i {
        font-size: 15px;
        transition: transform .2s ease;
    }

    .auroracard-mobile-category-toggle[aria-expanded="true"] i {
        transform: rotate(180deg);
    }

    .auroracard-category-load-state {
        top: 12px;
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auroracard-category-tree__toggle i,
    .auroracard-mobile-category-toggle i {
        transition: none;
    }
}
