/*
 * Tuotekatalogi – catalog.css
 * archive-product.php: hero, sidebar, toolbar, gridi/lista, paginointi
 *
 * Design tokens peritään pää-style.css:stä (:root)
 *
 * @package B2B-Kauppa
 */

/* =============================================
   CATALOG HERO
   ============================================= */
.catalog-hero {
    background: url('/wp-content/uploads/2026/03/Hero-bg-8-1.jpg') center center / cover no-repeat;
    padding: 230px 0 36px;
    position: relative;
}
.catalog-hero .container {
    position: relative;
    z-index: 1;
}

/* Breadcrumbs */
.catalog-hero__crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.catalog-hero__crumbs a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.15s;
}
.catalog-hero__crumbs a:hover {
    color: var(--white);
}
.catalog-hero__crumbs-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
}

.catalog-hero__title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin: 0;
}
/* Hero body – split: otsikko vasemmalla, kuvaus oikealla */
.catalog-hero__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.catalog-hero__body--split {
    flex-direction: row;
    align-items: baseline;
    gap: 40px;
}
.catalog-hero__body--split .catalog-hero__title {
    flex: 0 0 40%;
}
.catalog-hero__body--split .catalog-hero__desc {
    margin-top: 0;
    flex: 1;
    min-width: 0;
}

/* Hero description – line-clamp + "Lue lisää" */
.catalog-hero__desc {
    margin-top: 8px;
    max-width: 700px;
}
.catalog-hero__desc-content {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.catalog-hero__desc-content p {
    margin: 0 0 0.5em;
}
.catalog-hero__desc-content p:last-child {
    margin-bottom: 0;
}
.catalog-hero__desc-content a {
    color: var(--white);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s, color 0.2s;
}
.catalog-hero__desc-content a:hover {
    text-decoration-color: var(--white);
    color: var(--white);
}
/* Avautumisanimaatio: line-clamp ei tue transition → käytetään max-height */
.catalog-hero__desc:not(.is-open) .catalog-hero__desc-content {
    max-height: 3.2em; /* 2 riviä × 1.6 line-height */
    transition: max-height 0.4s var(--ease);
}
.catalog-hero__desc.is-open .catalog-hero__desc-content {
    -webkit-line-clamp: unset;
    display: block;
    max-height: 600px;
    transition: max-height 0.5s var(--ease);
}
/* Toggle-linkki */
.catalog-hero__desc-toggle {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.15s;
    margin-top: 4px;
}
.catalog-hero__desc-toggle:hover {
    color: var(--white);
}
.catalog-hero__desc-toggle-less {
    display: none;
}
.catalog-hero__desc.is-open .catalog-hero__desc-toggle-more {
    display: none;
}
.catalog-hero__desc.is-open .catalog-hero__desc-toggle-less {
    display: inline;
}
/* Piilota toggle jos sisältö mahtuu */
.catalog-hero__desc.no-overflow .catalog-hero__desc-toggle {
    display: none;
}

/* =============================================
   CATALOG LAYOUT (sidebar + content)
   ============================================= */
.catalog {
    padding: 28px 0 60px;
    background: var(--white);
    min-height: 60vh;
}
.catalog__layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
}
.catalog__layout--no-sidebar {
    grid-template-columns: 1fr;
}

/* =============================================
   SIDEBAR
   ============================================= */
.catalog__sidebar {
    position: sticky;
    top: 200px;
    align-self: start;
    max-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
}
.catalog__sidebar-inner {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}
/* Bottom fade inside the panel */
.catalog__sidebar-inner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--white) 70%);
    border-radius: 0 0 var(--radius) var(--radius);
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s;
}
.catalog__sidebar-inner.is-scrolled-end::after {
    opacity: 0;
}
.catalog__sidebar-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 20px;
    scrollbar-width: none; /* Firefox */
}
.catalog__sidebar-scroll::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Custom scrollbar – aina näkyvissä */
.catalog__scrollbar {
    position: absolute;
    top: 60px; bottom: 8px; left: 6px;
    width: 6px;
    z-index: 3;
}
.catalog__scrollbar-track {
    position: absolute;
    inset: 0;
    background: var(--gray-200);
    border-radius: 3px;
}
.catalog__scrollbar-thumb {
    position: absolute;
    top: 0;
    width: 100%;
    min-height: 32px;
    background: var(--gray-400);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}
.catalog__scrollbar-thumb:hover,
.catalog__scrollbar-thumb.is-dragging {
    background: var(--gray-500);
}

.catalog__sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0 20px;
    margin-bottom: 0;
}
.catalog__sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.catalog__sidebar-close {
    display: none; /* Desktop: piilotettu */
    background: none;
    border: none;
    color: var(--gray-500);
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
}
.catalog__sidebar-close:hover {
    background: var(--gray-100);
}

/* Filter groups */
.catalog__filter-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-100);
}
.catalog__filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.catalog__filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* FacetWP placeholder */
.catalog__filter-placeholder {
    text-align: center;
    padding: 28px 16px;
    color: var(--gray-400);
    font-size: 14px;
    line-height: 1.5;
}
.catalog__filter-placeholder svg {
    margin-bottom: 12px;
}
.catalog__filter-placeholder p {
    margin: 0;
}

/* Demo filtterit (placeholder kun FacetWP-fasetit tyhjät) */
.catalog__demo-filters {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.catalog__demo-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--gray-600);
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    line-height: 1.4;
}
.catalog__demo-checkbox:hover {
    background: var(--gray-50);
    color: var(--text);
}
.catalog__demo-check {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    transition: all 0.15s;
}
.catalog__demo-checkbox:hover .catalog__demo-check {
    border-color: var(--navy);
}
.catalog__demo-text {
    flex: 1;
}
.catalog__demo-count {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    background: var(--gray-100);
    padding: 1px 7px;
    border-radius: var(--pill);
    min-width: 22px;
    text-align: center;
    line-height: 1.5;
}

/* Manual category links (fallback) */
.catalog__cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.catalog__cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--gray-600);
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.catalog__cat-link:hover {
    background: var(--gray-50);
    color: var(--text);
}
.catalog__cat-link--active {
    background: var(--navy);
    color: var(--white);
    font-weight: 600;
}
.catalog__cat-link--active:hover {
    background: var(--navy-light);
    color: var(--white);
}
.catalog__cat-count {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    background: var(--gray-100);
    padding: 1px 7px;
    border-radius: var(--pill);
    min-width: 24px;
    text-align: center;
}
.catalog__cat-link--active .catalog__cat-count {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

/* Overlay (mobile sidebar) */
.catalog__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.catalog__overlay--active {
    display: block;
}

/* =============================================
   FACETWP – OVERRIDE-TYYLIT
   ============================================= */

/* ── Piilota tyhjät ── */
.catalog__filter-group .facetwp-facet:empty { display: none; }
.catalog__filter-group:has(.facetwp-facet:empty) { display: none; }
.catalog__filter-group:has(.fs-options:empty) { display: none; }
.catalog__filter-group:has(.facetwp-type-checkboxes:empty) { display: none; }
.facetwp-type-fselect:has(.fs-options:empty) { display: none; }

/* ── Yhteinen ── */
.catalog__filter-group .facetwp-facet {
    margin-bottom: 0;
}

/* ── Checkboxes (categories) ── */
.catalog__filter-group .facetwp-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--gray-600);
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    line-height: 1.4;
    background: none;
    margin: 0;
}
.catalog__filter-group .facetwp-checkbox:hover {
    background: var(--gray-50);
    color: var(--text);
}
.catalog__filter-group .facetwp-checkbox.checked {
    background: rgba(17, 57, 103, 0.06);
    color: var(--navy);
    font-weight: 600;
}
.catalog__filter-group .facetwp-checkbox svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    transition: all 0.15s;
}
.catalog__filter-group .facetwp-checkbox.checked svg {
    background: var(--navy);
    border-color: var(--navy);
}
.catalog__filter-group .facetwp-counter {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    background: var(--gray-100);
    padding: 1px 7px;
    border-radius: var(--pill);
    margin-left: auto;
    min-width: 22px;
    text-align: center;
    line-height: 1.5;
}
.catalog__filter-group .facetwp-checkbox.checked .facetwp-counter {
    background: rgba(17, 57, 103, 0.12);
    color: var(--navy);
}

/* ── fSelect: alkuperäinen toimiva tyyli ── */
.fs-label-wrap {
    position: relative;
    background-color: var(--white);
    border: 1.5px solid var(--gray-200);
    cursor: default;
    border-radius: 10px;
    padding: 10px 36px 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.2s;
}
.fs-label-wrap:hover {
    border-color: var(--gray-400);
}
.fs-wrap.fs-open .fs-label-wrap {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(17, 57, 103, 0.08);
}
.fs-arrow {
    right: 14px !important;
}
.fs-dropdown {
    width: 100%;
    position: absolute;
    background-color: var(--white);
    border: 1.5px solid var(--gray-200);
    border-top: 1px solid var(--gray-100) !important;
    z-index: 50 !important;
    margin-top: 4px;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.fs-search {
    border-radius: 0;
}
.fs-search input {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text);
    outline: none;
    background: var(--gray-50);
}
.fs-search input::placeholder {
    color: var(--gray-400);
}
.fs-options {
    max-height: 220px;
    overflow-y: auto;
}
.fs-option {
    padding: 10px 12px !important;
    font-size: 13px;
    color: var(--gray-600);
    transition: background 0.12s, color 0.12s;
}
.fs-option:hover {
    background: var(--gray-50);
    color: var(--text);
}
.fs-option.selected {
    background: rgba(17, 57, 103, 0.06);
    color: var(--navy);
    font-weight: 600;
}
.fs-wrap.multiple .fs-option.selected .fs-checkbox i {
    background-color: var(--navy) !important;
}
.facetwp-facet.facetwp-type-fselect .fs-wrap.multiple .fs-option.selected .fs-checkbox i:before {
    display: block;
    position: absolute;
    left: 2px;
    top: 0.5px;
    width: 8px;
    height: 8px;
    line-height: 7px;
    filter: invert(1);
    content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNS4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTE3My45IDQzOS40bC0xNjYuNC0xNjYuNGMtMTAtMTAtMTAtMjYuMiAwLTM2LjJsMzYuMi0zNi4yYzEwLTEwIDI2LjItMTAgMzYuMiAwTDE5MiAzMTIuNyA0MzIuMSA3Mi42YzEwLTEwIDI2LjItMTAgMzYuMiAwbDM2LjIgMzYuMmMxMCAxMCAxMCAyNi4yIDAgMzYuMmwtMjk0LjQgMjk0LjRjLTEwIDEwLTI2LjIgMTAtMzYuMiAweiIvPjwvc3ZnPg==");
}
.fs-no-results {
    padding: 16px 12px;
    font-size: 13px;
    color: var(--gray-400);
    text-align: center;
}

/* ── Nollausnappi ── */
.catalog__filter-reset {
    padding-top: 16px;
    margin-top: 4px;
}
.catalog__reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--pill);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    width: 100%;
    justify-content: center;
}
.catalog__reset-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: rgba(17, 57, 103, 0.03);
}
.catalog__reset-btn svg {
    flex-shrink: 0;
}

/* ── FacetWP paginointi ── */
.facetwp-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}
.facetwp-pager .facetwp-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--gray-500);
    background: transparent;
    border: none;
    border-radius: var(--pill);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.facetwp-pager .facetwp-page:hover {
    background: var(--gray-100);
    color: var(--text);
}
.facetwp-pager .facetwp-page.active {
    background: var(--navy);
    color: var(--white);
    font-weight: 700;
}
.facetwp-pager .facetwp-page.prev,
.facetwp-pager .facetwp-page.next {
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
}
.facetwp-pager .facetwp-page.prev:hover,
.facetwp-pager .facetwp-page.next:hover {
    background: var(--navy);
    color: var(--white);
}

/* FacetWP loading -tila */
.facetwp-template {
    transition: opacity 0.2s;
}
body.facetwp-is-loading .facetwp-template {
    opacity: 0.5;
    pointer-events: none;
}

/* =============================================
   TOOLBAR
   ============================================= */
.catalog__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    scroll-margin-top: 200px;
}
.catalog__toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.catalog__toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* "Rajaa" -nappi (vain mobile) */
.catalog__filter-btn {
    display: none; /* Desktop: piilotettu */
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--pill);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s;
}
.catalog__filter-btn:hover {
    border-color: var(--gray-400);
}

/* Tuotemäärä */
.catalog__count {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

/* View toggle (gridi/lista) */
.catalog__view-toggle {
    display: flex;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}
.catalog__view-btn {
    background: none;
    border: none;
    padding: 7px 10px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}
.catalog__view-btn:hover {
    color: var(--text);
}
.catalog__view-btn--active {
    background: var(--navy);
    color: var(--white);
}
.catalog__view-btn--active:hover {
    color: var(--white);
}

/* WC:n oma ordering-form */
.catalog__toolbar .woocommerce-ordering {
    margin: 0;
}
.catalog__toolbar .woocommerce-ordering select,
.catalog__orderby-select {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 7px 32px 7px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s;
}
.catalog__toolbar .woocommerce-ordering select:hover,
.catalog__orderby-select:hover {
    border-color: var(--gray-400);
}
.catalog__toolbar .woocommerce-ordering select:focus-visible,
.catalog__orderby-select:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* =============================================
   CATALOG GRID (pc-card -komponentit)
   ============================================= */
.catalog__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Kuva: contain + keskitetty – luodinkestävä */
.catalog__grid .pc-card__media-clip {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.catalog__grid .pc-card__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    padding: 0;
    background: var(--white);
}

/* Katalogi: nappi ja cart-link kuva-alueelle */
.catalog__grid .pc-card__action {
    bottom: 156px;
    left: 12px;
}
.catalog__grid .pc-card__cart-link {
    bottom: 120px;
}

/* =============================================
   CATALOG LIST (lc-card -komponentit)
   ============================================= */
.catalog__list--hidden {
    display: none;
}

.catalog__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Listakortti (lc-card) ── */
.lc-card {
    position: relative;
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 12px 0;
    transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.lc-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
}

.lc-card__link {
    display: grid;
    grid-template-columns: 180px 1fr auto;
    grid-template-rows: 1fr;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 1;
}

/* Kuva – luodinkestävä contain: ei ikinä ylitä laatikkoaan */
.lc-card__media {
    position: relative;
    background: var(--white);
    border-radius: var(--radius) 0 0 var(--radius);
    overflow: hidden;
}
.lc-card__media-clip {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.lc-card__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}
.lc-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: var(--orange);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--pill);
}

/* Body */
.lc-card__body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0; /* Prevent overflow */
}
.lc-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 2px;
}
.lc-card__brand {
    font-weight: 500;
}
.lc-card__sku {
    font-weight: 400;
    font-family: monospace;
    font-size: 11px;
}
.lc-card__name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lc-card__desc-wrap {
    position: relative;
    margin: 2px 0 0;
}
.lc-card__desc {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lc-card__desc.is-open {
    display: block;
    -webkit-line-clamp: unset;
}
.lc-card__desc-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--navy);
    cursor: pointer;
    margin-top: 2px;
    transition: color 0.15s;
    position: relative;
    z-index: 2;
}
.lc-card__desc-toggle:hover {
    color: var(--orange);
}

/* Features (tekniset pointit) – 2-sarakkinen lista */
.lc-card__features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 20px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}
.lc-card__feature {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.lc-card__feature::before {
    content: '•';
    color: var(--gray-300);
    font-size: 10px;
    flex-shrink: 0;
}
.lc-card__feature-label {
    font-weight: 600;
    color: var(--gray-600);
}
.lc-card__feature-value {
    font-weight: 400;
}

/* Stock */
.lc-card__stock {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
    width: fit-content;
}
.lc-card__stock--in {
    color: #16a34a;
}
.lc-card__stock--back {
    color: var(--orange);
}
.lc-card__stock--out {
    color: #dc2626;
}

/* Aside (hinta) */
.lc-card__aside {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 160px;
}
.lc-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}
.lc-card__price-current {
    font-size: 18px;
    font-weight: 700;
    color: var(--orange);
    line-height: 1.2;
    white-space: nowrap;
}
.lc-card__price-old {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-400);
    text-decoration: line-through;
    line-height: 1.2;
    white-space: nowrap;
}
.lc-card__rfq-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}

/* Toimintonappi (listakortissa) — absolute oikea alanurkka */
.lc-card__action {
    position: absolute;
    bottom: 14px;
    right: 16px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--pill);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(255, 85, 0, 0.25);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.lc-card__action svg {
    flex-shrink: 0;
}
.lc-card__action-default {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.lc-card__action:hover {
    background: var(--orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 85, 0, 0.35);
}
.lc-card__action:active {
    transform: scale(0.97);
}
.lc-card__action--rfq {
    background: var(--gray-800);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}
.lc-card__action--rfq:hover {
    background: var(--navy);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}




/* =============================================
   CARD ADD-TO-CART STATES
   ============================================= */
@keyframes cardSpin { to { transform: rotate(360deg); } }

/* Action-icon: flex-keskitys pyöreän napin sisällä */
.pc-card__action-icon,
.lc-card__action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grid nappi tilat — WC natiivi .loading/.added + fallback .is-loading/.is-done */
.pc-card__action-spinner, .pc-card__action-done { display: none; }
.pc-card__action-spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: cardSpin 0.6s linear infinite;
}
.pc-card__action-done svg { width: 18px; height: 18px; }
/* Loading: WC lisää .loading automaattisesti */
.pc-card__action.loading .pc-card__action-icon,
.pc-card__action.is-loading .pc-card__action-icon { display: none; }
.pc-card__action.loading .pc-card__action-spinner,
.pc-card__action.is-loading .pc-card__action-spinner { display: block; }
.pc-card__action.loading,
.pc-card__action.is-loading { pointer-events: none; opacity: 0.85; }
/* Piilota tooltip latauksen ja lisäyksen aikana */
.pc-card__action.loading .pc-card__tooltip,
.pc-card__action.added .pc-card__tooltip { display: none; }
/* Done: WC lisää .added automaattisesti */
.pc-card__action.added .pc-card__action-icon,
.pc-card__action.is-done .pc-card__action-icon { display: none; }
.pc-card__action.added .pc-card__action-spinner,
.pc-card__action.is-done .pc-card__action-spinner { display: none; }
.pc-card__action.added .pc-card__action-done,
.pc-card__action.is-done .pc-card__action-done { display: flex; align-items: center; justify-content: center; }
.pc-card__action.added,
.pc-card__action.is-done {
    background: #16a34a;
    color: var(--white);
    border: none;
    outline: none;
    box-shadow: 0 3px 12px rgba(22, 163, 74, 0.3);
}
.pc-card__action.added:hover,
.pc-card__action.is-done:hover {
    background: #15803d;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.4);
    transform: scale(1.1);
}
/* Checkmark SVG: fill: none pakottaen, muuten parent .pc-card__action svg { fill: white } piirtää kolmion */
.pc-card__action-done svg {
    width: 18px;
    height: 18px;
    stroke: var(--white);
    fill: none !important;
}
/* Resetoi a-elementin oletustyylit */
a.pc-card__action,
a.pc-card__action:visited,
a.pc-card__action:focus {
    text-decoration: none;
    outline: none;
    border: none;
    color: var(--white);
}

/* Piilota WC:n automaattisesti lisäämä "Näytä ostoskori" -linkki globaalisti */
.pc-card .added_to_cart,
.lc-card .added_to_cart,
.lc-card__aside .added_to_cart {
    display: none !important;
}

/* Grid: Katso kori — näkyy kun WC lisää .added napin yläpuolelle */
.pc-card__cart-link {
    position: absolute;
    bottom: 120px; left: 50%;
    transform: translateX(-50%) translateY(4px);
    display: none; align-items: center; gap: 3px;
    font-size: 12px; font-weight: 600; color: var(--navy);
    background: var(--white); padding: 4px 10px;
    border-radius: var(--pill);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: nowrap; text-decoration: none; z-index: 10;
    opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
.pc-card__cart-link:hover { color: var(--orange); }
.pc-card__cart-link:hover svg { transform: translateX(2px); }
.pc-card__cart-link svg { transition: transform 0.15s; }
/* Näytetään kun sisarus-napilla on .added (WC natiivi) tai .is-visible (legacy) */
.pc-card__action.added ~ .pc-card__cart-link,
.pc-card__cart-link.is-visible {
    display: inline-flex; opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Poistetaan erillinen cart-link — done-tila hoitaa */
.lc-card__action-spinner, .lc-card__action-done { display: none; }
.lc-card__action-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: cardSpin 0.6s linear infinite;
}
.lc-card__action-done { align-items: center; gap: 6px; }
.lc-card__cart-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--white);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}
.lc-card__cart-link:hover { color: var(--white); }
.lc-card__cart-link svg { flex-shrink: 0; transition: transform 0.15s; }
.lc-card__cart-link:hover svg { transform: translateX(2px); }
/* Loading: WC natiivi .loading */
.lc-card__action.loading .lc-card__action-default,
.lc-card__action.is-loading .lc-card__action-default { display: none; }
.lc-card__action.loading .lc-card__action-spinner,
.lc-card__action.is-loading .lc-card__action-spinner { display: inline-block; }
.lc-card__action.loading,
.lc-card__action.is-loading { pointer-events: none; opacity: 0.85; }
/* Done: WC natiivi .added — nappi muuttuu "Katso kori" -linkiksi */
.lc-card__action.added .lc-card__action-default,
.lc-card__action.is-done .lc-card__action-default { display: none; }
.lc-card__action.added .lc-card__action-spinner,
.lc-card__action.is-done .lc-card__action-spinner { display: none; }
.lc-card__action.added .lc-card__action-done,
.lc-card__action.is-done .lc-card__action-done { display: inline-flex; }
.lc-card__action.added,
.lc-card__action.is-done {
    background: #16a34a;
    box-shadow: 0 3px 12px rgba(22, 163, 74, 0.3);
    pointer-events: auto;
}
.lc-card__action.added:hover,
.lc-card__action.is-done:hover {
    background: #15803d;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.4);
}

/* Piilota WC:n automaattisesti lisäämä "Näytä ostoskori" -linkki */
.lc-card__aside .added_to_cart,
.lc-card .added_to_cart {
    display: none !important;
}
/* Poistetaan erillinen cart-link — done-tila hoitaa kaiken */

/* =============================================
   VIEW SWITCH – animaatio
   ============================================= */
@keyframes catalogFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.catalog__grid.is-entering,
.catalog__list.is-entering {
    animation: catalogFadeIn 0.3s var(--ease) both;
}
.catalog__grid.is-entering .pc-card,
.catalog__list.is-entering .lc-card {
    animation: catalogFadeIn 0.35s var(--ease) both;
}
.catalog__grid.is-entering .pc-card:nth-child(2),
.catalog__list.is-entering .lc-card:nth-child(2) { animation-delay: 60ms; }
.catalog__grid.is-entering .pc-card:nth-child(3),
.catalog__list.is-entering .lc-card:nth-child(3) { animation-delay: 120ms; }
.catalog__grid.is-entering .pc-card:nth-child(4),
.catalog__list.is-entering .lc-card:nth-child(4) { animation-delay: 180ms; }
.catalog__grid.is-entering .pc-card:nth-child(5),
.catalog__list.is-entering .lc-card:nth-child(5) { animation-delay: 240ms; }
.catalog__grid.is-entering .pc-card:nth-child(6),
.catalog__list.is-entering .lc-card:nth-child(6) { animation-delay: 300ms; }
.catalog__grid.is-entering .pc-card:nth-child(7),
.catalog__list.is-entering .lc-card:nth-child(7) { animation-delay: 360ms; }
.catalog__grid.is-entering .pc-card:nth-child(8),
.catalog__list.is-entering .lc-card:nth-child(8) { animation-delay: 420ms; }
.catalog__grid.is-entering .pc-card:nth-child(n+9),
.catalog__list.is-entering .lc-card:nth-child(n+9) { animation-delay: 480ms; }

/* =============================================
   SUBCATEGORIES CAROUSEL
   ============================================= */
.subcats {
    padding: 24px 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-100);
}
.subcats__carousel {
    position: relative;
}
.subcats__track {
    display: flex;
    gap: 12px;
    overflow: hidden;
    scroll-behavior: smooth;
    padding: 6px 0 8px;
    margin: -6px 0 -8px;
    position: relative;
    z-index: 0;
}
/* Fade molemmat reunat */
.subcats__carousel::before,
.subcats__carousel::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s;
}
.subcats__carousel::before {
    left: 0;
    background: linear-gradient(to right, var(--white) 0%, transparent 100%);
}
.subcats__carousel::after {
    right: 0;
    background: linear-gradient(to left, var(--white) 0%, transparent 100%);
}
.subcats__carousel.has-scroll-right::after {
    opacity: 1;
}
.subcats__carousel.has-scroll-left::before {
    opacity: 1;
}
.subcats__card {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100px;
    padding: 0 20px 0 0;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
    min-width: 200px;
}
.subcats__card:hover {
    border-color: var(--navy);
    box-shadow: 0 4px 16px rgba(17, 57, 103, 0.12);
    transform: translateY(-2px);
}
.subcats__card:hover .subcats__card-name {
    color: var(--navy);
}
.subcats__card-img {
    flex-shrink: 0;
    width: 100px;
    height: 100%;
    border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px);
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.subcats__card-img img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.subcats__card--no-img {
    padding: 0 24px;
    justify-content: center;
    min-width: 160px;
}
.subcats__card--no-img .subcats__card-body {
    text-align: center;
}
.subcats__card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.subcats__card-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    transition: color 0.2s;
}
.subcats__card-count {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 500;
}
.subcats__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: 50%;
    color: var(--gray-600);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s var(--ease);
    z-index: 5;
}
.subcats__arrow:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(17, 57, 103, 0.25);
}
.subcats__arrow--prev {
    left: -4px;
}
.subcats__arrow--next {
    right: -4px;
}
.subcats__arrow[hidden] {
    display: none;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.catalog__empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
    font-size: 15px;
}
.catalog__empty svg {
    margin-bottom: 16px;
}
.catalog__empty p {
    margin: 0 0 20px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 1060px) {
    .catalog__grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .lc-card__link {
        grid-template-columns: 150px 1fr auto;
    }
    .lc-card__features {
        grid-template-columns: 1fr;
    }
    .lc-card__aside {
        min-width: 120px;
        padding: 14px 16px;
    }
}

/* Sidebar piiloon → mobile overlay */
@media (max-width: 960px) {
    .catalog__layout {
        grid-template-columns: 1fr;
    }

    /* Sidebar: slide-in overlay */
    .catalog__sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        max-height: none;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease);
        background: var(--white);
        overflow-y: auto;
        border-radius: 0;
    }
    .catalog__sidebar--open {
        transform: translateX(0);
    }
    .catalog__sidebar-inner {
        border: none;
        border-radius: 0;
        min-height: 100%;
        overflow: visible;
    }
    .catalog__sidebar-inner::after {
        display: none;
    }
    .catalog__sidebar-scroll {
        overflow-y: visible;
        padding: 0 20px 20px;
    }
    .catalog__scrollbar {
        display: none;
    }
    .catalog__sidebar-close {
        display: flex;
    }

    /* "Rajaa" -nappi näkyviin */
    .catalog__filter-btn {
        display: inline-flex;
    }
}

/* Small tablet / large mobile */
@media (max-width: 768px) {
    .catalog-hero {
        padding: 100px 0 28px;
    }
    .subcats { padding: 16px 0; }
    .subcats__track { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .subcats__track::-webkit-scrollbar { display: none; }
    .subcats__card { height: 80px; min-width: 170px; }
    .subcats__card-img { width: 80px; }
    .subcats__card-name { font-size: 13px; }
    .subcats__arrow { width: 30px; height: 30px; }
    .subcats__arrow--prev { left: -6px; }
    .subcats__arrow--next { right: -6px; }
    .catalog-hero__title {
        font-size: 22px;
    }
    .catalog-hero__body--split {
        flex-direction: column;
        gap: 6px;
    }
    .catalog-hero__body--split .catalog-hero__desc {
        max-width: 600px;
    }
    .catalog {
        padding: 20px 0 48px;
    }
    .catalog__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Listanäkymä: piilotetaan toggle, vain gridi */
    .catalog__view-toggle {
        display: none;
    }

    /* Lista-kortti: stacked layout */
    .lc-card__link {
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto;
    }
    .lc-card__media {
        grid-row: 1 / 3;
    }
    .lc-card__aside {
        align-items: flex-start;
        min-width: unset;
        padding: 0 14px 14px;
    }
    .lc-card__body {
        padding: 12px 14px 6px;
    }
    .lc-card__desc {
        -webkit-line-clamp: 2;
    }
    .lc-card__features {
        grid-template-columns: 1fr;
    }
    .lc-card__action {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Mobile */
@media (max-width: 560px) {
    .catalog-hero {
        padding: 90px 0 24px;
    }
    .catalog__grid {
        gap: 10px;
    }
    .catalog__toolbar {
        gap: 8px;
    }
    .catalog__orderby-select {
        font-size: 12px;
        padding: 6px 28px 6px 10px;
    }
    .catalog__count {
        font-size: 12px;
    }

    /* Lista: compact */
    .lc-card__link {
        grid-template-columns: 100px 1fr;
    }
    .lc-card__name {
        font-size: 14px;
    }
    .lc-card__price-current {
        font-size: 15px;
    }
}
/* ── Second Description (SEO) ── */
.catalog__seo-desc {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.75;
}
.catalog__seo-desc h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.75em;
}
.catalog__seo-desc h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-600);
    margin: 1.5em 0 0.5em;
}
.catalog__seo-desc h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    margin: 1.25em 0 0.5em;
}
.catalog__seo-desc p {
    margin: 0 0 0.75em;
}
.catalog__seo-desc a {
    color: var(--navy);
    text-decoration: underline;
    text-decoration-color: rgba(17, 57, 103, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s, color 0.2s;
}
.catalog__seo-desc a:hover {
    color: var(--orange);
    text-decoration-color: var(--orange);
}
.catalog__seo-desc ul,
.catalog__seo-desc ol {
    padding-left: 1.4em;
    margin: 0 0 0.75em;
}
.catalog__seo-desc li {
    margin-bottom: 0.25em;
}
.catalog__seo-desc strong {
    color: var(--gray-600);
    font-weight: 600;
}
.catalog__seo-desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1em 0;
}