/* ═══════════════════════════════════════════════════════════════
   SupplySolution — Product Listing Page (PLP)
   Industrial B2B / Marketplace catalogue grid
   ═══════════════════════════════════════════════════════════════ */

/* ── Grid ─────────────────────────────────────────────────────── */
.ss-plp {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 24px 0 40px;
}
@media (max-width: 1200px) { .ss-plp { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .ss-plp { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 480px)  { .ss-plp { grid-template-columns: 1fr; } }

/* List view */
.ss-plp--list {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ── Card ─────────────────────────────────────────────────────── */
.ss-card {
    display: flex;
    flex-direction: column;
    background: var(--ss-white);
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    position: relative;
}
.ss-card:hover {
    border-color: var(--ss-blue);
    box-shadow: 0 4px 24px rgba(37,99,235,.10);
    transform: translateY(-2px);
}

/* List mode card */
.ss-plp--list .ss-card {
    flex-direction: row;
    align-items: stretch;
}

/* ── Image ────────────────────────────────────────────────────── */
.ss-card__img-wrap {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
}
/* Blank theme sets padding-bottom aspect-ratio trick and position:absolute on the image.
   These resets are scoped to our card wrapper so specificity wins without !important. */
.ss-card__img-wrap img,
.ss-card__img-wrap .product-image-container,
.ss-card__img-wrap .product-image-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
}
.ss-card__img-wrap .product-image-wrapper {
    display: block;
    overflow: hidden;
}
.ss-card__img-wrap .product-image-photo {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    outline: none;
}
.ss-card__img-wrap img {
    object-fit: contain;
    padding: 12px;
    transition: transform .3s ease;
    border: none;
    outline: none;
    box-shadow: none;
}
.ss-card:hover .ss-card__img-wrap img { transform: scale(1.04); }

.ss-plp--list .ss-card__img-wrap {
    aspect-ratio: auto;
    width: 180px;
    min-height: 160px;
    border-right: 1px solid var(--ss-border);
}
@media (max-width: 600px) { .ss-plp--list .ss-card__img-wrap { width: 120px; } }

/* ── Meta row (SKU + stock) ───────────────────────────────────── */
.ss-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

/* ── Stock indicator (inline in body, no absolute positioning) ── */
.ss-card__stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--ss-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.ss-card__stock--in  { color: #16a34a; }
.ss-card__stock--out { color: var(--ss-red); }
.ss-card__stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ss-card__stock--in  .ss-card__stock-dot { background: #22c55e; }
.ss-card__stock--out .ss-card__stock-dot { background: #ef4444; }

/* ── Body ─────────────────────────────────────────────────────── */
.ss-card__body {
    padding: 14px 16px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ss-card__sku {
    font-family: var(--ss-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--ss-ink-3);
    letter-spacing: .5px;
    text-transform: uppercase;
    margin: 0;
}

.ss-card__name {
    font-family: var(--ss-font);
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ss-plp--list .ss-card__name { -webkit-line-clamp: 3; font-size: 15px; }

.ss-card__name-link,
.ss-card__name-link:visited {
    color: #0f172a;
    text-decoration: none;
}
.ss-card__name-link:hover { color: var(--ss-blue); }

.ss-card__brand {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0;
}

/* ── Price ────────────────────────────────────────────────────── */
.ss-card__price {
    margin-top: auto;
    padding-top: 8px;
}
.ss-card__price .price-box { margin: 0; }
.ss-card__price .price-label { display: none; }
.ss-card__price .price {
    font-family: var(--ss-mono);
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.5px;
}
/* Hide the crossed-out "Regular Price" on cards — a single clear price
 * beats stacked strikethrough + special. PDP still shows both. */
.ss-card__price .old-price { display: none; }
.ss-card__price .special-price .price { color: var(--ss-red); }
.ss-card__price .price-final_price    { display: inline-block; }

/* "As low as $X" line for products with tier pricing — small, subtle,
 * gray. Un-hides the "As low as" label inside the minimal-price link
 * so the number has context. */
.ss-card__price .minimal-price-link {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--ss-ink-2);
    text-decoration: none;
    font-weight: 500;
}
.ss-card__price .minimal-price-link .price-label {
    display: inline;
    font-size: 12px;
    color: var(--ss-ink-2);
    font-weight: 500;
    margin-right: 2px;
}
.ss-card__price .minimal-price-link .price {
    font-family: var(--ss-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--ss-ink-2);
    letter-spacing: 0;
}

/* Description (list view only) */
.ss-card__desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin: 4px 0 0;
}

/* ── Actions ──────────────────────────────────────────────────── */
.ss-card__actions {
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.ss-plp--list .ss-card__actions {
    padding: 14px 16px;
    justify-content: flex-end;
    min-width: 160px;
    flex-shrink: 0;
    border-left: 1px solid #f1f5f9;
}

.ss-card__form { display: flex; }

.ss-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 14px;
    border-radius: 8px;
    font-family: var(--ss-font);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.ss-card__btn--cart,
.ss-card__btn--cart.action.tocart.primary {
    background: var(--ss-blue);
    color: var(--ss-white);
    border: none;
    line-height: 1;
    text-transform: none;
    font-size: 13px;
}
.ss-card__btn--cart:hover:not(:disabled),
.ss-card__btn--cart.action.tocart.primary:hover:not(:disabled) { background: var(--ss-blue-dk); }
.ss-card__btn--cart:disabled,
.ss-card__btn--cart.action.tocart.primary:disabled {
    background: var(--ss-blue);
    opacity: .7;
    cursor: not-allowed;
}
.ss-card__btn--view {
    background: #f8fafc;
    color: #374151;
    border: 1.5px solid var(--ss-border);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
}
.ss-card__btn--view:hover { background: #e8f0fe; border-color: var(--ss-blue); color: var(--ss-blue); }
.ss-card__btn--full { padding: 9px 14px; font-size: 13px; font-weight: 700; }

/* ── Toolbar ──────────────────────────────────────────────────── */
.toolbar.toolbar-products {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: var(--ss-white);
    border: 1px solid var(--ss-border);
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: var(--ss-font);
}

/* Amount / count */
.toolbar-amount {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-right: auto;
}
.toolbar-amount .toolbar-number { font-weight: 700; color: #0f172a; }

/* Sorter */
.toolbar-sorter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.toolbar-sorter .sorter-label {
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.toolbar-sorter select,
.sorter-options {
    padding: 6px 10px;
    border: 1.5px solid var(--ss-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--ss-font);
    color: #374151;
    background: var(--ss-white);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}
.toolbar-sorter select:focus,
.sorter-options:focus { border-color: var(--ss-blue); }

/* View mode toggle — Blank theme uses float and font-size:0 on these elements.
   float:none and display:flex need !important to override Blank's floated layout. */
.modes {
    display: flex !important;
    gap: 4px;
    border: 1.5px solid var(--ss-border);
    border-radius: 8px;
    overflow: hidden;
    padding: 2px;
    background: #f8fafc;
}
.modes-mode {
    display: flex !important;
    align-items: center;
    justify-content: center;
    float: none !important;
    width: 36px;
    height: 32px;
    border: none;
    border-radius: 6px;
    color: var(--ss-ink-3);
    text-decoration: none;
    padding: 0;
    transition: background .15s, color .15s;
    font-size: 0 !important;
}
.modes-mode::before {
    font-size: 22px !important;
    line-height: 1;
    font-family: 'icons-blank-theme' !important;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}
.modes-mode:hover,
.modes-mode.active {
    background: var(--ss-blue);
    color: var(--ss-white);
}
.mode-grid::before { content: '\e60d' !important; }
.mode-list::before { content: '\e60b' !important; }

/* Limiter (per page) */
.toolbar-products .limiter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.limiter-label {
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.limiter-options {
    padding: 6px 10px;
    border: 1.5px solid var(--ss-border);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--ss-font);
    color: #374151;
    background: var(--ss-white);
    outline: none;
    cursor: pointer;
}
.limiter-options:focus { border-color: var(--ss-blue); }
.limiter-text { color: #6b7280; font-size: 12px; }

/* ── Toolbar — tablet + mobile ────────────────────────────────── */
@media (max-width: 1023px) {
    .toolbar.toolbar-products {
        padding:   8px 10px;
        gap:       6px;
        flex-wrap: nowrap;
        border-radius: 8px;
    }

    /* Hide verbose / wordy elements — display:none needs !important to override Magento show rules */
    .toolbar-amount,
    .toolbar-products .limiter,
    .toolbar-sorter .sorter-label,
    .toolbar-sorter .sorter-action,
    .modes-label { display: none !important; }

    /* Modes toggle — compact */
    .modes { flex-shrink: 0; padding: 1px; }
    .modes-mode {
        width:  34px;
        height: 30px;
    }
    .modes-mode::before { font-size: 15px !important; }

    /* Sorter takes all remaining space */
    .toolbar-sorter { flex: 1 1 auto; margin: 0; }
    .toolbar-sorter select,
    .sorter-options {
        width:     100%;
        padding:   7px 8px;
        font-size: 13px;
    }
}

/* ── Product cards — mobile ────────────────────────────────────── */
@media (max-width: 767px) {

    /* Grid: 2 columns between 481–767px */
    .ss-plp { grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0 24px; }

    /* Card body: tighter padding + smaller text */
    .ss-card__body { padding: 8px 10px 6px; gap: 3px; }
    .ss-card__sku  { font-size: 9px; }
    .ss-card__name { font-size: 11.5px; -webkit-line-clamp: 2; }
    .ss-card__brand { font-size: 9.5px; }

    /* Price */
    .ss-card__price .price { font-size: 14px; }

    /* Actions */
    .ss-card__actions { padding: 0 8px 8px; gap: 5px; }
    .ss-card__btn {
        padding:   7px 8px;
        font-size: 11px;
        gap:       4px;
        border-radius: 6px;
    }
    .ss-card__btn--view { font-size: 10px; padding: 5px 8px; }

    /* List view image */
    .ss-plp--list .ss-card__img-wrap { width: 90px; min-height: 90px; }
    .ss-plp--list .ss-card__name     { font-size: 12px; }
    .ss-plp--list .ss-card__actions  { min-width: 110px; padding: 10px; }
}

/* ── Single column below 400px ─────────────────────────────────── */
@media (max-width: 400px) {
    .ss-plp { grid-template-columns: 1fr; gap: 10px; }
}

/* ── Pagination ───────────────────────────────────────────────── */
/* ── Bottom pager wrapper ─────────────────────────────────────── */
.ss-plp-pager {
    display: flex;
    justify-content: center;
    padding: 10px 20px;
    margin-top: 8px;
    background: var(--ss-white);
    border: 1px solid var(--ss-border);
    border-radius: 8px;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, .06);
}

/* ── Pagination — full override scoped to category pages ──────────
   .catalog-category-view body class (3-class specificity) beats Magento's
   2-class selectors without needing !important on most properties.
   Exceptions kept with !important: font-size and letter-spacing where Blank
   uses the font-size:0 whitespace trick with its own !important, and
   display/float overrides where Blank uses inline-block layout. */
.catalog-category-view .pages {
    display: flex;
    justify-content: center;
    margin: 0;
}
.catalog-category-view .pages-label { display: none !important; }

/* Blank theme sets font-size:0 and letter-spacing:-1em on .items to kill
   whitespace between inline-block children — override requires !important */
.catalog-category-view .pages .items {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px !important;
    letter-spacing: normal !important;
    white-space: normal;
}
.catalog-category-view .pages .item {
    font-size: 14px;
    line-height: 1;
    letter-spacing: normal !important;
    margin: 0;
    display: inline-flex !important;
    align-items: center;
}

/* Page number links and current page */
.catalog-category-view .pages .item > a.page,
.catalog-category-view .pages .item > strong.page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-family: var(--ss-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.catalog-category-view .pages .item > a.page { color: var(--ss-blue); cursor: pointer; }
.catalog-category-view .pages .item > a.page:visited { color: var(--ss-blue); }
.catalog-category-view .pages .item > a.page:hover { background: #e8f0fe; text-decoration: none; }
.catalog-category-view .pages .item > a.page .label,
.catalog-category-view .pages .item > strong.page .label { display: none; }
.catalog-category-view .pages .item.current > strong.page {
    color: #0f172a;
    font-weight: 700;
    background: #f1f5f9;
    cursor: default;
}

/* Prev / Next — Blank theme renders these as inline-block with icon font.
   display:inline-flex needs !important to override Blank's inline-block.
   background and border need !important because Blank sets button backgrounds. */
.catalog-category-view .pages .action.previous,
.catalog-category-view .pages .action.next {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 12px;
    font-family: var(--ss-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-ink-2);
    text-decoration: none;
    background: none !important;
    border: 1px solid var(--ss-border);
    border-radius: 6px;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
    box-shadow: none !important;
}
.catalog-category-view .pages .action.previous:hover,
.catalog-category-view .pages .action.next:hover {
    color: var(--ss-blue);
    background: #e8f0fe !important;
    border-color: var(--ss-blue);
    text-decoration: none;
}
/* CSS chevron arrows — no font dependency, renders correctly on all devices */
.catalog-category-view .pages .action.previous::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    border-right: none;
    border-bottom: none;
    transform: rotate(-45deg) translateY(1px);
    margin-right: 4px;
    flex-shrink: 0;
    align-self: center;
    background: none;
}
.catalog-category-view .pages .action.next::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    border-left: none;
    border-bottom: none;
    transform: rotate(45deg) translateY(1px);
    margin-left: 4px;
    flex-shrink: 0;
    align-self: center;
    background: none;
}

/* ── Empty state ──────────────────────────────────────────────── */
.ss-plp-empty {
    text-align: center;
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.ss-plp-empty__title {
    font-family: var(--ss-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.ss-plp-empty__sub {
    font-size: 1.4rem;
    color: #6b7280;
    margin: 0;
}

/* ── Category hero title ──────────────────────────────────────── */
.page-title-wrapper .page-title {
    font-family: var(--ss-font);
    font-size: 2.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.4px;
}

/* ── Layered navigation sidebar ───────────────────────────────── */
.filter-title strong {
    font-family: var(--ss-font);
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #0f172a;
}
.filter-options-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 10px;
}
/* Magento sets overflow:hidden on filter items — need !important to allow swatch overflow */
.filter-options-item {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
    margin-bottom: 6px;
    overflow: visible !important;
}
.filter-options-content {
    overflow: visible !important;
    padding-bottom: 4px;
}
.swatch-attribute-options {
    padding-bottom: 6px;
    overflow: visible !important;
}
.swatch-option {
    height: auto;
    min-height: 28px;
    line-height: 26px;
    overflow: visible !important;
    padding: 0 8px;
}
.filter-options-content a:not(.swatch-option-link-layered),
.filter-options-content .item a {
    color: #374151;
    font-size: 1.3rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}
.filter-options-content a:hover { color: var(--ss-blue); }
.filter-count-label { color: var(--ss-ink-3); font-size: 1.1rem; }

/* Back link on empty state */
.ss-plp-empty__back {
    display: inline-block;
    margin-top: 16px;
    color: var(--ss-blue);
    font-size: 13px;
    text-decoration: none;
    font-family: var(--ss-font);
}
.ss-plp-empty__back:hover { text-decoration: underline; }
