.demo-shop-categories {
    margin: 30px 0;
    color: #001f5b;
}

.demo-shop-categories-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.demo-shop-categories-heading h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: inherit;
}

.demo-all-categories {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: #001f5b;
    font-size: 13px;
    font-weight: 600;
}

.demo-category-cards {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.demo-category-cards > li {
    min-width: 0;
}

.demo-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 10px 8px 12px;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    background: linear-gradient(145deg, #fff, #eef2f7);
    color: #001f5b;
    text-align: center;
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s;
}

.demo-category-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 110px;
    margin-bottom: 8px;
}

.demo-category-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.demo-category-image > i {
    font-size: 44px;
    color: #718096;
}

.demo-category-name {
    margin: auto 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.demo-category-card:hover {
    color: #001f5b;
    border-color: #e5ad00;
    box-shadow: 0 4px 16px rgba(0, 31, 91, .1);
    text-decoration: none;
}

.demo-categories-page {
    padding-top: 30px;
    padding-bottom: 45px;
    color: #001f5b;
}

.demo-categories-page > p {
    margin-bottom: 28px;
}

.demo-category-tree {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.demo-category-tree li {
    /* Override the shared nav li table-cell layout at every tree level. */
    display: block;
    float: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}

.demo-category-tree li > a,
.demo-category-tree-parent > summary > a {
    display: flex;
    align-items: center;
    gap: 10px;
    float: none;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    color: #001f5b;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .2px;
    text-transform: none;
    text-align: start;
    white-space: normal;
    overflow-wrap: break-word;
}

.demo-category-tree-thumbnail {
    display: block;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
}

.demo-category-tree-label {
    min-width: 0;
}

.demo-category-tree > li > a,
.demo-category-tree-parent > summary {
    padding: 13px 12px;
    border: 1px solid rgba(0, 31, 91, .08);
    border-radius: 10px;
    background: rgba(0, 31, 91, .03);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.demo-category-tree-parent > summary {
    display: flex;
    align-items: center;
    padding: 0;
    list-style: none;
    cursor: pointer;
}

.demo-category-tree-parent > summary::-webkit-details-marker {
    display: none;
}

.demo-category-tree-parent > summary > a {
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 13px 12px;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.demo-category-tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    min-height: 44px;
    color: inherit;
}

.demo-category-tree-parent[open] > summary .demo-category-tree-toggle > i {
    transform: rotate(180deg);
}

.demo-category-tree ul {
    display: block;
    position: static;
    width: auto;
    margin: 4px 0 6px 12px;
    padding: 2px 0 2px 18px;
    border-left: 1px solid #dce3ed;
    list-style: none;
}

.demo-category-tree ul li {
    position: relative;
}

.demo-category-tree ul li::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -18px;
    width: 10px;
    border-top: 1px solid #dce3ed;
}

.demo-all-categories:hover,
.demo-category-tree li > a:hover,
.demo-category-tree-parent > summary > a:hover {
    color: #946500;
    text-decoration: underline;
}

.demo-category-tree li > a:hover,
.demo-category-tree-parent > summary:hover {
    background: rgba(0, 31, 91, .08);
}

.demo-shop-categories a:focus-visible,
.demo-category-tree a:focus-visible,
.demo-category-tree-parent > summary:focus-visible {
    outline: 2px solid #e5ad00;
    outline-offset: 4px;
}

html.dark .demo-shop-categories,
html.dark .demo-categories-page,
html.dark .demo-categories-page h1,
html.dark .demo-category-tree li > a,
html.dark .demo-category-tree-parent > summary > a,
html.dark .demo-category-card {
    color: #e2e8f0;
}

html.dark .demo-category-card {
    background: linear-gradient(145deg, #1e2b3b, #111c2b);
    border-color: #2d4057;
}

html.dark .demo-category-tree > li > a,
html.dark .demo-category-tree-parent > summary {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .14);
}

html.dark .demo-category-tree li > a:hover,
html.dark .demo-category-tree-parent > summary:hover {
    background: rgba(255, 255, 255, .1);
    color: #ffc400;
}

html.dark .demo-category-tree ul,
html.dark .demo-category-tree ul li::before {
    border-color: #2d4057;
}

html.dark .demo-all-categories,
html.dark .demo-category-tree a:hover {
    color: #ffc400;
}

html.dark .demo-category-card:hover {
    border-color: #ffc400;
}

@media (max-width: 1199px) {
    .demo-category-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

@media (max-width: 600px) {
    .demo-shop-categories-heading {
        flex-wrap: wrap;
        gap: 8px;
    }

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

    .demo-category-tree {
        grid-template-columns: minmax(0, 1fr);
    }

    .demo-category-tree ul {
        margin-left: 4px;
        padding-left: 12px;
    }

    .demo-category-tree ul li::before {
        left: -12px;
        width: 8px;
    }
}
