/* =========================================================
   Category Listing
   ========================================================= */

.category-page {
    padding: 34px 0 96px;
    background: #ffffff;
}


/* =========================================================
   Breadcrumb
   ========================================================= */

.category-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 40px;
    color: #8a867f;
    font-size: 0.8125rem;
}

.category-breadcrumb__link {
    color: #6f6b65;
    text-decoration: none;
    transition: color 150ms ease;
}

.category-breadcrumb__link:hover {
    color: #252421;
}

.category-breadcrumb__separator {
    color: #c2beb7;
}

.category-breadcrumb__current {
    min-width: 0;
    overflow: hidden;
    color: #9a968f;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   Category Header
   ========================================================= */

.category-page__header {
    max-width: 720px;
    margin-bottom: 34px;
}

.category-page__title {
    margin: 0;
    color: #20201e;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.category-page__description {
    max-width: 640px;
    margin: 16px 0 0;
    color: #74716b;
    font-size: 0.9375rem;
    line-height: 1.7;
}


/* =========================================================
   Child Categories
   ========================================================= */

.category-children {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 52px;
}

.category-children__item {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px 9px 16px;
    border: 1px solid #dfdcd6;
    border-radius: 999px;
    background: #ffffff;
    color: #393733;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition:
        border-color 150ms ease,
        background-color 150ms ease,
        color 150ms ease;
}

.category-children__item svg {
    width: 15px;
    height: 15px;
    color: #8c8881;
    transition: transform 150ms ease;
}

.category-children__item:hover {
    border-color: #bcb8b0;
    background: #f8f7f4;
    color: #20201e;
}

.category-children__item:hover svg {
    transform: translateX(2px);
}


/* =========================================================
   Results Header
   ========================================================= */

.category-results {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ebe8e3;
}

.category-results__title {
    margin: 0;
    color: #292825;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.category-results__count {
    flex-shrink: 0;
    color: #8a867f;
    font-size: 0.8125rem;
}


/* =========================================================
   Product Grid
   ========================================================= */

.category-page .product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px 20px;
}


/* =========================================================
   Empty State
   ========================================================= */

.category-empty {
    min-height: 280px;
    display: grid;
    place-items: center;
    padding: 60px 20px;
    border-bottom: 1px solid #ebe8e3;
    text-align: center;
}

.category-empty p {
    margin: 0;
    color: #77736d;
    font-size: 0.9375rem;
}


/* =========================================================
   Pagination
   ========================================================= */

.category-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid #ebe8e3;
}

.category-pagination__side {
    display: flex;
    justify-content: flex-start;
}

.category-pagination__side--end {
    justify-content: flex-end;
}

.category-pagination__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    color: #393733;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.category-pagination__link svg {
    width: 17px;
    height: 17px;
    transition: transform 150ms ease;
}

.category-pagination__side:first-child
.category-pagination__link:hover svg {
    transform: translateX(-2px);
}

.category-pagination__side--end
.category-pagination__link:hover svg {
    transform: translateX(2px);
}

.category-pagination__status {
    color: #8a867f;
    font-size: 0.8125rem;
    text-align: center;
}


/* =========================================================
   Focus
   ========================================================= */

.category-page a:focus-visible {
    outline: 3px solid rgba(93, 102, 81, 0.2);
    outline-offset: 3px;
}


/* =========================================================
   Responsive
   ========================================================= */

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

@media (max-width: 720px) {
    .category-page {
        padding: 24px 0 88px;
    }

    .category-breadcrumb {
        margin-bottom: 30px;
    }

    .category-page__header {
        margin-bottom: 28px;
    }

    .category-page__title {
        font-size: 2.25rem;
    }

    .category-page__description {
        margin-top: 12px;
    }

    .category-children {
        flex-wrap: nowrap;
        gap: 8px;
        margin-right: -14px;
        margin-bottom: 40px;
        padding-right: 14px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .category-children::-webkit-scrollbar {
        display: none;
    }

    .category-children__item {
        flex: 0 0 auto;
    }

    .category-results {
        margin-bottom: 20px;
    }

    .category-page .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 12px;
    }

    .category-pagination {
        margin-top: 48px;
    }
}

@media (max-width: 420px) {
    .category-page__title {
        font-size: 2rem;
    }

    .category-pagination {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .category-pagination__status {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .category-pagination__side {
        grid-row: 2;
    }
}