/* Product listing pages (category and manufacturer), redesigned view. Prefix plp-.
   Shared tokens come from storefront.css; InstantSearch widgets (.ais-*) are styled inside .plp only. */

.plp {
    background: var(--sf-bg);
    color: var(--sf-ink);
    font-size: 14px;
    line-height: 1.5;
}

.plp [hidden] {
    display: none !important;
}

/* ---------- Title band ---------- */

.plp-banner {
    display: flex;
    align-items: flex-end;
    min-height: 120px;
    background: linear-gradient(120deg, var(--sf-primary-dark) 0%, var(--sf-primary) 100%);
}

.plp-banner__inner {
    width: 100%;
    max-width: var(--sf-max-width);
    margin: 0 auto;
    padding: 16px 20px;
}

.plp-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding-bottom: 8px;
    font-size: 11px;
    color: #fff;
}

.plp-crumb a {
    font-weight: 700;
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
}

.plp-crumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.plp-crumb__sep {
    color: rgba(255, 255, 255, .4);
}

.plp-banner__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
}

.plp-banner__meta {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, .75);
}

/* The product count comes from an InstantSearch stats widget, which renders blocks. */
.plp-banner__meta .ais-Stats,
.plp-banner__meta .ais-Stats-text {
    display: inline;
}

.plp-banner__text {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, .85);
}

.plp-banner__text * {
    margin: 0;
    font-size: inherit;
    color: inherit;
}

/* Brand pages: the design's darker band. */
.plp-banner--brand {
    background: linear-gradient(120deg, #1a0a2e 0%, var(--sf-primary-dark) 50%, var(--sf-primary) 100%);
}

/* Brand banner artwork (client mockup): on the right of the band at full band height, right-aligned to the
   window edge, its left edge fading into the band. Phones: the whole banner, full width under the text. */
.plp-banner__art {
    margin: 14px -20px -16px; /* full bleed under the text (the band's phone padding is 16px 20px) */
}

.plp-banner__art img {
    display: block;
    width: 100%;
    height: auto;
}

@media (min-width: 640px) {
    .plp-banner--art {
        position: relative;
        overflow: hidden;
    }

    .plp-banner--art .plp-banner__inner {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-self: stretch;
    }

    /* The text keeps to the left part, clear of the artwork. */
    .plp-banner--art .plp-banner__inner > :not(.plp-banner__art) {
        position: relative;
        z-index: 1;
        max-width: calc(46% - 24px);
    }

    .plp-banner__art {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 46%;
        right: calc((100% - 100vw) / 2); /* past the content width, to the window edge */
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin: 0;
    }

    /* Full band height. A banner wider than the space keeps its left part (where brand names and logos sit)
       and loses only some of its right end; the picture's box matches what is drawn, so the fade sits on its
       left edge. */
    .plp-banner__art img {
        width: auto;
        height: 100%;
        max-width: 100%;
        object-fit: cover;
        object-position: left center;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px);
        mask-image: linear-gradient(90deg, transparent 0, #000 40px);
    }
}

/* Brand logo in the band: under the text on phones, on the right from 640px (the text keeps clear of it).
   White box, so logos drawn for light backgrounds stay readable on the dark band. */
.plp-banner__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 72px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}

.plp-banner__logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (min-width: 640px) {
    .plp-banner--logo .plp-banner__inner {
        position: relative;
        padding-right: calc(24px + 220px + 24px);
    }

    .plp-banner__logo {
        position: absolute;
        top: 50%;
        right: 24px;
        width: 220px;
        height: 92px;
        margin: 0;
        transform: translateY(-50%);
    }
}

@media (min-width: 1024px) {
    .plp-banner--logo .plp-banner__inner {
        padding-right: calc(32px + 280px + 32px);
    }

    .plp-banner__logo {
        right: 32px;
        width: 280px;
        height: 112px;
        padding: 10px 16px;
    }
}

/* ---------- Size charts (brand pages) ---------- */

.plp-sizecharts__inner {
    max-width: var(--sf-max-width);
    margin: 0 auto;
    padding: 16px 20px 0;
}

.plp-sizecharts__lbl {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--sf-text);
}

.plp-sizecharts__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.plp-sizechart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--sf-border);
    border-radius: var(--sf-radius);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sf-ink);
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}

.plp-sizechart .bi-rulers {
    color: var(--sf-primary);
}

.plp-sizechart__open {
    font-size: 11px;
    color: var(--sf-text);
}

.plp-sizechart:hover {
    border-color: var(--sf-primary);
    background: var(--sf-primary-soft);
    color: var(--sf-ink);
}

.plp-sizechart:focus-visible {
    outline: 2px solid var(--sf-primary);
    outline-offset: 2px;
}

/* ---------- Layout ---------- */

.plp-wrap {
    display: flex;
    width: 100%;
    max-width: var(--sf-max-width);
    margin: 0 auto;
}

.plp-side {
    display: none;
}

.plp-main {
    flex: 1;
    min-width: 0;
    padding: 20px 20px 80px;
}

/* ---------- Filter cards ---------- */

.plp-fcard {
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--sf-border);
    border-radius: 10px;
    background: #fff;
}

.plp-fcard__hdrow {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--sf-border);
}

.plp-fcard__hd {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--sf-border);
    background: none;
    font-family: var(--sf-font);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
    color: var(--sf-text);
    cursor: pointer;
    user-select: none;
}

.plp-fcard__hdrow .plp-fcard__hd {
    border-bottom: 0;
}

.plp-fcard__hd--static {
    cursor: default;
}

.plp-fcard__caret {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--sf-muted);
    transition: transform .2s;
}

.plp-fcard.is-collapsed .plp-fcard__caret {
    transform: rotate(-90deg);
}

.plp-fcard.is-collapsed > .plp-fcard__hd,
.plp-fcard.is-collapsed .plp-fcard__hdrow {
    border-bottom-color: transparent;
}

.plp-fcard.is-collapsed .plp-fcard__body {
    display: none;
}

.plp-fcard__body {
    padding: 10px 14px 12px;
}

.plp-fcard__badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    margin-left: 4px;
    padding: 0 3px;
    border-radius: 50%;
    background: var(--sf-primary);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    color: #fff;
}

.plp-fcard__badge.is-on {
    display: inline-flex;
}

.plp-fcard__find {
    flex-shrink: 0;
    margin-right: 8px;
    padding: 2px 4px;
    border: 0;
    background: none;
    font-size: 12px;
    line-height: 1;
    color: #b0a8b9;
    cursor: pointer;
}

.plp-fcard__find:hover,
.plp-fcard__find.is-on {
    color: var(--sf-primary);
}

.plp-fcard__search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 10px;
}

.plp-fcard__search i {
    font-size: 11px;
    color: var(--sf-muted);
}

.plp-fcard__search input {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    border: 0;
    border-bottom: 1.5px solid var(--sf-border);
    outline: none;
    background: transparent;
    font-family: var(--sf-font);
    font-size: 12px;
    color: var(--sf-ink);
}

.plp-fcard__search input:focus {
    border-bottom-color: var(--sf-primary);
}

/* "Reset All" (InstantSearch clearRefinements) */
.plp .ais-ClearRefinements-button {
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--sf-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--sf-primary);
    cursor: pointer;
}

.plp .ais-ClearRefinements-button--disabled {
    color: var(--sf-muted);
    cursor: default;
}

/* Active filters */
.plp-fcard__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 14px;
}

.plp-fcard__tags:empty {
    display: none;
}

.plp-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 5px 3px 9px;
    border: 1.5px solid rgba(123, 45, 139, .3);
    border-radius: var(--sf-radius-pill);
    background: var(--sf-primary-soft);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--sf-primary);
}

.plp-tag__lbl {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plp-tag__x {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 3px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    font-size: 14px;
    line-height: 1;
    color: inherit;
    opacity: .6;
    cursor: pointer;
}

.plp-tag__x:hover {
    background: rgba(123, 45, 139, .15);
    opacity: 1;
}

/* The page's own category (cannot be removed). */
.plp-tag--locked {
    padding: 6px 10px;
    border: 1px solid #d4b8df;
    border-radius: 10px;
    font-size: 12px;
    white-space: normal;
}

.plp-tag--locked .plp-tag__lbl {
    white-space: normal;
}

/* ---------- Chips: "Filter by" flags + facet lists ---------- */

.plp-flags,
.plp .ais-RefinementList-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plp-flag {
    position: relative;
    margin: 0;
}

.plp-flag input,
.plp .ais-RefinementList-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.plp-flag span,
.plp .ais-RefinementList-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 5px 10px;
    border: 1.5px solid var(--sf-border);
    border-radius: 20px;
    background: #fff;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sf-ink);
    cursor: pointer;
    transition: all .15s;
}

.plp-flag span:hover,
.plp .ais-RefinementList-label:hover,
.plp-flag input:checked + span,
.plp .ais-RefinementList-item--selected .ais-RefinementList-label {
    border-color: var(--sf-primary);
    background: var(--sf-primary-soft);
    color: var(--sf-primary);
}

.plp-flag input:focus-visible + span,
.plp .ais-RefinementList-checkbox:focus-visible + .ais-RefinementList-labelText {
    outline: 2px solid var(--sf-primary);
    outline-offset: 2px;
}

.plp-flag input:disabled + span {
    opacity: .5;
    cursor: wait;
}

.plp .ais-RefinementList-count {
    padding: 0;
    border: 0;
    background: none;
    font-size: 10px;
    font-weight: 400;
    color: var(--sf-muted);
}

.plp .ais-RefinementList-item--selected .ais-RefinementList-count {
    color: var(--sf-primary-dark);
    opacity: .7;
}

.plp-more {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0 2px;
    border: 0;
    background: none;
    font-family: var(--sf-font);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--sf-primary);
    cursor: pointer;
}

.plp-more:hover {
    text-decoration: underline;
}

/* ---------- Wholesale price range ---------- */

.plp .ais-RangeInput-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.plp .ais-RangeInput-label {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.plp .ais-RangeInput-input {
    width: 100%;
    padding: 5px 6px;
    border: 1.5px solid var(--sf-border);
    border-radius: 6px;
    outline: none;
    font-family: var(--sf-font);
    font-size: 12px;
    color: var(--sf-ink);
    -moz-appearance: textfield;
}

.plp .ais-RangeInput-input:focus {
    border-color: var(--sf-primary);
}

.plp .ais-RangeInput-input::-webkit-inner-spin-button,
.plp .ais-RangeInput-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.plp .ais-RangeInput-separator {
    font-size: 12px;
    color: var(--sf-muted);
}

.plp .ais-RangeInput-submit {
    padding: 5px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--sf-primary);
    font-family: var(--sf-font);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
}

.plp .ais-RangeSlider .rheostat {
    position: relative;
    overflow: visible;
    margin: 12px 8px 6px;
    height: 16px;
}

.plp .ais-RangeSlider .rheostat-background {
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 4px;
    border: 0;
    border-radius: 2px;
    background: var(--sf-border);
}

.plp .ais-RangeSlider .rheostat-progress {
    position: absolute;
    top: 6px;
    height: 4px;
    border-radius: 2px;
    background: var(--sf-primary);
}

.plp .ais-RangeSlider .rheostat-handle {
    position: absolute;
    top: 0;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--sf-primary);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .22);
    cursor: grab;
}

.plp .ais-RangeSlider .rheostat-handle::before,
.plp .ais-RangeSlider .rheostat-handle::after {
    display: none;
}

/* Values show in the inputs above, so the slider's own tooltips and pips stay hidden. */
.plp .ais-RangeSlider .rheostat-tooltip,
.plp .ais-RangeSlider .rheostat-marker,
.plp .ais-RangeSlider .rheostat-value {
    display: none;
}

/* ---------- Results bar ---------- */

/* When the dropdowns don't fit beside a usable filter box (240px), they move to a second row. */
.plp-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 10px;
    padding: 10px 0 14px;
    margin-bottom: 4px;
}

.plp-bar__count {
    flex-shrink: 0;
    padding-right: 14px;
    border-right: 1.5px solid var(--sf-border);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--sf-ink);
}

.plp-bar__count span {
    margin-left: 2px;
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

/* Filter box: a white field whose border stands out from the page (3.3:1 on --sf-bg), like the kit's
   .sf-input. The icon sits over the input's left padding, so a click anywhere in the box focuses it. */
.plp-bar__search {
    position: relative;
    display: flex;
    flex: 1 1 240px;
    align-items: center;
    min-width: 0;
    margin: 0 14px;
    border: 1.5px solid #948a9e;
    border-radius: var(--sf-radius);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.plp-bar__search:hover {
    border-color: var(--sf-primary);
}

.plp-bar__search:focus-within {
    border-color: var(--sf-primary);
    box-shadow: 0 0 0 3px rgba(123, 45, 139, .15);
}

.plp-bar__search > i {
    position: absolute;
    top: 50%;
    left: 12px;
    font-size: 14px;
    color: #6b6177; /* 5.8:1 on white */
    transform: translateY(-50%);
    pointer-events: none;
}

.plp-bar__box {
    flex: 1;
    min-width: 0;
}

.plp .ais-SearchBox-form {
    display: flex;
    align-items: center;
    margin: 0;
    background: none;
}

.plp .ais-SearchBox-form::before {
    display: none;
}

.plp .ais-SearchBox-input {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 9px 4px 9px 34px;
    border: 0;
    outline: none;
    background: transparent;
    box-shadow: none;
    font-family: var(--sf-font);
    font-size: 13px;
    line-height: normal;
    color: var(--sf-ink);
}

.plp .ais-SearchBox-input::placeholder {
    color: #6b6177; /* 5.8:1 on white */
    opacity: 1;
}

.plp .ais-SearchBox-reset {
    display: flex;
    align-items: center;
    margin-right: 6px;
    padding: 4px;
    border: 0;
    background: none;
    color: var(--sf-muted);
    cursor: pointer;
}

.plp .ais-SearchBox-reset[hidden] {
    display: none;
}

.plp-bar__right {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

/* Dropdowns: the same white box as the filter box. A click anywhere in the box (label, padding,
   caret) opens its dropdown; the page script forwards it to the select. */
.plp-sel {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    border: 1.5px solid #948a9e;
    border-radius: var(--sf-radius);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.plp-sel:hover {
    border-color: var(--sf-primary);
}

.plp-sel:focus-within {
    border-color: var(--sf-primary);
    box-shadow: 0 0 0 3px rgba(123, 45, 139, .15);
}

/* The Sort / Per page widgets render a div around their select. */
.plp-sel > div {
    display: flex;
    flex: 1;
    min-width: 0;
}

.plp-sel__lbl {
    padding-left: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #6b6177; /* 5.8:1 on white */
    pointer-events: none;
}

.plp-sel select {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 9px 30px 9px 6px;
    line-height: normal;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--sf-font);
    font-size: 13px;
    text-overflow: ellipsis;
    color: var(--sf-ink);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.plp-sel__caret {
    position: absolute;
    right: 10px;
    font-size: 10px;
    color: #6b6177;
    pointer-events: none;
}

/* ---------- Product grid + card ---------- */

.plp .plp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plp .plp-grid__item {
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.plp .plp-empty {
    padding: 48px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--sf-muted);
}

.plp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 1.5px solid var(--sf-border);
    border-radius: 8px;
    background: #fff;
    transition: box-shadow .2s, transform .15s, border-color .15s;
}

.plp-card:hover {
    border-color: rgba(123, 45, 139, .2);
    box-shadow: 0 4px 20px rgba(123, 45, 139, .1);
    transform: translateY(-2px);
}

.plp-card:focus-within {
    border-color: var(--sf-primary);
}

.plp-card__img {
    position: relative;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    height: 200px;
    overflow: hidden;
    background: #fff;
}

.plp-card__img > img {
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
    transition: transform .25s;
}

.plp-card:hover .plp-card__img > img {
    transform: scale(1.04);
}

.plp-card__ribbons {
    position: absolute;
    top: 7px;
    left: 7px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.plp-badge {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
}

.plp-badge--sale {
    background: var(--sf-danger);
}

.plp-badge--tester {
    background: #64748b;
}

/* Hanging-item icon: top-left of the picture, under the On Sale / Tester badges when there are any. */
.plp-card__hanger {
    width: 34px;
    height: 34px;
    object-fit: contain;
    transform: rotate(-45deg);
    pointer-events: none;
}

.plp-card__actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.plp-card__act {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: background .15s, color .15s, transform .12s;
}

.plp-card__act:hover {
    background: #fff;
    color: var(--sf-primary);
    transform: scale(1.08);
}

.plp-card__act.is-saved {
    background: rgba(233, 30, 99, .08);
    color: #e91e63;
}

/* Hover / keyboard-focus label for the round icons ("Quick view", "Save item"), shown at once to
   their left inside the image; the heart's text follows its saved state (is-saved). */
.plp-card__act[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: 50%;
    right: calc(100% + 6px);
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--sf-ink);
    font-family: var(--sf-font);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    /* Wraps past 110px, so the longest label fits beside the icon on the narrowest cards (121px). */
    width: max-content;
    max-width: 110px;
    text-align: center;
    color: #fff;
    opacity: 0;
    transform: translateY(-50%);
    pointer-events: none;
    transition: opacity .12s;
}

.plp-card__act.is-saved[data-tip-saved]::after {
    content: attr(data-tip-saved);
}

.plp-card__act[data-tip]:focus-visible::after {
    opacity: 1;
}

/* Touch screens have no hover, so a tap doesn't leave a label behind. */
@media (hover: hover) {
    .plp-card__act[data-tip]:hover::after {
        opacity: 1;
    }
}

.plp-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 11px 12px 12px;
}

.plp-card__flags {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px;
}

.plp-card__flags:has(> [style*="inline"]) {
    margin-bottom: 4px;
}

.plp-card__brand {
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--sf-primary);
}

.plp-card__name {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 4px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--sf-ink);
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Makes the whole card open the product; buttons and inputs sit above it. */
.plp-card__name::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.plp-card__name:focus-visible {
    outline: none;
}

.plp-card:has(.plp-card__name:focus-visible) {
    box-shadow: 0 0 0 3px rgba(123, 45, 139, .25);
}

.plp-card mark,
.plp-card .ais-Highlight-highlighted,
.plp-card .ais-Snippet-highlighted {
    padding: 0;
    background: var(--sf-primary-soft);
    color: inherit;
}

/* SKU and UPC sit above the card's link so buyers can copy them (they check codes in other systems), as on the
   old pages; one click on a code selects all of it, hyphens included. */
.plp-card__codes {
    position: relative;
    z-index: 2;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 1px;
    font-family: var(--sf-mono);
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--sf-text);
    overflow-wrap: anywhere;
}

.plp-card__code {
    padding: 0 2px;
    border-radius: 3px;
    color: var(--sf-ink);
    cursor: text;
    -webkit-user-select: all;
    user-select: all;
}

.plp-card__code:hover {
    background: var(--sf-primary-soft);
}

.plp-card__special {
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--sf-warning);
}

/* Price and stock share a row; on a card too narrow for both, the stock drops under the price. */
.plp-card__pricerow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
    margin: 0 0 8px;
}

.plp-card__price {
    margin: 0;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.5;
    color: var(--sf-primary);
}

.plp-card--oos .plp-card__price {
    color: var(--sf-muted);
}

.plp-card__foot {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
}

.plp-stock {
    display: inline-flex;
    align-self: center;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
}

.plp-stock--in {
    background: #dcfce7;
    color: var(--sf-success);
}

.plp-stock--low {
    background: #fffbeb;
    color: #d97706;
}

.plp-stock--oos {
    background: #fee2e2;
    color: var(--sf-danger);
}

/* On narrow cards Add + Save wrap under the quantity box instead of squeezing Add. */
.plp-card__buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.plp-qty {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    overflow: hidden;
    border: 1.5px solid var(--sf-border);
    border-radius: 8px;
}

.plp-qty__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 28px;
    padding: 0;
    border: 0;
    background: #f8f6fa;
    font-family: var(--sf-font);
    font-size: 16px;
    line-height: 1;
    color: var(--sf-primary);
    cursor: pointer;
}

.plp-qty__btn:hover {
    background: var(--sf-primary-soft);
}

.plp-qty__val {
    width: 32px;
    padding: 0;
    border: 0;
    outline: none;
    background: #fff;
    font-family: var(--sf-font);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: var(--sf-ink);
}

.plp-qty__val::placeholder {
    color: var(--sf-ink);
}

.plp-card__add {
    display: flex;
    flex: 1;
    min-width: 64px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 28px;
    padding: 0 6px;
    border: 1.5px solid var(--sf-primary);
    border-radius: 6px;
    background: var(--sf-primary);
    font-family: var(--sf-font);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    color: #fff;
    cursor: pointer;
    transition: background .12s;
}

.plp-card__add i {
    font-size: 12px;
}

.plp-card__add:hover {
    border-color: var(--sf-primary-dark);
    background: var(--sf-primary-dark);
}

/* Out of stock still adds (backorder, as today), so the button stays but is outlined. */
.plp-card--oos .plp-card__add {
    border-color: var(--sf-border);
    background: transparent;
    color: var(--sf-text);
}

.plp-card--oos .plp-card__add:hover {
    border-color: var(--sf-primary);
    background: transparent;
    color: var(--sf-primary);
}

.plp-card__save {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1.5px solid var(--sf-primary);
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    color: var(--sf-primary);
    cursor: pointer;
    transition: background .12s, color .12s;
}

.plp-card__save:hover {
    background: var(--sf-primary);
    color: #fff;
}

/* ---------- Bottom: count, pagination, Add Multiple ---------- */

.plp-btm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 0 8px;
}

.plp-btm__info {
    font-size: 12px;
    color: var(--sf-muted);
}

.plp-btm__info strong {
    color: var(--sf-ink);
}

.plp-btm__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.plp .ais-Pagination-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plp .ais-Pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border: 1.5px solid var(--sf-border);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--sf-text);
    text-decoration: none;
    transition: .15s;
}

.plp .ais-Pagination-link:hover {
    border-color: var(--sf-primary);
    background: var(--sf-primary-soft);
    color: var(--sf-primary);
}

.plp .ais-Pagination-item--selected .ais-Pagination-link {
    border-color: var(--sf-primary);
    background: var(--sf-primary);
    color: #fff;
}

.plp .ais-Pagination-item--disabled .ais-Pagination-link {
    background: #f8fafc;
    opacity: .35;
    pointer-events: none;
}

.plp .ais-Pagination-item--previousPage .ais-Pagination-link,
.plp .ais-Pagination-item--nextPage .ais-Pagination-link {
    font-size: 12px;
    color: #64748b;
}

.plp-addall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: 1.5px solid var(--sf-primary);
    border-radius: var(--sf-radius-pill);
    background: #fff;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--sf-primary);
    text-decoration: none;
    cursor: pointer;
}

.plp-addall:hover {
    background: var(--sf-primary);
    color: #fff;
}

/* ---------- Drawer (phones + tablets) and bottom bar ---------- */

.plp-drawer__hd,
.plp-drawer__ft {
    display: none;
}

.plp-mobbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1.5px solid var(--sf-border);
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}

.plp-mobbar__btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    border: 1.5px solid var(--sf-primary);
    border-radius: var(--sf-radius-pill);
    background: var(--sf-primary);
    font-family: var(--sf-font);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
}

.plp-mobbar__badge {
    padding: 1px 7px;
    border-radius: var(--sf-radius-pill);
    background: #fff;
    font-size: 11px;
    font-weight: 800;
    color: var(--sf-primary);
}

@media (max-width: 1023px) {
    body.filtering {
        overflow: hidden;
    }

    /* The aside itself is the dimmed backdrop (a click on it closes, see search_functions.js);
       its three parts form the white panel on the left. */
    body.filtering .plp-side {
        position: fixed;
        inset: 0;
        z-index: var(--sf-z-drawer);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        background: rgba(15, 23, 42, .45);
    }

    body.filtering .plp-side > * {
        width: min(320px, 88vw);
        background: #fff;
    }

    .plp-side__scroll {
        flex: 1;
        overflow-y: auto;
        padding: 0 16px 8px;
    }

    body.filtering .plp-drawer__hd {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 16px 14px;
        font-size: 15px;
        font-weight: 800;
    }

    .plp-drawer__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 50%;
        background: var(--sf-bg);
        color: var(--sf-text);
        cursor: pointer;
    }

    body.filtering .plp-drawer__ft {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px 16px;
        border-top: 1px solid var(--sf-border);
    }

    .plp-drawer__ft > [data-widget="save-filters-mobile"] {
        flex: 1;
    }

    .plp-drawer__apply {
        width: 100%;
        padding: 12px;
        border: 0;
        border-radius: var(--sf-radius-pill);
        background: var(--sf-primary);
        font-family: var(--sf-font);
        font-size: 13px;
        font-weight: 800;
        color: #fff;
        cursor: pointer;
    }

    .plp-main {
        padding-bottom: 96px;
    }
}

@media (max-width: 639px) {
    .plp-bar {
        padding-bottom: 10px;
        border-bottom: 1.5px solid var(--sf-border);
    }

    .plp-bar__count {
        padding-right: 10px;
        border-right: 0;
    }

    /* Own row, the three boxes sharing its width, so they never run off the screen. */
    .plp-bar__right {
        flex: 0 0 100%;
        gap: 6px;
    }

    /* Search in and Per page keep their width; Sort (as wide as its longest option) takes what is left. */
    .plp-sel {
        flex: 0 0 auto;
    }

    .plp-sel--sort {
        flex: 1 1 0;
    }

    .plp-sel select {
        padding-right: 24px;
    }

    .plp-sel__caret {
        right: 8px;
    }

    .plp-bar__search {
        order: 10;
        flex: 0 0 100%;
        margin: 0;
    }

    .plp-sel__lbl {
        display: none;
    }

    /* "All / SKU / Name / UPC" needs its label to make sense. */
    .plp-sel--in .plp-sel__lbl {
        display: inline;
        padding-left: 8px;
    }

}

@media (min-width: 480px) {
    .plp .plp-grid {
        gap: 12px;
    }
}

@media (min-width: 640px) {
    .plp-banner {
        min-height: 160px;
    }

    .plp-banner__inner {
        padding: 20px 24px;
    }

    .plp-sizecharts__inner {
        padding: 16px 24px 0;
    }

    .plp-banner__title {
        font-size: 28px;
    }

    .plp-main {
        padding: 20px 24px 60px;
    }

    .plp .plp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .plp-card__name {
        font-size: 13.5px;
    }

    .plp-card__price {
        font-size: 17px;
    }
}

@media (min-width: 1024px) {
    .plp-banner__inner {
        padding: 24px 32px;
    }

    .plp-sizecharts__inner {
        padding: 16px 32px 0;
    }

    .plp-side {
        position: sticky;
        top: calc(var(--sf-nav-h) + 8px);
        display: block;
        flex: 0 0 260px;
        align-self: flex-start;
        width: 260px;
        max-height: calc(100vh - var(--sf-nav-h) - 16px);
        overflow-y: auto;
        padding: 16px 14px;
        border-right: 1px solid var(--sf-border);
    }

    .plp-main {
        padding: 20px 28px 60px;
    }

    .plp .plp-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .plp-mobbar {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .plp-card,
    .plp-card:hover,
    .plp-card__img > img {
        transform: none !important;
        transition: none;
    }
}
