:root {
    --category-ink: #171717;
    --category-paper: #f6f4ef;
    --category-muted: #e9e6df;
    --category-line: rgb(17 17 17 / 17%);
}

.category-page {
    min-height: 100vh;
    background: var(--category-paper);
    color: var(--category-ink);
    font-family: Arial, Helvetica, sans-serif;
}

.category-hero {
    position: relative;
    display: grid;
    min-height: min(84svh, 58rem);
    overflow: hidden;
    background: #292724;
    color: #fff;
    place-items: center;
}

.category-hero > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: category-hero-reveal 1.2s ease both;
}

.category-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(0 0 0 / 40%), rgb(0 0 0 / 17%) 45%, rgb(0 0 0 / 58%));
}

.category-hero-content {
    position: relative;
    z-index: 1;
    max-width: 72rem;
    padding: 9rem 1.5rem 5rem;
    text-align: center;
}

.category-hero-content > p:first-child,
.category-section-heading > p,
.category-content > p {
    margin: 0 0 1rem;
    font-size: 0.66rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.category-hero-content h1,
.category-section-heading h2,
.category-content h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.8rem, 8vw, 8rem);
    font-weight: 400;
    line-height: 0.96;
    text-wrap: balance;
}

.category-hero-content h1 {
    font-size: clamp(1.4rem, 4vw, 4rem);
}

.category-hero-summary {
    max-width: 46rem;
    margin: 2rem auto 0;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.65;
}

.category-breadcrumbs {
    padding: 1.25rem clamp(1.25rem, 5vw, 5rem);
    border-bottom: 1px solid var(--category-line);
    background: #fff;
}

.category-breadcrumbs ol {
    display: flex;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    list-style: none;
    white-space: nowrap;
}

.category-breadcrumbs li {
    color: #77726b;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: none;
}

.category-breadcrumbs li + li::before {
    margin-inline: 0.75rem;
    content: "/";
}

.category-breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.category-children,
.category-products,
.category-content {
    padding: clamp(4.5rem, 9vw, 9rem) clamp(1.25rem, 5vw, 5rem);
}

.category-children {
    background: var(--category-ink);
    color: #fff;
}

.category-products {
    background: #fff;
    padding-top: clamp(1.5rem, 3vw, 3rem);
}

.category-section-heading {
    max-width: 58rem;
    margin: 0 auto clamp(2.5rem, 5vw, 5rem);
    text-align: center;
}

.category-section-heading h2 {
    font-size: clamp(1.95rem, 3.2vw, 3.4rem);
}

.category-content h2 {
    font-size: clamp(2.2rem, 4vw, 4.6rem);
}

.category-child-grid {
    display: grid;
    max-width: 82rem;
    margin-inline: auto;
    border-top: 1px solid rgb(255 255 255 / 24%);
}

.category-child-grid a {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2.5rem) 0;
    border-bottom: 1px solid rgb(255 255 255 / 24%);
    color: inherit;
    text-decoration: none;
}

.category-child-grid a > span:first-child {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.4rem, 3vw, 3rem);
}

.category-child-grid small {
    color: rgb(255 255 255 / 58%);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.category-child-grid a > span:last-child {
    transition: transform 180ms ease;
}

.category-child-grid a:hover > span:last-child,
.category-child-grid a:focus-visible > span:last-child {
    transform: translate(0.35rem, -0.35rem);
}

.category-filters {
    display: flex;
    max-width: 82rem;
    margin: 0 auto 1.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--category-line);
    gap: 0.5rem;
}

.category-filters button {
    padding: 0.85rem 1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #77726b;
    cursor: pointer;
    font: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: none;
    white-space: nowrap;
}

.category-filters button[aria-pressed="true"] {
    border-color: var(--category-ink);
    color: var(--category-ink);
}

.category-product-grid {
    display: grid;
    max-width: 92rem;
    margin-inline: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(2rem, 4vw, 5rem) clamp(1rem, 2.2vw, 2.5rem);
}

.category-product-card[hidden] {
    display: none;
}

.category-product-card {
    position: relative;
    container-type: inline-size;
}

.category-product-card a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.category-product-favorite {
    position: absolute;
    z-index: 2;
    right: 0;
    top: calc(56.25cqi + 1rem);
}

.category-product-copy {
    padding-inline-end: 3.4rem;
}

.category-product-image {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--category-muted);
    place-items: center;
}

.category-product-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 350ms ease, transform 600ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.category-product-image-hover {
    opacity: 0;
}

.category-product-card a:hover .category-product-image-primary,
.category-product-card a:focus-visible .category-product-image-primary {
    opacity: 0;
}

.category-product-card a:hover .category-product-image-hover,
.category-product-card a:focus-visible .category-product-image-hover {
    opacity: 1;
}

.category-product-card a:hover img,
.category-product-card a:focus-visible img {
    transform: scale(1.035);
}

.category-product-placeholder {
    color: #aaa69e;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.25em;
}

.category-product-copy {
    display: block;
    padding-top: 1.25rem;
}

.category-product-copy strong,
.category-product-copy > span,
.category-product-copy small {
    display: block;
}

.category-product-copy strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.15rem, 1.6vw, 1.55rem);
    font-weight: 400;
}

.collection-page .category-product-copy strong {
    font-size: clamp(0.805rem, 1.12vw, 1.085rem);
}

.category-product-copy > span {
    display: -webkit-box;
    margin-top: 0.7rem;
    overflow: hidden;
    color: #706c66;
    font-size: 0.83rem;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-product-copy small {
    margin-top: 1rem;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.category-empty {
    padding: 4rem 1rem;
    border: 1px solid var(--category-line);
    color: #77726b;
    text-align: center;
}

.category-content {
    max-width: 58rem;
    margin-inline: auto;
    text-align: center;
}

.category-content > div {
    margin-top: 2rem;
    color: #5e5a54;
    line-height: 1.9;
    text-align: start;
}

.category-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 4rem clamp(1.25rem, 6vw, 6rem);
    background: var(--category-ink);
    color: #fff;
}

.category-footer p {
    margin: 0;
    color: rgb(255 255 255 / 58%);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

@keyframes category-hero-reveal {
    from { opacity: 0; transform: scale(1.035); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 62rem) {
    .category-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 42rem) {
    .category-hero {
        min-height: 70svh;
    }

    .category-child-grid a {
        grid-template-columns: 1fr auto;
    }

    .category-child-grid small {
        display: none;
    }

    .category-product-grid {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .category-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
