/**
 * SOLVA - Products Page
 * Minimal / Swiss direction, see design-system/solva/MASTER.md
 */
.pp-head, .pp-catalog, .pp-cta {
    --ink: #0f172a;
    --brand: #1d1d35;
    --muted: #475569;
    --line: #e3e6ec;
    --line-strong: #c9ced8;
    --surface: #ffffff;
    --canvas: #f6f7f9;
    --focus: #2563eb;
}
.pp-catalog [hidden] { display: none !important; }

/* ---------- Page header (text + real installation photos) ---------- */
.pp-head {
    padding: calc(var(--header-height) + 2.5rem) 0 0;
    background: var(--brand);
    color: #fff;
    overflow: hidden;
}
.pp-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: end; }
.pp-head-text { padding-bottom: 2.75rem; }
.pp-head h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.2; margin: 0 0 .9rem; }
.pp-head-lead { color: rgba(255, 255, 255, .8); font-size: 1.05rem; line-height: 1.85; margin: 0; max-width: 520px; }
.pp-head-link {
    display: inline-block; margin-top: 1.25rem;
    color: #fff; font-weight: 600; font-size: .95rem;
    text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(255, 255, 255, .4);
    transition: text-decoration-color .15s ease;
}
.pp-head-link:hover { color: #fff; text-decoration-color: #fff; }

.pp-head-photos {
    position: relative; margin: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem;
    align-items: end;
}
.pp-photo {
    width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
    border-radius: 10px 10px 0 0;
    background: rgba(255, 255, 255, .06);
}
.pp-photo-1 { height: 300px; }
.pp-photo-2 { height: 250px; }
.pp-photo-3 { height: 210px; }
.pp-head-photos figcaption {
    position: absolute; top: .6rem; inset-inline-end: 0;
    font-size: .78rem; color: rgba(255, 255, 255, .6);
}

/* ---------- Buttons ---------- */
.pp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    height: 44px; padding: 0 1.15rem; border-radius: 8px;
    font-family: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pp-btn-primary { background: var(--brand); color: #fff; }
.pp-btn-primary:hover { background: #2b2b4d; color: #fff; }
.pp-btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.pp-btn-secondary:hover { border-color: var(--ink); color: var(--ink); }
.pp-btn-wa { background: #1fa855; color: #fff; }
.pp-btn-wa:hover { background: #188a46; color: #fff; }

/* ---------- Filter panel ---------- */
.pp-catalog { padding-top: 2rem; background: var(--canvas); }
.pp-filters {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: grid; gap: .9rem;
}
.pp-filter-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; align-items: start; }
.pp-filter-label { font-size: .85rem; font-weight: 700; color: var(--muted); padding-top: .55rem; }

.pp-cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.pp-cat {
    display: inline-flex; align-items: center; gap: .45rem;
    height: 36px; padding: 0 .85rem; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    font-family: inherit; font-size: .9rem; font-weight: 600; color: var(--ink);
    cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.pp-cat:hover { border-color: var(--line-strong); }
.pp-cat-count { font-size: .78rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-cat.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pp-cat.is-active .pp-cat-count { color: rgba(255, 255, 255, .75); }

.pp-brands-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .4rem; }
.pp-brand {
    position: relative;
    height: 52px; padding: 0 .75rem;
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; color: var(--ink); cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pp-brand:hover { border-color: var(--line-strong); }
.pp-brand img { max-width: 100%; max-height: 24px; object-fit: contain; }
.pp-brand-text { font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pp-brand-count {
    position: absolute; top: 3px; inset-inline-end: 5px;
    font-size: .68rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pp-brand.is-active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.pp-brand-all.is-active { background: var(--brand); color: #fff; }
.pp-brand-all.is-active .pp-brand-count { color: rgba(255, 255, 255, .75); }

/* ---------- Search + sort ---------- */
.pp-toolbar { display: flex; gap: .5rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.pp-search { position: relative; flex: 1; min-width: 0; }
.pp-search > i { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.pp-search input, .pp-select select {
    width: 100%; height: 44px;
    border: 1px solid var(--line-strong); border-radius: 8px;
    background: var(--surface); color: var(--ink);
    font-family: inherit; font-size: .95rem;
}
.pp-search input { padding-inline: 38px 40px; }
.pp-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.pp-select { flex: none; margin: 0; }
.pp-select select { min-width: 170px; padding-inline: 12px; font-weight: 600; cursor: pointer; }
.pp-search input:focus-visible, .pp-select select:focus-visible,
.pp-cat:focus-visible, .pp-brand:focus-visible, .pp-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pp-search-clear {
    position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; border-radius: 6px;
    background: transparent; color: var(--muted); cursor: pointer;
}
.pp-search-clear:hover { background: var(--canvas); color: var(--ink); }

.pp-status { display: flex; justify-content: space-between; align-items: center; min-height: 40px; margin: 1.25rem 0 .75rem; color: var(--muted); font-size: .92rem; }
.pp-status strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.pp-reset {
    border: 0; background: none; padding: .35rem .25rem;
    color: var(--ink); font-family: inherit; font-weight: 600; font-size: .9rem;
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* ---------- Product grid ---------- */
.pp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.pp-grid[hidden] { display: none; }
.pcard {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s ease;
}
.pcard[hidden] { display: none; }
.pcard:hover { border-color: var(--line-strong); }
.pcard-media { position: relative; display: block; aspect-ratio: 1 / 1; background: #fff; border-bottom: 1px solid var(--line); }
.pcard-media { overflow: hidden; }
.pcard-media img { position: absolute; inset: 10%; width: 80%; height: 80%; object-fit: contain; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.pcard:hover .pcard-media img { transform: scale(1.05); }

.pcard-body { display: flex; flex-direction: column; flex: 1; padding: .9rem 1rem 1rem; min-width: 0; }
.pcard-meta { margin: 0 0 .3rem; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-title { font-size: .98rem; line-height: 1.55; margin: 0; font-weight: 700; }
.pcard-title a {
    color: var(--ink); text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere;
}
/* the whole card opens the product */
.pcard-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pcard:hover .pcard-title a { text-decoration: underline; text-underline-offset: 3px; }
.pcard-price { margin: .5rem 0 0; font-size: 1.1rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pcard-stock { margin: .5rem 0 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.pcard-stock.is-in { color: #15803d; }
.pcard-stock.is-in::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; margin-inline-end: .4rem; vertical-align: 1px; }
.pcard-actions { margin-top: auto; padding-top: .85rem; position: relative; z-index: 2; }

.cart-add-pcard {
    width: 100%; height: 40px; padding: 0 .75rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    border-radius: 8px; border: 1px solid var(--brand);
    background: var(--brand); color: #fff;
    font-size: .9rem; font-weight: 700;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.cart-add-pcard:hover { background: #2b2b4d; }
.cart-add-pcard.is-in-cart { background: #fff; color: #15803d; border-color: #86c9a0; }
.cart-add-pcard .cart-add-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-add-pcard:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.pp-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.pp-empty h3 { color: var(--ink); font-size: 1.15rem; margin-bottom: .5rem; }
.pp-empty p { max-width: 440px; margin: 0 auto 1.25rem; line-height: 1.8; }

/* ---------- Bottom CTA ---------- */
.pp-cta { padding: 0 0 4rem; background: var(--canvas); }
.pp-cta-box {
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    padding: 1.5rem 1.75rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.pp-cta-box h2 { font-size: 1.2rem; margin: 0 0 .3rem; color: var(--ink); }
.pp-cta-box p { margin: 0; color: var(--muted); }
.pp-cta-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Dark mode ---------- */
body.dark-mode .pp-catalog, body.dark-mode .pp-cta { --ink: #e2e8f0; --muted: #94a3b8; --line: rgba(255, 255, 255, .1); --line-strong: rgba(255, 255, 255, .22); --surface: #0b1222; --canvas: #070c18; }
body.dark-mode .pcard-media { background: #fff; }
body.dark-mode .pp-brand { background: #fff; }
body.dark-mode .pp-brand-text, body.dark-mode .pp-brand-count { color: #1d1d35; }
body.dark-mode .pp-brand-all { background: var(--surface); }
body.dark-mode .pp-brand-all .pp-brand-text, body.dark-mode .pp-brand-all .pp-brand-count { color: var(--ink); }
body.dark-mode .pp-cat.is-active, body.dark-mode .pp-brand-all.is-active { background: #e2e8f0; border-color: #e2e8f0; color: #0b1222; }
body.dark-mode .pp-brand-all.is-active .pp-brand-text, body.dark-mode .pp-brand-all.is-active .pp-brand-count, body.dark-mode .pp-cat.is-active .pp-cat-count { color: #0b1222; }
body.dark-mode .cart-add-pcard:not(.is-in-cart) { background: #e2e8f0; border-color: #e2e8f0; color: #0b1222; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .pp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .pp-head-grid { grid-template-columns: 1fr; gap: 0; }
    .pp-head-text { padding-bottom: 1.5rem; }
    .pp-photo-1 { height: 190px; } .pp-photo-2 { height: 160px; } .pp-photo-3 { height: 135px; }
    .pp-head-photos figcaption { display: none; }
}
@media (max-width: 768px) {
    .pp-head { padding: calc(var(--header-height) + 1.5rem) 0 0; }
    .pp-catalog { padding-top: 1rem; }
    .pp-filters { padding: .85rem; border-radius: 10px; gap: .75rem; }
    .pp-filter-row { grid-template-columns: 1fr; gap: .4rem; }
    .pp-filter-label { padding-top: 0; }
    /* rows scroll sideways on phones instead of stacking many lines */
    .pp-cats, .pp-brands-track {
        display: flex; flex-wrap: nowrap; overflow-x: auto;
        margin-inline: -.85rem; padding-inline: .85rem; padding-bottom: .2rem;
        scrollbar-width: none; scroll-snap-type: x proximity;
    }
    .pp-cats::-webkit-scrollbar, .pp-brands-track::-webkit-scrollbar { display: none; }
    .pp-cat { flex: none; scroll-snap-align: start; }
    .pp-brand { flex: 0 0 104px; scroll-snap-align: start; }
    .pp-toolbar { flex-wrap: wrap; }
    .pp-search { flex: 1 1 100%; }
    .pp-search input, .pp-select select { font-size: 16px; }
    .pp-select { flex: 1 1 100%; }
    .pp-select select { min-width: 0; }

    .pp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .pcard-body { padding: .7rem .7rem .75rem; }
    .pcard-meta { font-size: .72rem; }
    .pcard-title { font-size: .86rem; }
    .pcard-price { font-size: .98rem; }
    .pcard-stock { font-size: .78rem; }
    .cart-add-pcard { height: 38px; font-size: .8rem; gap: .3rem; padding: 0 .4rem; }

    .pp-cta-box { padding: 1.15rem; }
    .pp-cta-actions, .pp-cta-actions .pp-btn { width: 100%; }
}
@media (max-width: 360px) {
    .cart-add-pcard .cart-add-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pcard, .pp-cat, .pp-brand, .pp-btn, .cart-add-pcard, .pcard-media img { transition: none; }
    .pcard:hover .pcard-media img { transform: none; }
}
