/*
 * productsearch.css – Produktsuche (detailsuche)
 * Same palette and controls as the Mein-Ihof profile page; everything scoped under .ps
 */

.ps {
    --ps-green: #0d5842;
    --ps-green-2: #11644d;
    --ps-green-light: #e8f5f1;
    --ps-green-line: #b2d8cc;
    --ps-accent: #00a67e;
    --ps-text: #2c3e50;
    --ps-muted: #6c757d;
    --ps-border: #e0e0e0;
    --ps-line: #3d4a52;  /* outline of pills/controls, like the header search + buttons */
    --ps-bg: #f8f9fa;
    --ps-white: #ffffff;
    --ps-shadow: 0 0.125em 0.5em rgba(13, 88, 66, 0.08);
    --ps-shadow-hover: 0 0.375em 1.25em rgba(13, 88, 66, 0.14);

    color: var(--ps-text);
    font-size: 16px;
    padding: 1.25em 0 3em;
}

.ps *,
.ps *::before,
.ps *::after {
    box-sizing: border-box;
}

/* elements toggled with the hidden attribute must stay hidden even if a rule sets display */
.ps [hidden] {
    display: none !important;
}

.ps-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ps :focus-visible {
    outline: 0.1875em solid var(--ps-accent);
    outline-offset: 0.125em;
}

/* ==================== Page head with the compact search box ==================== */
.ps-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.875em 2em;
    padding-bottom: 1em;
    margin-bottom: 1.5em;
    border-bottom: 0.1875em solid var(--ps-green-light);
}

.ps-title {
    margin: 0;
    font-size: 1.75em;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ps-green);
}

.ps-subtitle {
    margin: 0.25em 0 0;
    font-size: 0.9375em;
    color: var(--ps-muted);
}

/* filter inside the results: deliberately NOT a second search box (no pill outline, no green button) */
.ps-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0 0.75em;
    height: 2.25em;
    background: var(--ps-bg);
    border: 0.0625em solid transparent;
    border-radius: 0.5em;
    color: var(--ps-muted);
    font-size: 0.875em;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ps-filter:focus-within {
    background: var(--ps-white);
    border-color: var(--ps-green);
}

.ps-filter i {
    font-size: 0.8125em;
}

.ps-filter input {
    width: 12em;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--ps-text);
    padding: 0;
}

.ps-filter input:focus {
    outline: none;
}

.ps-filter input::placeholder {
    color: rgba(44, 62, 80, 0.45);
}

/* ==================== Layout ==================== */
.ps-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5em;
    align-items: start;
}

.ps-layout.has-sidebar {
    grid-template-columns: 14em minmax(0, 1fr);
    column-gap: 1.25em;
}

.ps-main {
    min-width: 0;
}

/* ==================== Sidebar suggestions ==================== */
.ps-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    position: sticky;
    top: 9em;
}

.ps .ps-facet {
    margin: 0;          /* the site styles <section> with its own padding/margins: not wanted here */
    padding: 0;
    min-height: 0;
}

.ps-facet {
    background: var(--ps-white);
    border: 0.0625em solid var(--ps-border);
    border-radius: 0.75em;
    overflow: hidden;
}

.ps-facet-title {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin: 0;
    padding: 0.625em 0.875em;
    font-size: 0.875em;
    font-weight: 700;
    color: var(--ps-green);
    background: var(--ps-green-light);
    border-bottom: 0.0625em solid var(--ps-border);
}

.ps-facet-list {
    list-style: none;
    margin: 0;
    padding: 0.375em 0;
    max-height: 18em;
    overflow-y: auto;
}

.ps-facet-list a {
    display: block;
    padding: 0.375em 0.875em;
    font-size: 0.875em;
    color: var(--ps-text);
    text-decoration: none;
    border-left: 0.1875em solid transparent;
    overflow-wrap: anywhere;
}

.ps-facet-list a:hover {
    background: var(--ps-green-light);
    border-left-color: var(--ps-green);
    color: var(--ps-green);
}

/* ==================== Toolbar ==================== */
.ps-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.875em;
    margin-bottom: 1.25em;
}

.ps-count {
    margin: 0;
    font-size: 1.125em;
    color: var(--ps-text);
}

.ps-count strong {
    color: var(--ps-green);
}

.ps-count-filter {
    font-size: 0.8125em;
    color: var(--ps-muted);
}

.ps-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
    flex-wrap: wrap;
}

.ps-chips {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
}

.ps-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375em;
    padding: 0.4375em 0.875em;
    border: 0.0625em solid var(--ps-line);
    border-radius: 2em;
    background: var(--ps-white);
    color: var(--ps-text);
    font: inherit;
    font-size: 0.8125em;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.ps-chip:hover {
    border-color: var(--ps-green);
    color: var(--ps-green);
}

.ps-chip[aria-pressed="true"] {
    background: var(--ps-green);
    border-color: var(--ps-green);
    color: var(--ps-white);
}

.ps-chip-count {
    font-weight: 400;
    opacity: 0.75;
}

.ps-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.625em;
}

.ps-sort select {
    font: inherit;
    font-size: 0.875em;
    padding: 0.4375em 2.25em 0.4375em 1em;
    border: 0.0625em solid var(--ps-line);
    border-radius: 2em;
    background-color: var(--ps-white);
    color: var(--ps-text);
    cursor: pointer;
}

.ps-viewtoggle {
    display: inline-flex;
    border: 0.0625em solid var(--ps-line);
    border-radius: 2em;
    overflow: hidden;
}

.ps-viewtoggle button {
    border: 0;
    background: var(--ps-white);
    color: var(--ps-muted);
    padding: 0.4375em 0.875em;
    cursor: pointer;
    font-size: 0.875em;
}

.ps-viewtoggle button[aria-pressed="true"] {
    background: var(--ps-green-light);
    color: var(--ps-green);
}

.ps-notice {
    margin: 0;
    font-size: 0.8125em;
    color: var(--ps-muted);
}

.ps-notice::before {
    content: "05a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 0.5em;
    color: var(--ps-green);
}

/* ==================== Results ==================== */
/* compact card: small thumbnail left, text right; the whole card is the link */
.ps-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22em, 1fr));
    gap: 0.75em;
}

.ps-item {
    --ps-thumb: 6.5em;
    position: relative;
    display: grid;
    grid-template-columns: var(--ps-thumb) minmax(0, 1fr);
    align-items: center;
    gap: 1em;
    padding: 1em;
    background: var(--ps-white);
    border: 0.0625em solid var(--ps-border);
    border-radius: 0.625em;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ps-item:hover {
    border-color: var(--ps-green);
    background: #fbfdfc;
}

.ps-item:focus-within {
    border-color: var(--ps-green);
}

/* fixed thumbnail box: any image size fits, nothing can push the layout */
.ps-thumb {
    width: var(--ps-thumb);
    height: var(--ps-thumb);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.25em;
    background: var(--ps-white);
    border: 0.0625em solid #eef1f3;
    border-radius: 0.5em;
    color: #c8d0d5;
}

/* the icon gets its own size: a font-size on the box itself would scale its em-based width
   and push the picture over the text */
.ps-thumb i {
    font-size: 1.375em;
}

.ps-thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.ps-item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125em;
}

.ps-item-head {
    display: flex;
    align-items: center;
    gap: 0.25em;
    min-width: 0;
}

.ps-artnum {
    font-size: 1.0625em;
    font-weight: 700;
    color: var(--ps-green);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* stretch the article link over the whole card */
.ps-artnum::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.ps-artnum:focus-visible {
    outline: none;
}

.ps-item-title {
    margin: 0;
    font-size: 0.9375em;
    line-height: 1.35;
    color: var(--ps-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-match {
    margin: 0.125em 0 0;
    font-size: 0.75em;
    color: var(--ps-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-match strong {
    color: var(--ps-text);
    font-weight: 600;
}

.ps mark {
    background: #fff3a6;
    color: inherit;
    padding: 0;
    border-radius: 0.125em;
}

/* controls inside the card sit above the stretched link */
.ps-copy,
.ps-tgs,
.ps-cart {
    position: relative;
    z-index: 1;
}

.ps-copy {
    border: 0;
    background: none;
    color: #9aa5ad;
    cursor: pointer;
    padding: 0.125em 0.25em;
    border-radius: 0.25em;
    font-size: 0.75em;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ps-item:hover .ps-copy,
.ps-copy:focus-visible,
.ps-copy.is-done {
    opacity: 1;
}

.ps-copy:hover {
    color: var(--ps-green);
}

.ps-copy.is-done {
    color: var(--ps-accent);
}

/* favourite + compare toggles, top right of the card */
.ps-tgs {
    display: inline-flex;
    gap: 0.25em;
    margin-left: auto;
    flex-shrink: 0;
}

.ps-tg {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875em;
    height: 1.875em;
    border-radius: 50%;
    color: #a3adb4;
    font-size: 0.8125em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ps-tg input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ps-tg:hover {
    background: var(--ps-green-light);
    color: var(--ps-green);
}

.ps-tg:focus-within {
    outline: 0.1875em solid var(--ps-accent);
    outline-offset: 0.0625em;
}

.ps-tg .ps-tg-on {
    display: none;
}

.ps-tg input:checked ~ .ps-tg-on {
    display: inline;
}

.ps-tg input:checked ~ .ps-tg-off {
    display: none;
}

.ps-tg--fav:has(input:checked) {
    color: #c62828;
}

.ps-tg--cmp:has(input:checked) {
    background: var(--ps-green);
    color: var(--ps-white);
}

/* stock light (logged-in customers): the shop's traffic-light icon right after the cart button, as in the old table */
.ps-stock {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.1875em;
    border-radius: 50%;
    line-height: 0;
}

a.ps-stock:hover {
    background: var(--ps-green-light);
}

.ps-stock-img {
    display: block;
    width: 1.125em !important;
    height: 1.125em !important;
    max-width: none !important;
}

/* cart row only for logged-in customers */
.ps-cart {
    grid-column: 1 / -1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.375em;
    padding-top: 0.625em;
    border-top: 0.0625em solid #f0f2f3;
}

.ps-step {
    display: inline-flex;
    align-items: center;
    height: 2em;
    border: 0.0625em solid var(--ps-line);
    border-radius: 2em;
    background: var(--ps-white);
    overflow: hidden;
    font-size: 0.8125em;
}

.ps-step:focus-within {
    border-color: var(--ps-green);
    box-shadow: 0 0 0 0.1875em rgba(13, 88, 66, 0.12);
}

.ps-step-btn {
    width: 1.875em;
    height: 100%;
    border: 0;
    background: none;
    color: var(--ps-muted);
    font-size: 0.75em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ps-step-btn:hover {
    background: var(--ps-green-light);
    color: var(--ps-green);
}

.ps-qty {
    width: 2.5em;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 600;
    text-align: center;
    color: var(--ps-text);
    -moz-appearance: textfield;
}

.ps-qty:focus {
    outline: none;
}

.ps-qty::-webkit-outer-spin-button,
.ps-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375em;
    height: 2em;
    padding: 0 0.875em;
    border-radius: 2em;
    font: inherit;
    font-size: 0.8125em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ps-btn--primary {
    border: 0;
    background: var(--ps-green);
    color: var(--ps-white);
}

.ps-btn--primary:hover {
    background: var(--ps-accent);
}

.ps-btn--primary.is-done {
    background: var(--ps-accent);
}

/* ---------- list view ---------- */
.ps-results.is-list {
    grid-template-columns: 1fr;
    gap: 0;
    border: 0.0625em solid var(--ps-border);
    border-radius: 0.625em;
    overflow: hidden;
    background: var(--ps-white);
}

.ps-results.is-list .ps-item {
    --ps-thumb: 3em;
    grid-template-columns: var(--ps-thumb) minmax(0, 1fr) auto;
    padding: 0.5em 0.875em;
    border: 0;
    border-radius: 0;
    border-bottom: 0.0625em solid #f0f2f3;
}

.ps-results.is-list .ps-item:last-child {
    border-bottom: 0;
}

.ps-results.is-list .ps-thumb i {
    font-size: 1em;
}

.ps-results.is-list .ps-item-text {
    flex-direction: row;
    align-items: baseline;
    gap: 1em;
}

.ps-results.is-list .ps-item-head {
    /* room for the full article number + copy + favourite/compare; a longer number widens
       its own row instead of being cut off */
    flex: 0 0 auto;
    min-width: 17em;
}

.ps-results.is-list .ps-artnum {
    font-size: 1em;
    overflow: visible;
    text-overflow: clip;
}

.ps-results.is-list .ps-item-title {
    -webkit-line-clamp: 1;
    flex: 1;
}

.ps-results.is-list .ps-match {
    flex: 0 1 16em;
}

.ps-results.is-list .ps-cart {
    grid-column: auto;
    padding-top: 0;
    border-top: 0;
}

/* ---------- loading, empty, start, error ---------- */
.ps-skeleton {
    display: grid;
    grid-template-columns: 6.5em 1fr;
    gap: 1em;
    align-items: center;
    padding: 1em;
    background: var(--ps-white);
    border: 0.0625em solid var(--ps-border);
    border-radius: 0.625em;
}

.ps-skeleton-thumb {
    width: 6.5em;
    height: 6.5em;
    border-radius: 0.5em;
    background: var(--ps-bg);
}

.ps-skeleton-line {
    height: 0.6875em;
    margin: 0.375em 0;
    border-radius: 0.375em;
    background: linear-gradient(90deg, #eef1f3 0%, #f7f9fa 50%, #eef1f3 100%);
    background-size: 200% 100%;
    animation: ps-shimmer 1.2s linear infinite;
}

.ps-skeleton-line + .ps-skeleton-line {
    width: 65%;
}

@keyframes ps-shimmer {
    to {
        background-position: -200% 0;
    }
}

.ps-results.is-list .ps-skeleton {
    grid-template-columns: 3em 1fr;
    border: 0;
    border-bottom: 0.0625em solid #f0f2f3;
    border-radius: 0;
}

.ps-results.is-list .ps-skeleton-thumb {
    width: 3em;
    height: 3em;
}

.ps-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3em 1.25em;
    background: var(--ps-white);
    border: 0.0625em dashed #cfd6da;
    border-radius: 0.625em;
    color: var(--ps-muted);
}

.ps-results.is-list .ps-state {
    border: 0;
}

.ps-state > i {
    display: block;
    font-size: 2em;
    margin-bottom: 0.625em;
    color: var(--ps-green-line);
}

.ps-state h3 {
    margin: 0 0 0.375em;
    font-size: 1.0625em;
    color: var(--ps-text);
}

.ps-state p {
    margin: 0 auto;
    max-width: 32em;
    font-size: 0.875em;
}

.ps-state .ps-btn {
    margin-top: 1.25em;
}

/* ==================== Pagination ==================== */
.ps-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75em;
    margin-top: 1.5em;
    padding-top: 1em;
    border-top: 0.0625em solid var(--ps-border);
}

.ps-pg-info {
    font-size: 0.875em;
    color: var(--ps-muted);
}

.ps-pg-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375em;
    align-items: center;
}

.ps-pg-btn {
    min-width: 2.25em;
    padding: 0.4em 0.75em;
    border: 0.0625em solid var(--ps-line);
    background: var(--ps-white);
    border-radius: 2em;
    font: inherit;
    font-size: 0.8125em;
    font-weight: 600;
    color: var(--ps-text);
    cursor: pointer;
    line-height: 1.2;
}

.ps-pg-btn:hover:not(:disabled) {
    border-color: var(--ps-green);
    color: var(--ps-green);
    background: var(--ps-green-light);
}

.ps-pg-btn[aria-current="page"] {
    background: var(--ps-green);
    border-color: var(--ps-green);
    color: var(--ps-white);
}

.ps-pg-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.ps-pg-dots {
    padding: 0 0.25em;
    color: var(--ps-muted);
}

/* outlined pill button (link to the dimension search) */
.ps-btn--outline {
    border: 0.0625em solid var(--ps-line);
    background: var(--ps-white);
    color: var(--ps-text);
}

.ps-btn--outline:hover {
    border-color: var(--ps-green);
    color: var(--ps-green);
}

.ps-state .ps-state-alt {
    margin-top: 1.5em;
    padding-top: 1.25em;
    border-top: 0.0625em solid var(--ps-border);
}

/* ==================== Responsive ==================== */
@media (max-width: 64em) {
    .ps-layout.has-sidebar {
        grid-template-columns: 1fr;
    }

    .ps-sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 48em) {
    .ps {
        font-size: 15px;
    }


    .ps-title {
        font-size: 1.5em;
    }

    .ps-filter {
        flex: 1;
    }

    .ps-filter input {
        width: 100%;
    }

    .ps-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ps-toolbar-right {
        justify-content: space-between;
    }

    .ps-results {
        grid-template-columns: 1fr;
    }

    .ps-results.is-list .ps-item-text {
        flex-direction: column;
        align-items: stretch;
        gap: 0.125em;
    }

    .ps-results.is-list .ps-item-head,
    .ps-results.is-list .ps-match {
        flex: none;
    }

    /* phones: no fixed minimum; a very long number may wrap instead of overflowing */
    .ps-results.is-list .ps-item-head {
        min-width: 0;
    }

    .ps-results.is-list .ps-artnum {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ps-results.is-list .ps-item {
        grid-template-columns: var(--ps-thumb) minmax(0, 1fr);
    }

    .ps-results.is-list .ps-cart {
        grid-column: 1 / -1;
    }

    .ps-copy {
        opacity: 1;
    }

    .ps-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ps *,
    .ps *::before,
    .ps *::after {
        animation: none !important;
        transition: none !important;
    }
}