.display-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0;
}
.filter-result-count {
    color: var(--df-muted);
    font-size: 0.875rem;
}
.view-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 8px;
    background: var(--df-paper-deep);
}
body.tax-product_cat .view-toggle-btn {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--df-muted);
    cursor: pointer;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease;
}
body.tax-product_cat .view-toggle-btn:hover {
    color: var(--df-blue);
}
body.tax-product_cat .view-toggle-btn.active {
    background: var(--df-white);
    color: var(--df-blue);
    box-shadow: 0 1px 4px rgb(40 36 31 / 8%);
}

.child-category-cards-grid,
.child-category-products.view-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.child-category-cards-grid {
    margin-top: 8px;
}
.child-category-products {
    position: relative;
    min-height: 8rem;
}
.child-category-products:not(.is-loading) > :is(.product-card, .product-table-scroll) {
    animation: category-results-in 180ms ease-out;
}
@keyframes category-results-in {
    from {
        opacity: 0.5;
    }
    to {
        opacity: 1;
    }
}
.child-category-card,
.product-card {
    min-width: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--df-ink);
    transition:
        box-shadow 240ms ease,
        transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.child-category-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.product-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: inherit;
}
.child-category-card:hover,
.product-card-link:hover {
    color: var(--df-ink);
    text-decoration: none;
}
.card-image,
.product-card-image {
    display: grid;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: transparent;
    padding: clamp(16px, 2vw, 28px);
}
.card-image {
    aspect-ratio: 4 / 3;
}
.product-card-image {
    position: relative;
    aspect-ratio: 1;
}
.card-image img,
.product-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.category-card-body,
.product-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: start;
    align-content: start;
    flex: 1;
    gap: 6px 16px;
    padding: 20px 24px 24px;
    margin-top: 0;
}
.card-title {
    margin: 0;
    color: var(--df-ink);
    font-family: var(--df-serif);
    font-size: clamp(1.25rem, 1.8vw, 1.5rem);
    font-weight: 520;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.product-card-title {
    margin: 0;
    color: var(--df-ink);
    font-family: var(--df-sans);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.product-card-alias {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--df-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.product-card-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 40px;
    pointer-events: none;
    color: #f5c518;
}
.product-card-featured-star {
    fill: currentColor;
    stroke: #b8860b;
    stroke-width: 0.75;
    transform-origin: center;
    animation: category-featured-twinkle 2.8s ease-in-out infinite;
}
.product-card-featured::before,
.product-card-featured::after {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    background: currentColor;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    animation: category-featured-sparkle 2.8s ease-in-out infinite;
}
.product-card-featured::before {
    top: 5px;
    left: 4px;
}
.product-card-featured::after {
    right: 4px;
    bottom: 6px;
    animation-delay: 0.7s;
}
@keyframes category-featured-twinkle {
    0%,
    100% {
        transform: scale(1) rotate(-5deg);
        filter: drop-shadow(0 0 2px rgb(245 197 24 / 20%));
    }
    50% {
        transform: scale(1.12) rotate(5deg);
        filter: drop-shadow(0 0 6px rgb(245 197 24 / 55%));
    }
}
@keyframes category-featured-sparkle {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.65);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}
@media (prefers-reduced-motion: reduce) {
    .product-card-featured-star,
    .product-card-featured::before,
    .product-card-featured::after {
        animation: none;
    }
}
.category-card-arrow {
    display: grid;
    width: 32px;
    height: 32px;
    align-self: start;
    place-items: center;
    border-radius: 50%;
    background: var(--df-paper-deep);
    color: var(--df-blue);
    transition:
        background-color 180ms ease,
        color 180ms ease;
}
.category-card-arrow svg {
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.placeholder-image {
    display: grid;
    height: 100%;
    place-items: center;
    padding: 16px;
    border-radius: 4px;
    background: var(--df-paper-deep);
    color: var(--df-muted);
    font-size: 0.8125rem;
    text-align: center;
}
.child-category-card:focus-visible,
.product-card:focus-within {
    box-shadow: 0 0 0 1px var(--df-blue);
}
@media (hover: hover) and (pointer: fine) {
    .child-category-card:hover,
    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 24px rgb(40 36 31 / 7%);
    }
    .child-category-card:hover img,
    .product-card:hover .product-thumb {
        transform: scale(1.035);
    }
    .child-category-card:hover .category-card-arrow,
    .product-card:hover .category-card-arrow {
        background: var(--df-blue);
        color: white;
    }
    .child-category-card:hover .category-card-arrow svg,
    .product-card:hover .category-card-arrow svg {
        transform: translateX(2px);
    }
}
.child-category-card:active,
.product-card:active {
    transform: translateY(0);
    box-shadow: 0 0 0 1px var(--df-line-strong);
}

.child-category-products.view-table {
    display: block;
}

.product-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-card);
    background: var(--df-white);
    scrollbar-color: var(--df-border-strong) var(--df-surface-subtle);
    scrollbar-width: thin;
}

.product-table-scroll:focus-visible {
    outline-offset: 4px;
}

.product-table {
    width: max-content;
    min-width: 100%;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--df-white);
    color: var(--df-text);
    font-size: 0.8125rem;
}

.product-table th,
.product-table td {
    min-width: 8.5rem;
    max-width: 18rem;
    padding: 0.8125rem var(--df-space-4);
    border-bottom: 1px solid var(--df-border);
    line-height: 1.45;
    text-align: left;
    vertical-align: top;
}

.product-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--df-lavender-100);
    color: var(--df-navy-900);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.product-table tr:last-child td {
    border-bottom: 0;
}

.product-table th:last-child,
.product-table td:last-child {
    border-right: 0;
}

.product-table .product-name-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 12rem;
    background: var(--df-white);
}

.product-table th.product-name-cell {
    z-index: 3;
    background: var(--df-lavender-100);
}

.product-table tbody tr:hover td {
    background: var(--df-canvas);
}

.product-table tbody tr:hover .product-name-cell {
    background: var(--df-canvas);
}

.product-name-cell a {
    color: var(--df-blue-700);
    font-weight: 650;
    text-decoration: none;
}

.product-name-cell a:hover {
    color: var(--df-blue-800);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.product-table td:not(.product-name-cell):not(.product-alias-cell) {
    font-family: var(--df-font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.pagination-container {
    margin-top: var(--df-space-8);
}

.product-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--df-space-4);
}

.pagination-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--df-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

body.tax-product_cat .pagination-item button {
    min-width: var(--df-control-height-compact);
    min-height: var(--df-control-height-compact);
    padding: 0.5rem var(--df-space-3);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-control);
    background: var(--df-white);
    color: var(--df-text);
    cursor: pointer;
}

body.tax-product_cat .pagination-item button:hover {
    border-color: var(--df-blue-500);
    color: var(--df-blue-700);
}

body.tax-product_cat .pagination-item.active button {
    border-color: var(--df-blue-700);
    background: var(--df-blue-700);
    color: var(--df-white);
}

.pagination-ellipsis {
    display: grid;
    min-width: 2rem;
    place-items: center;
    color: var(--df-text-muted);
}

.pagination-info {
    color: var(--df-text-muted);
    font-size: 0.8125rem;
}

.child-category-products.is-loading {
    min-height: 14rem;
    opacity: 0.55;
    pointer-events: none;
}

.products-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: start center;
    padding-top: var(--df-space-16);
    background: rgb(251 250 246 / 65%);
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--df-border);
    border-top-color: var(--df-blue-700);
    border-radius: 50%;
    animation: df-spin 700ms linear infinite;
}

@keyframes df-spin {
    to {
        transform: rotate(360deg);
    }
}

.no-products-found,
.filter-error {
    grid-column: 1 / -1;
    padding: var(--df-space-12);
    border: 1px solid var(--df-border);
    border-radius: var(--df-radius-card);
    background: var(--df-white);
    color: var(--df-text-muted);
    text-align: center;
}

.filter-error {
    border-color: rgb(180 35 24 / 35%);
    color: var(--df-error);
}
