/* Portal category pages (Controls/catalogp.ascx): category tiles and section headers.
   Each portal can adapt them in its mio.css by setting these variables on :root:
   --pcat-ink, --pcat-muted, --pcat-line, --pcat-media-bg, --pcat-accent, --pcat-font. */

.pcat-explore {
    margin: 8px 0 48px;
    font-family: var(--pcat-font, inherit);
}

.pcat-explore-title {
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pcat-muted, #6b6b6b);
}

.pcat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 28px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pcat-tile a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--pcat-ink, #1f1f1f);
    text-decoration: none;
}

.pcat-tile a:hover,
.pcat-tile a:focus {
    color: var(--pcat-ink, #1f1f1f);
    text-decoration: none;
}

.pcat-tile-media {
    display: block;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--pcat-line, #e4e4e0);
    background: var(--pcat-media-bg, #fff);
    transition: border-color .2s ease;
}

.pcat-tile a:hover .pcat-tile-media {
    border-color: var(--pcat-ink, #1f1f1f);
}

.pcat-tile-media img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 12%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform .35s ease;
}

.pcat-tile a:hover .pcat-tile-media img {
    transform: scale(1.05);
}

/* Images configured in images/categorie/ are designed for the tile: fill it edge to edge. */
.pcat-tile-media-custom img {
    padding: 0;
    object-fit: cover;
    mix-blend-mode: normal;
}

.pcat-tile-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.pcat-tile a:hover .pcat-tile-name {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pcat-tile-count {
    font-size: 13px;
    color: var(--pcat-muted, #6b6b6b);
}

.pcat-tile a:focus-visible,
.pcat-head-link:focus-visible {
    outline: 2px solid var(--pcat-accent, #1b2a4a);
    outline-offset: 4px;
}

/* Section header above each group of products. */
.pcat-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pcat-line, #e4e4e0);
    font-family: var(--pcat-font, inherit);
}

.pcat-head-title {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--pcat-ink, #1f1f1f);
}

.pcat-head-count {
    font-size: 13px;
    color: var(--pcat-muted, #6b6b6b);
}

a.progroup.pcat-head-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pcat-accent, #1b2a4a);
    text-decoration: none;
    white-space: nowrap;
}

a.progroup.pcat-head-link:hover {
    color: var(--pcat-accent, #1b2a4a);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 575.98px) {
    .pcat-explore { margin-bottom: 32px; }
    .pcat-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 14px;
    }
    .pcat-tile-name { font-size: 14px; }
    .pcat-head { margin-top: 28px; }
    .pcat-head-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .pcat-tile-media img { transition: none; }
    .pcat-tile a:hover .pcat-tile-media img { transform: none; }
}

/* Filters at the bottom of the left column: price slider and brands (Scripts/portal-filters.js). */
.pcat-filter {
    clear: both;
    padding: 24px 22px 28px;
    border-top: 1px solid var(--pcat-line, #e4e4e0);
    font-family: var(--pcat-font, inherit);
}

.pcat-filter[hidden] { display: none; }

.pcat-price {
    --pcat-from: 0%;
    --pcat-to: 100%;
}

.pcat-filter-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pcat-muted, #6b6b6b);
}

.pcat-price-values {
    margin: 0 0 14px;
    font-size: 15px;
    color: var(--pcat-ink, #1f1f1f);
}

.pcat-price-slider {
    position: relative;
    height: 24px;
}

/* Track: grey line with the selected interval highlighted. */
.pcat-price-slider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(to right,
        var(--pcat-line, #e4e4e0) var(--pcat-from),
        var(--pcat-accent, #1b2a4a) var(--pcat-from),
        var(--pcat-accent, #1b2a4a) var(--pcat-to),
        var(--pcat-line, #e4e4e0) var(--pcat-to));
}

.pcat-price-slider input[type=range] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.pcat-price-slider input[type=range]::-webkit-slider-runnable-track { background: none; border: 0; }
.pcat-price-slider input[type=range]::-moz-range-track { background: none; border: 0; }

.pcat-price-slider input[type=range]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border: 2px solid var(--pcat-accent, #1b2a4a);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
}

.pcat-price-slider input[type=range]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 2px solid var(--pcat-accent, #1b2a4a);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.pcat-price-slider input[type=range]:focus-visible { outline: none; }
.pcat-price-slider input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(27, 42, 74, .25); }
.pcat-price-slider input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(27, 42, 74, .25); }

.pcat-filter-reset {
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pcat-accent, #1b2a4a);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.pcat-filter-reset[hidden] { display: none; }

/* Brand checkboxes: long lists scroll inside the column. */
.pcat-brand-list {
    max-height: 280px;
    margin: 6px 0 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.pcat-brand-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 400;
    color: var(--pcat-ink, #1f1f1f);
    cursor: pointer;
}

.pcat-brand-list input[type=checkbox] {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--pcat-accent, #1b2a4a);
    cursor: pointer;
}

.pcat-brand-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pcat-brand-count {
    font-size: 12px;
    color: var(--pcat-muted, #6b6b6b);
}

