.ds-category-page {
    min-height: 100vh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
}

.ds-category-page__hero {
    position: relative;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 10% 10%, rgba(var(--primary-rgb), .13), transparent 34%),
        radial-gradient(circle at 88% 30%, rgba(var(--secondary-rgb), .10), transparent 32%),
        linear-gradient(180deg, var(--surface), var(--bg));
}

.ds-category-page__hero::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), .38), transparent);
}

.ds-category-page__hero-inner,
.ds-category-page__body-inner {
    width: min(100% - 2rem, 1280px);
    margin-inline: auto;
}

.ds-category-page__hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: end;
    padding: clamp(3rem, 8vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
}

.ds-category-page__copy {
    display: grid;
    gap: .85rem;
    max-width: 820px;
}

.ds-category-page__copy span {
    color: var(--primary);
    font-size: .76rem;
    font-weight: 950;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ds-category-page__copy h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.6rem, 8vw, 7.5rem);
    font-weight: 950;
    letter-spacing: -.065em;
    line-height: .9;
}

.ds-category-page__copy p {
    max-width: 62ch;
    margin: 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.8vw, 1.22rem);
    font-weight: 650;
    line-height: 1.85;
}

.ds-category-page__summary {
    position: relative;
    display: grid;
    gap: .25rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg);
    padding: 1.2rem;
    box-shadow: var(--shadow-md);
}

.ds-category-page__summary::before {
    content: "";
    position: absolute;
    inset: .6rem;
    border: 1px solid rgba(var(--primary-rgb), .16);
    border-radius: calc(var(--border-radius) - 4px);
    pointer-events: none;
}

.ds-category-page__summary strong {
    color: var(--primary);
    font-size: clamp(3rem, 7vw, 5.8rem);
    font-weight: 950;
    letter-spacing: -.08em;
    line-height: .9;
}

.ds-category-page__summary span {
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 900;
}

.ds-category-page__body {
    padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(4rem, 7vw, 7rem);
}

.ds-category-page__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.ds-category-page__section-head h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.45rem, 3vw, 2.4rem);
    font-weight: 950;
    letter-spacing: -.04em;
}

.ds-category-page__section-head a,
.ds-category-empty a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary);
    padding: .7rem 1rem;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 950;
    white-space: nowrap;
    transition: border-color .2s ease, transform .2s ease;
}

.ds-category-page__section-head a:hover,
.ds-category-page__section-head a:focus-visible,
.ds-category-empty a:hover,
.ds-category-empty a:focus-visible {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.ds-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(.85rem, 2vw, 1.35rem);
}

.ds-category-card {
    position: relative;
    display: grid;
    min-height: clamp(270px, 34vw, 390px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-hover);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    isolation: isolate;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.ds-category-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, transparent 20%, rgba(var(--black-rgb), .18) 48%, rgba(var(--black-rgb), .78)),
        radial-gradient(circle at 14% 16%, rgba(var(--primary-rgb), .38), transparent 34%);
    transition: opacity .25s ease;
}

.ds-category-card:hover,
.ds-category-card:focus-visible {
    border-color: rgba(var(--primary-rgb), .48);
    box-shadow: 0 24px 60px rgba(var(--primary-rgb), .16);
    transform: translateY(-6px);
}

.ds-category-card:hover::after,
.ds-category-card:focus-visible::after {
    opacity: .9;
}

.ds-category-card__media {
    position: absolute;
    inset: 0;
    margin: 0;
}

.ds-category-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform .65s cubic-bezier(.2, .8, .2, 1);
}

.ds-category-card:hover .ds-category-card__media img,
.ds-category-card:focus-visible .ds-category-card__media img {
    transform: scale(1.09);
}

.ds-category-card__content {
    position: relative;
    z-index: 2;
    align-self: end;
    display: grid;
    gap: .35rem;
    padding: clamp(1rem, 2.2vw, 1.45rem);
}

.ds-category-card__content span {
    color: rgba(var(--text-hover-rgb), .72);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .12em;
}

.ds-category-card__content h2 {
    margin: 0;
    color: var(--text-hover);
    font-size: clamp(1.25rem, 2.7vw, 2rem);
    font-weight: 950;
    letter-spacing: -.04em;
    line-height: 1.02;
}

.ds-category-card__content p {
    margin: 0;
    color: rgba(var(--text-hover-rgb), .82);
    font-size: .82rem;
    font-weight: 850;
}

.ds-category-card__action {
    position: absolute;
    inset-block-start: .9rem;
    inset-inline-end: .9rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(var(--text-hover-rgb), .24);
    border-radius: 999px;
    background: rgba(var(--text-hover-rgb), .12);
    color: var(--text-hover);
    backdrop-filter: blur(14px);
    transform: translateY(-6px);
    opacity: .82;
    transition: opacity .2s ease, transform .2s ease;
}

.ds-category-card__action svg {
    width: 18px;
    height: 18px;
}

[dir="rtl"] .ds-category-card__action svg {
    transform: rotate(180deg);
}

.ds-category-card:hover .ds-category-card__action,
.ds-category-card:focus-visible .ds-category-card__action {
    opacity: 1;
    transform: translateY(0);
}

.ds-category-empty {
    display: grid;
    justify-items: center;
    gap: .9rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface);
    padding: clamp(2rem, 7vw, 5rem) 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.ds-category-empty div {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), .10);
    color: var(--primary);
}

.ds-category-empty svg {
    width: 34px;
    height: 34px;
}

.ds-category-empty h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    font-weight: 950;
}

.ds-category-empty p {
    max-width: 46ch;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.8;
}

.ds-category-page :focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), .35);
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    .ds-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .ds-category-page__hero-inner {
        grid-template-columns: 1fr;
    }

    .ds-category-page__summary {
        max-width: 280px;
    }

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

@media (max-width: 620px) {
    .ds-category-page__hero-inner,
    .ds-category-page__body-inner {
        width: min(100% - 1rem, 1280px);
    }

    .ds-category-page__section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .ds-category-page__section-head a {
        width: 100%;
    }

    .ds-category-grid {
        gap: .75rem;
    }

    .ds-category-card {
        min-height: 240px;
    }

    .ds-category-card:hover,
    .ds-category-card:focus-visible {
        transform: none;
    }

    .ds-category-card__content {
        padding: .9rem;
    }

    .ds-category-card__content h2 {
        font-size: 1.05rem;
    }
}

@media (max-width: 390px) {
    .ds-category-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ds-category-page *,
    .ds-category-page *::before,
    .ds-category-page *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
