.category-products-page {
    width: min(1400px, calc(100% - 48px));
    min-height: 70vh;
    margin: 0 auto;
    padding: 72px 0 104px;
}

.category-products-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 38px;
}

.category-back { display: block; margin-bottom: 28px; color: #91b9e8; text-decoration: none; }

.category-intro {
    max-width: 920px;
    margin: -6px 0 32px;
    color: #a9bdd4;
    font-size: 1rem;
    line-height: 1.75;
    white-space: pre-line;
}
.category-children { margin: 0 0 32px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: rgba(12,25,44,.72); }
.category-children > strong { display: block; margin-bottom: 12px; }
.category-children > div { display: flex; flex-wrap: wrap; gap: 10px; }
.category-children a { padding: 10px 13px; border: 1px solid rgba(78,161,255,.32); border-radius: 10px; color: #8fc4ff; text-decoration: none; }
.category-children a:hover, .category-children a:focus-visible { border-color: #4ea1ff; color: #fff; }
.category-eyebrow { color: #4ea1ff; font-size: .85rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.category-products-header h1 { margin: 10px 0 12px; font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1; }
.category-products-header p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.category-sort { min-width: 240px; }
.category-sort label { display: block; margin-bottom: 8px; color: #9fc5f8; font-size: .82rem; font-weight: 700; }
.category-sort select {
    width: 100%; padding: 13px 42px 13px 14px; border: 1px solid var(--border); border-radius: 12px;
    background: #0b1729; color: var(--text); font: inherit; cursor: pointer;
}

.category-product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.category-product-card { overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(145deg, rgba(18,31,53,.97), rgba(8,17,32,.97)); }
.category-product-image { display: flex; height: 230px; align-items: center; justify-content: center; padding: 20px; background: #f7f9fc; color: #73839b; text-decoration: none; }
.category-product-image img { width: 100%; height: 100%; object-fit: contain; }
.category-product-body { display: flex; min-height: 235px; flex-direction: column; padding: 22px; }
.category-product-brand { margin-bottom: 8px; color: #4ea1ff; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.category-product-card h2 { margin: 0 0 16px; font-size: 1.15rem; line-height: 1.4; }
.category-product-card h2 a { color: var(--text); text-decoration: none; }
.category-product-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .86rem; }
.category-product-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-top: auto; padding-top: 24px; }
.category-product-footer small { display: block; margin-bottom: 2px; color: var(--muted); }
.category-product-footer strong { font-size: 1.35rem; }
.category-product-footer > a { padding: 10px 13px; border: 1px solid rgba(78,161,255,.38); border-radius: 10px; color: #65adff; font-weight: 800; text-decoration: none; white-space: nowrap; }

.category-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-top: 44px; }
.category-pagination-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.category-pagination-group-end { justify-content: flex-end; }
.category-pagination a, .category-pagination span { display: inline-flex; width: auto; flex: 0 0 auto; align-items: center; justify-content: center; padding: 12px 16px; border: 1px solid var(--border); border-radius: 11px; color: #9fc5f8; text-decoration: none; white-space: nowrap; }
.category-pagination span[aria-disabled="true"] { opacity: .45; }
.category-pagination strong { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.pagination-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px; margin-top: 44px; }
.pagination-footer .category-pagination { display: flex; grid-column: 2; align-items: center; justify-content: center; gap: 8px; margin-top: 0; }
.pagination-footer .category-pagination-group { display: flex; gap: 8px; }
.page-size-selector { display: flex; grid-column: 3; align-items: center; justify-self: end; gap: 10px; }
.page-size-selector label { color: var(--muted); font-size: .84rem; font-weight: 700; white-space: nowrap; }
.page-size-selector select { min-width: 76px; padding: 11px 34px 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: #0b1729; color: var(--text); font: inherit; cursor: pointer; }
.category-products-empty { display: flex; flex-direction: column; gap: 10px; padding: 34px; border: 1px solid var(--border); border-radius: 20px; background: rgba(12,25,44,.92); }
.category-products-empty span { color: var(--muted); }
.category-not-found { margin-top: 40px; }
.category-not-found a { color: #4ea1ff; }

@media (max-width: 1000px) { .category-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .category-products-page { width: min(100% - 24px, 1400px); padding: 28px 0 56px; }
    .category-products-header { align-items: stretch; flex-direction: column; }
    .category-products-header h1 { font-size: clamp(2.25rem, 13vw, 3.4rem); }
    .category-sort { min-width: 0; }
    .category-product-grid { grid-template-columns: 1fr; }
    .category-product-image { height: 190px; padding: 14px; }
    .category-product-body { min-height: 0; padding: 18px; }
    .category-product-card h2,
    .deals-products-page .category-product-card h2,
    .category-products-page:not(.deals-products-page) .category-product-card h2 {
        min-height: 0;
        max-height: none;
        margin-bottom: 12px;
        font-size: 1.05rem;
    }
    .category-product-footer { gap: 12px; padding-top: 18px; }
    .category-product-footer > a.product-card-action { padding-inline: 13px; }
    .category-pagination { grid-template-columns: 1fr 1fr; }
    .category-pagination strong { grid-column: 1 / -1; grid-row: 1; text-align: center; }
    .pagination-footer { grid-template-columns: 1fr; justify-items: center; }
    .pagination-footer .category-pagination { grid-column: 1; flex-wrap: wrap; }
    .pagination-footer .category-pagination strong { order: -1; width: 100%; }
    .page-size-selector { grid-column: 1; justify-self: center; }
}
@media (max-width: 390px) {
    .category-product-footer { align-items: stretch; flex-direction: column; }
    .category-product-footer > a.product-card-action { width: 100%; }
}
/* DealRadar dark product image canvas */
.category-product-image {
    background:
        radial-gradient(circle at 50% 42%, rgba(49, 113, 184, 0.24), transparent 58%),
        linear-gradient(145deg, rgba(15, 31, 53, 0.98), rgba(7, 17, 31, 0.98));
    box-shadow: inset 0 -1px 0 rgba(78, 161, 255, 0.14);
}

/* Deals/category cards: bottom-align price and action */
.category-product-grid {
    align-items: stretch;
}
.category-product-card {
    display: flex;
    height: 100%;
    flex-direction: column;
}
.category-product-body {
    flex: 1 1 auto;
}
.category-product-footer {
    margin-top: auto;
}
/* Deals overview: restore the original light image canvas. */
.deals-products-page .category-product-image {
    background: #f7f9fc;
    box-shadow: none;
}

/* DealRadar product overview white image backgrounds */
/* Product overview image zones use the same white background as the product imagery. */
.category-product-image,
.category-product-image img,
.second-chance-image,
.second-chance-image img {
    background: #f7f9fc !important;
}
/* unified-product-card-actions-v1: consistent filled action button on product cards */
.category-product-footer > a.product-card-action {
    display: inline-flex;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(96, 165, 250, 0.72);
    border-radius: 11px;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
    transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.category-product-footer > a.product-card-action:hover,
.category-product-footer > a.product-card-action:focus-visible {
    background: #3478f3;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
}
/* unified-product-card-actions-cache-repair-v1: force the unified filled CTA after cached/legacy card rules */
.deals-products-page .category-product-footer > a.product-card-action {
    display: inline-flex !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    border: 1px solid rgba(96, 165, 250, 0.72) !important;
    border-radius: 11px !important;
    background: #2563eb !important;
    color: #fff !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20) !important;
}
/* deals-four-column-topdeal-title-wrap-v1: four columns on the Deals overview, with compact responsive fallbacks */
.deals-products-page .category-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1000px) {
    .deals-products-page .category-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .deals-products-page .category-product-grid {
        grid-template-columns: 1fr;
    }
}
/* deals-button-match-retour-v1: Deals card CTA matches the Retour card CTA */
.deals-products-page .category-product-footer > a.product-card-action {
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 16px;
    border-radius: 11px;
    font-size: .84rem;
    font-weight: 800;
    line-height: normal;
}
/* category-product-card-actions-v1: category overview cards use the same filled CTA as Deals and Retour */
.category-products-page:not(.deals-products-page) .category-product-footer > a.product-card-action {
    display: inline-flex;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(96, 165, 250, 0.72);
    border-radius: 11px;
    background: #2563eb;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    line-height: normal;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
}
.category-products-page:not(.deals-products-page) .category-product-footer > a.product-card-action:hover,
.category-products-page:not(.deals-products-page) .category-product-footer > a.product-card-action:focus-visible {
    background: #3478f3;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
}
/* deals-retour-local-search-v1 */
.category-sort input, .second-chance-sort input { min-width: 220px; padding: .7rem .85rem; border: 1px solid var(--border-color, #24456d); border-radius: .6rem; background: var(--surface-color, #0b1729); color: inherit; }


.category-sort,.second-chance-sort{display:grid;grid-template-columns:minmax(220px,1fr) minmax(190px,230px);gap:14px 18px;align-items:end}.category-sort input,.second-chance-sort input{width:100%;box-sizing:border-box;min-width:0}@media(max-width:780px){.category-sort,.second-chance-sort{grid-template-columns:1fr}}
/* overview-controls-layout-v1 */
/* Keep local search and sorting together as one calm, aligned toolbar. */
.deals-products-page .category-sort,
.second-chance-page .second-chance-sort {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    min-width: min(560px, 100%);
    padding: 14px;
    border: 1px solid rgba(78, 161, 255, .18);
    border-radius: 16px;
    background: rgba(11, 23, 41, .62);
}
.deals-products-page .category-sort > div,
.second-chance-page .second-chance-sort > div {
    min-width: 0;
    flex: 1 1 0;
}
.deals-products-page .category-sort .overview-search,
.second-chance-page .second-chance-sort .overview-search { flex-basis: 230px; }
.deals-products-page .category-sort .overview-sort,
.second-chance-page .second-chance-sort .overview-sort { flex-basis: 230px; }
.deals-products-page .category-sort label,
.second-chance-page .second-chance-sort label {
    margin: 0 0 7px 2px;
    line-height: 1.2;
}
.deals-products-page .category-sort input,
.deals-products-page .category-sort select,
.second-chance-page .second-chance-sort input,
.second-chance-page .second-chance-sort select {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
}
@media (max-width: 780px) {
    .deals-products-page .category-sort,
    .second-chance-page .second-chance-sort {
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }
}
/* deals-controls-match-retour-v1 */
.deals-products-page .category-sort {
    width: min(700px, 100%);
    min-width: 0;
}
/* deals-controls-exact-width-v1 */
.deals-products-page .category-sort {
    flex: 0 0 700px;
    width: 700px;
    max-width: 100%;
    box-sizing: border-box;
}
@media (max-width: 780px) {
    .deals-products-page .category-sort { flex-basis: auto; width: 100%; }

    .deals-products-page .category-sort > .overview-search,
    .deals-products-page .category-sort > .overview-sort {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
    }
}

/* deals-card-content-alignment-v1: reserve equal brand and two-line title space */
.deals-products-page .category-product-brand {
    min-height: 1em;
    line-height: 1;
}

.deals-products-page .category-product-card h2 {
    min-height: 2.8em;
    max-height: 2.8em;
    overflow: hidden;
    line-height: 1.4;
}

.deals-products-page .category-product-meta {
    min-height: 1.25em;
    align-items: flex-start;
}

.deals-products-page .category-product-footer strong {
    white-space: nowrap;
}

/* category-card-content-alignment-v1: match Deals with fixed brand, title and store rows */
.category-products-page:not(.deals-products-page) .category-product-brand {
    min-height: 1em;
    line-height: 1;
}

.category-products-page:not(.deals-products-page) .category-product-card h2 {
    min-height: 2.8em;
    max-height: 2.8em;
    overflow: hidden;
    line-height: 1.4;
}

.category-products-page:not(.deals-products-page) .category-product-meta {
    min-height: 1.25em;
    align-items: flex-start;
}

.category-products-page:not(.deals-products-page) .category-product-footer strong {
    white-space: nowrap;
}
