.catalogue-page { padding: 24px 0 40px; }

.cat-hero {
    display: flex; justify-content: space-between; align-items: end;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.cat-hero h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.5px; }
.cat-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.pill {
    display: inline-block; padding: 6px 12px; border-radius: var(--radius-pill);
    background: var(--primary-soft); color: var(--primary-dark);
    font-size: 12.5px; font-weight: 700;
}

/* Toolbar Layout */
.cat-toolbar {
    display: flex; gap: 12px; flex-wrap: wrap;
    align-items: center; margin-bottom: 16px;
}
.cat-search {
    flex: 1 1 300px; display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-pill); padding: 0 14px; height: 44px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cat-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,168,107,.12); }
.cat-search i { color: var(--muted); }
.cat-search input { flex: 1; border: none; outline: none; background: transparent; height: 100%; font-size: 14px; }
.search-clear {
    border: none; background: transparent; color: var(--muted);
    width: 26px; height: 26px; border-radius: 50%; display: none;
}
.search-clear.show { display: inline-flex; align-items: center; justify-content: center; }
.search-clear:hover { background: var(--bg); color: var(--ink); }

/* Filter Buttons (Side-by-side) */
.cat-filters { 
    display: flex; gap: 10px; flex: 1 1 auto; 
}
.filter-group {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-pill);
    padding: 0 14px; height: 44px; cursor: pointer;
}
.filter-group:focus-within { border-color: var(--primary); }
.filter-group i { color: var(--primary); font-size: 13px; }
.filter-group select {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 13px; font-weight: 600; color: var(--ink-2);
    appearance: none; cursor: pointer;
    /* Custom arrow */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b7280' d='M1 1l4 4 4-4'/></svg>");
    background-repeat: no-repeat; background-position: right center;
    padding-right: 16px;
}

/* Horizontal Scrolling Categories */
.cat-chips-wrap {
    width: 100%; overflow-x: auto; white-space: nowrap;
    scrollbar-width: none; margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}
.cat-chips-wrap::-webkit-scrollbar { display: none; }

.cat-chips { display: flex; gap: 8px; padding-bottom: 4px; }
.chip {
    padding: 8px 16px; border-radius: var(--radius-pill);
    background: #fff; border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--ink-2);
    transition: all .15s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Empty State */
.cat-empty {
    text-align: center; padding: 60px 20px;
    background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line);
}
.cat-empty i { font-size: 44px; color: var(--line); margin-bottom: 12px; }
.cat-empty h3 { margin: 0 0 6px; font-size: 18px; }
.cat-empty p { color: var(--muted); margin: 0 0 16px; }

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .cat-hero h1 { font-size: 22px; }
    .cat-toolbar { flex-direction: column; gap: 10px; }
    .cat-search { flex: 1 1 100%; width: 100%; }
    .cat-filters { width: 100%; flex-wrap: nowrap; }
    .filter-group { height: 40px; padding: 0 10px; }
    .filter-group select { font-size: 12px; }
}
/* Recommended Section */
.recommended-wrap {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--line);
}

/* =========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================= */

/* Tell the browser to skip rendering off-screen product cards */
.product-card {
    content-visibility: auto;
    contain-intrinsic-size: 300px; /* Placeholder height so scrollbar doesn't jump */
}

/* Improve image loading */
.product-card img {
    loading: lazy;
    decoding: async; /* Doesn't block the main thread */
}