/* Category catalog: scoped to keep homepage and search product grids intact. */
.category-catalog .catalog-filter-form { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; gap: 12px; margin: 0; }
.category-catalog .catalog-sidebar { padding: 16px; background: #fff; border: 1px solid #e6e6e6; border-radius: 4px; }
.catalog-filter-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.catalog-filter-heading strong { font-size: 18px; color: #111; }
.category-catalog .catalog-reset { min-height: 32px; margin: 0; padding: 0; border: 0; background: none; color: #777; font-size: 12px; font-weight: 400; line-height: 1.4; text-transform: none; letter-spacing: normal; box-shadow: none; }
.category-catalog .catalog-reset:hover { color: #C9252C; }
.catalog-filter-group { padding-top: 14px; }
.catalog-filter-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; color: #111; }
.catalog-filter-group summary::-webkit-details-marker { display: none; }
.catalog-filter-group summary::after { content: ''; width: 6px; height: 6px; border-right: 1px solid #999; border-bottom: 1px solid #999; transform: rotate(45deg); margin-right: 3px; }
.catalog-filter-group:not([open]) summary::after { transform: rotate(-45deg); }
.catalog-filter-options { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; max-height: 280px; overflow-y: auto; }
.catalog-filter-options label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 400; color: #333; cursor: pointer; line-height: 1.5; }
.category-catalog .catalog-filter-options input[type="checkbox"],
.category-catalog .catalog-filter-options input[type="radio"] { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: #C9252C; }
.catalog-main { min-width: 0; }
.catalog-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.catalog-sort-title { font-size: 14px; font-weight: 600; }
.catalog-sort-options { display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-sort-options label { position: relative; margin: 0; cursor: pointer; font-weight: 400; }
.catalog-sort-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.catalog-sort-options span { display: block; padding: 8px 12px; border: 1px solid #ddd; background: #fff; border-radius: 3px; color: #444; font-size: 13px; line-height: 1.5; }
.catalog-sort-options input:checked + span { border-color: #C9252C; color: #C9252C; background: #fff5f5; }
.catalog-sort-options input:focus-visible + span, .category-catalog button:focus-visible, .catalog-filter-group summary:focus-visible { outline: 2px solid #C9252C; outline-offset: 3px; }
.catalog-result-count { margin: 0 0 16px; color: #777; font-size: 13px; }
.category-catalog #product-results .catalog-products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.category-catalog .catalog-products > .product { width: 100%; max-width: none; min-width: 0; padding: 0; margin: 0; flex-basis: auto; }
.category-catalog #product-results[aria-busy="true"] .catalog-products { opacity: .5; pointer-events: none; }
.category-catalog [hidden] { display: none !important; }
.catalog-empty, .catalog-error { padding: 24px; margin: 0; border: 1px solid #e6e6e6; border-radius: 4px; background: #fff; }
.catalog-error { color: #C9252C; margin-bottom: 16px; }
.category-catalog .catalog-mobile-toggle { display: none; }
@media (max-width: 1199px) {
    .category-catalog #product-results .catalog-products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 849px) {
    .category-catalog .catalog-filter-form { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .category-catalog .catalog-sidebar { display: none; }
    .category-catalog .filters-open .catalog-sidebar { display: block; }
    .category-catalog .catalog-mobile-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; color: #111; font-size: 14px; line-height: 1.5; text-transform: none; }
    .catalog-filter-options { max-height: 200px; }
    .category-catalog #product-results .catalog-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .catalog-toolbar { gap: 8px; }
    .catalog-sort-options { gap: 6px; }
    .catalog-sort-options span { padding: 7px 9px; font-size: 12px; }
}
/* Keep card actions and rating order consistent with the category design. */
.catalog-filter-options .catalog-brand-logo { display: block; width: auto; max-width: 110px; height: 30px; object-fit: contain; object-position: left center; }
.catalog-filter-options .catalog-category-link { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: #333; line-height: 1.5; }
.catalog-category-marker { flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid #aaa; border-radius: 50%; background: #fff; }
.catalog-category-link:hover, .catalog-category-link:focus-visible { color: #C9252C; }
.catalog-category-link:hover .catalog-category-marker, .catalog-category-link:focus-visible .catalog-category-marker { border-color: #C9252C; }
.catalog-category-link:focus-visible { outline: 2px solid #C9252C; outline-offset: 3px; }

/* Mobile filter drawer uses the same sidebar and filter state as desktop. */
.catalog-mobile-title, .catalog-quick-search, .catalog-drawer-footer { display: none; }
.category-catalog .catalog-drawer-close { display: none; }
@media (max-width: 849px) {
    body.catalog-drawer-open { overflow: hidden; }
    .category-catalog .catalog-filter-backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(0, 0, 0, .6); }
    .category-catalog .filters-open .catalog-sidebar {
        display: block;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1501;
        width: min(calc(100vw - 44px), 400px);
        height: 100vh;
        height: 100dvh;
        padding: 20px 16px 0;
        border: 0;
        border-radius: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: 4px 0 16px rgba(0, 0, 0, .1);
    }
    .category-catalog .catalog-drawer-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 8px;
        right: 6px;
        z-index: 1502;
        width: 36px;
        min-width: 0;
        height: 40px;
        min-height: 0;
        margin: 0;
        padding: 6px;
        border: 0;
        background: transparent;
        box-shadow: none;
        color: #fff;
    }
    .catalog-drawer-close svg { width: 28px; height: 28px; }
    .catalog-mobile-title { display: inline; }
    .catalog-filter-heading { flex-wrap: wrap; padding-bottom: 12px; }
    .catalog-filter-heading strong { font-size: 20px; line-height: 1.4; }
    .catalog-filter-group { padding-top: 16px; }
    .catalog-filter-group summary { font-size: 16px; }
    .catalog-sidebar .catalog-filter-options { max-height: none; gap: 6px; padding-top: 8px; overflow: visible; }
    .catalog-filter-options label, .catalog-filter-options .catalog-category-link { min-height: 28px; gap: 6px; }
    .catalog-filter-group--brand .catalog-filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .catalog-filter-group--brand .catalog-filter-options label { min-width: 0; min-height: 36px; }
    .catalog-filter-group--brand .catalog-filter-options label > span { min-width: 0; overflow-wrap: anywhere; }
    .catalog-filter-options .catalog-brand-logo { width: 100%; max-width: 110px; height: 34px; }
    .catalog-quick-search { display: block; position: relative; margin: 10px 0 0; }
    .catalog-quick-search svg { position: absolute; left: 12px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: #888; pointer-events: none; }
    .catalog-quick-search input[type="search"] { width: 100%; height: 42px; margin: 0; padding: 8px 12px 8px 40px; border: 1px solid #ddd; border-radius: 4px; background: #fff; box-shadow: none; font-size: 14px; font-weight: 400; }
    .catalog-search-empty { margin: 10px 0 0; color: #777; font-size: 13px; }
    .catalog-drawer-footer { display: block; position: sticky; bottom: 0; z-index: 1; margin-top: 16px; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #eee; }
    .category-catalog .catalog-drawer-apply { width: 100%; margin: 0; padding: 10px; border: 1px solid #C9252C; border-radius: 4px; background: #C9252C; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.5; text-transform: none; }
}
