/* Skārdnieks — product category page (Figma "Kataloga lapa (PLP)" 430:575). Builds on home/projects/product CSS. */

/* ---------- Intro ---------- */
.sk-plp-intro { padding-top: 40px; }
.sk-plp-intro .sk-container { display: grid; gap: 32px; }
.sk-plp-intro__head { display: grid; gap: 16px; }
.sk-plp-intro__title { font-size: 48px; font-weight: 700; line-height: 56px; text-transform: uppercase; color: var(--sk-ink); overflow-wrap: break-word; }
.sk-plp-intro__text { font-size: 16px; line-height: 24px; color: #616161; }
.sk-usp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 24px 32px; background: var(--sk-beige); }
.sk-usp li { display: flex; align-items: center; gap: 16px; min-width: 0; }
.sk-usp__icon { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--sk-yellow, #ffc700); }
.sk-usp li > span:last-child { display: grid; gap: 2px; min-width: 0; }
.sk-usp strong { font-size: 14px; line-height: 20px; color: var(--sk-ink); }
.sk-usp small { font-size: 13px; line-height: 18px; color: #616161; }
.sk-subcats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sk-subcat { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 12px 24px; border: 1px solid var(--sk-line); background: #fff; color: var(--sk-ink); font-size: 16px; font-weight: 700; line-height: 24px; text-transform: uppercase; }
.sk-subcat::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 4px; background: var(--sk-yellow, #ffc700); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.sk-subcat:hover::before, .sk-subcat:focus-visible::before { transform: scaleX(1); }
.sk-subcat img { flex-shrink: 0; transition: transform .2s; }
.sk-subcat:hover img { transform: translateX(3px); }

/* ---------- Filters ---------- */
.sk-plp-cat { padding: 40px 0 112px; }
.sk-plp-cat__inner { display: grid; gap: 24px; }
.sk-plp-cat.is-loading .sk-plp-list, .sk-plp-cat.is-loading .sk-plp-count { opacity: .45; pointer-events: none; transition: opacity .15s; }
.sk-plp-filters { display: grid; gap: 20px; padding: 24px; border: 1px solid var(--sk-line); background: #fff; }
.sk-plp-filters__row { display: flex; align-items: center; gap: 24px; }
.sk-plp-filters__label { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; line-height: 24px; text-transform: uppercase; color: var(--sk-ink); }
.sk-plp-filters__sel { width: 280px; }
.sk-plp-view { display: flex; margin-left: auto; }
.sk-plp-view button { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; border: 1px solid var(--sk-line); background: #fff; color: var(--sk-ink); cursor: pointer; }
.sk-plp-view button + button { margin-left: -1px; }
.sk-plp-view button[aria-pressed="true"] { position: relative; border-color: var(--sk-ink); background: var(--sk-ink); color: #fff; }
.sk-plp-view svg { width: 20px; height: 20px; }
.sk-plp-colors { display: grid; gap: 12px; padding-top: 20px; border-top: 1px solid var(--sk-line); }
.sk-plp-colors__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sk-plp-colors__title { font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: 1px; text-transform: uppercase; color: var(--sk-ink); }
.sk-plp-colors__links { display: flex; align-items: center; gap: 16px; }
.sk-plp-colors__clear { font-size: 13px; font-weight: 700; line-height: 18px; color: #616161; text-decoration: underline; }
.sk-plp-colors__open { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; line-height: 18px; text-transform: uppercase; color: var(--sk-red); cursor: pointer; }
.sk-plp-colors__sel { font-size: 13px; line-height: 18px; color: #616161; }
.sk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sk-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 12px; border: 1px solid var(--sk-line); background: #fff; font-size: 14px; font-weight: 400; line-height: 20px; color: var(--sk-ink); white-space: nowrap; transition: border-color .15s; }
.sk-chip:hover { border-color: var(--sk-ink); }
.sk-chip.is-active { border-color: var(--sk-ink); background: var(--sk-ink); color: #fff; font-weight: 700; }
.sk-swatch { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--c, #ddd); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.sk-chip.is-active .sk-swatch { box-shadow: 0 0 0 1.5px #fff; }
.sk-swatch--s { width: 10px; height: 10px; }
.sk-swatch--m { width: 24px; height: 24px; }
.sk-swatch--l { position: relative; width: 36px; height: 36px; }
.sk-swatch--l.is-on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sk-ink); }
.sk-swatch--l.is-on::after { content: ""; position: absolute; left: 50%; top: 45%; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translate(-50%, -50%) rotate(-45deg); }
.sk-swatch--more { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #f5f5f5; box-shadow: none; font-size: 12px; font-weight: 700; line-height: 16px; color: var(--sk-ink); }
.sk-swatches { display: block; width: 100%; padding: 4px; border: 0; background: none; text-align: left; cursor: pointer; }
:is(.sk-site, .sk-home) .sk-swatches.sk-mob-only { display: none; }
/* 8 equal slots that always fit the box (the selected ring needs the 4px padding) */
.sk-swatches > .sk-swatch { flex: 0 1 36px; width: auto; min-width: 0; height: auto; aspect-ratio: 1; }
.sk-swatches > .sk-swatch--more { display: inline-flex; font-size: 11px; }
.sk-plp-count { font-size: 14px; line-height: 20px; color: #616161; }
.sk-plp-count strong { color: var(--sk-ink); }

/* ---------- Product list (desktop) ---------- */
.sk-plp-list { --cols: 64px minmax(0, 1fr) 160px 96px 132px 264px; display: grid; border: 1px solid var(--sk-line); background: #fff; }
.sk-plp-list.no-coat { --cols: 64px minmax(0, 1fr) 0 96px 132px 264px; }
.sk-plp-list.no-thick { --cols: 64px minmax(0, 1fr) 160px 0 132px 264px; }
.sk-plp-list.no-coat.no-thick { --cols: 64px minmax(0, 1fr) 0 0 132px 264px; }
.sk-plp-list.no-coat .c-coat, .sk-plp-list.no-thick .c-thick { visibility: hidden; }
.sk-plp-list__head, .sk-plp-item { display: grid; grid-template-columns: var(--cols); gap: 24px; align-items: center; padding: 12px 16px; }
.sk-plp-list__head { padding-block: 14px; background: #f5f5f5; font-size: 12px; font-weight: 700; line-height: 16px; letter-spacing: 1px; text-transform: uppercase; color: #616161; }
.sk-plp-list__head .c-price { text-align: right; }
.sk-plp-item { min-height: 88px; border-top: 1px solid var(--sk-line); }
.sk-plp-item__img { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; background: #f5f5f5; overflow: hidden; }
.sk-plp-item__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sk-plp-item__main { display: grid; gap: 4px; min-width: 0; }
.sk-plp-item__name { font-size: 16px; font-weight: 700; line-height: 24px; color: var(--sk-ink); }
.sk-plp-item__name a:hover { color: var(--sk-red); }
.sk-plp-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 14px; line-height: 20px; color: #616161; }
.sk-plp-item__color { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.sk-plp-item__color > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-plp-item__spec { display: none; font-size: 14px; line-height: 20px; color: #616161; }
.sk-plp-item__coat, .sk-plp-item__thick { font-size: 14px; line-height: 20px; color: var(--sk-ink); }
.sk-plp-item__price { display: grid; gap: 2px; justify-items: end; text-align: right; white-space: nowrap; }
.sk-plp-item__price strong { font-size: 20px; line-height: 28px; color: var(--sk-ink); }
.sk-plp-item__price strong small { font-size: 14px; font-weight: 400; }
.sk-plp-item__price span { font-size: 12px; line-height: 16px; color: #616161; }
.sk-plp-item__buy { display: flex; gap: 24px; justify-content: flex-end; }
.sk-plp-item__cart { flex: 0 0 120px; gap: 8px; height: 44px; padding: 0 16px; }
.sk-plp-item__cart.loading { opacity: .6; pointer-events: none; }
.sk-plp-item__cart, .sk-plp-item__cart:focus, .sk-plp-item__cart.added { min-width: 0; outline: none; box-shadow: none; } /* WooCommerce/theme "added" + focus styles drew a green frame */
.sk-plp-item__cart:focus-visible { outline: 2px solid var(--sk-ink); outline-offset: 2px; }
.sk-plp-item__buy .added_to_cart { display: none; }
.sk-plp-item__more { flex: 0 0 264px; gap: 8px; height: 44px; padding: 0 16px; border-width: 1.5px; }
.sk-qty { display: flex; flex: 0 0 120px; align-items: center; height: 44px; border: 1px solid var(--sk-line); background: #fff; }
.sk-qty button { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 40px; height: 42px; padding: 0; border: 0; background: none; cursor: pointer; }
.sk-qty input { width: 100%; min-width: 0; height: 42px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; text-align: center; color: var(--sk-ink); -moz-appearance: textfield; }
.sk-qty input::-webkit-outer-spin-button, .sk-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sk-qty input:focus { outline: none; }
.sk-qty:focus-within { border-color: var(--sk-yellow, #ffc700); }
.sk-plp-empty { display: grid; justify-items: start; gap: 16px; padding: 40px 24px; border: 1px solid var(--sk-line); background: #fff; color: #616161; }

/* ---------- Grid view ---------- */
.sk-plp-grid .sk-plp-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; border: 0; background: none; }
.sk-plp-grid .sk-plp-list__head, .sk-plp-grid .c-coat, .sk-plp-grid .c-thick { display: none; }
.sk-plp-grid .sk-plp-item { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; align-items: start; gap: 8px; padding: 0 0 20px; border: 1px solid var(--sk-line); background: #fff; }
.sk-plp-grid .sk-plp-item__img { width: 100%; height: 220px; margin-bottom: 12px; padding: 16px; }
.sk-plp-grid .sk-plp-item > :not(.sk-plp-item__img) { margin-inline: 20px; }
.sk-plp-grid .sk-plp-item__name { display: -webkit-box; min-height: 48px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sk-plp-grid .sk-plp-item__spec { display: block; }
.sk-plp-grid .sk-plp-item__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; justify-items: start; padding-top: 8px; text-align: left; }
.sk-plp-grid .sk-plp-item__buy { gap: 8px; justify-content: stretch; padding-top: 8px; }
.sk-plp-grid .sk-qty { flex-basis: 112px; }
.sk-plp-grid .sk-plp-item__cart, .sk-plp-grid .sk-plp-item__more { flex: 1 1 auto; padding-inline: 12px; }

/* ---------- Pagination ---------- */
.sk-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 16px; }
.sk-pager__item, .sk-pager__gap { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 8px; font-size: 14px; font-weight: 700; line-height: 20px; color: var(--sk-ink); }
.sk-pager__item { border: 1px solid var(--sk-line); background: #fff; }
.sk-pager__item:hover { border-color: var(--sk-ink); }
.sk-pager__item.is-active { border-color: var(--sk-ink); background: var(--sk-ink); color: #fff; }

/* ---------- Colour bottom sheet (mobile) ---------- */
.sk-sheet { position: fixed; inset: 0; z-index: 1000010; }
.sk-sheet[hidden] { display: none; }
.sk-sheet__overlay { position: absolute; inset: 0; background: rgba(17, 17, 17, .5); opacity: 0; transition: opacity .2s; }
.sk-sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: 86vh; background: #fff; transform: translateY(100%); transition: transform .22s ease; }
.sk-sheet.is-open .sk-sheet__overlay { opacity: 1; }
.sk-sheet.is-open .sk-sheet__panel { transform: none; }
.sk-sheet__grip { align-self: center; width: 40px; height: 4px; margin: 8px 0 4px; border-radius: 2px; background: #ddd; }
.sk-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 16px 14px; border-bottom: 1px solid var(--sk-line); }
.sk-sheet__title { font-size: 20px; font-weight: 700; line-height: 28px; text-transform: uppercase; color: var(--sk-ink); }
.sk-sheet__sub { font-size: 13px; line-height: 18px; color: #616161; }
.sk-sheet__x { display: flex; padding: 4px; border: 0; background: none; color: var(--sk-ink); cursor: pointer; }
.sk-sheet__list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sk-sheet__opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border-bottom: 1px solid var(--sk-line); font-size: 15px; line-height: 20px; color: var(--sk-ink); cursor: pointer; }
.sk-sheet__name { flex: 1; min-width: 0; }
.sk-sheet__n { font-size: 13px; color: #616161; }
.sk-sheet__opt input { position: absolute; opacity: 0; pointer-events: none; }
.sk-sheet__box { position: relative; flex-shrink: 0; width: 24px; height: 24px; border: 1.5px solid #bdbdbd; background: #fff; }
.sk-sheet__opt input:checked ~ .sk-sheet__box { border-color: var(--sk-ink); background: var(--sk-ink); }
.sk-sheet__opt input:checked ~ .sk-sheet__box::after { content: ""; position: absolute; left: 50%; top: 45%; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translate(-50%, -50%) rotate(-45deg); }
.sk-sheet__opt:has(input:checked) .sk-sheet__name { font-weight: 700; }
.sk-sheet__opt input:focus-visible ~ .sk-sheet__box { outline: 2px solid var(--sk-yellow, #ffc700); outline-offset: 2px; }
.sk-sheet__opt.is-empty { color: #aaa; cursor: default; }
.sk-sheet__opt.is-empty .sk-swatch { opacity: .4; }
.sk-sheet__foot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--sk-line); }
.sk-sheet__foot .sk-btn { min-height: 48px; }
.sk-sheet__foot .sk-btn:disabled { opacity: .5; }

/* ---------- Tablet ---------- */
@media (max-width: 1199px) {
    .sk-plp-list { --cols: 64px minmax(0, 1fr) 120px 72px 120px 248px; }
    .sk-plp-list.no-coat { --cols: 64px minmax(0, 1fr) 0 72px 120px 248px; }
    .sk-plp-list.no-thick { --cols: 64px minmax(0, 1fr) 120px 0 120px 248px; }
    .sk-plp-list.no-coat.no-thick { --cols: 64px minmax(0, 1fr) 0 0 120px 248px; }
    .sk-plp-list__head, .sk-plp-item { gap: 16px; }
    .sk-plp-item__buy { gap: 8px; }
    .sk-plp-grid .sk-plp-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sk-plp-filters__sel { width: 220px; }
}
@media (max-width: 1023px) {
    .sk-plp-list, .sk-plp-list.no-coat, .sk-plp-list.no-thick, .sk-plp-list.no-coat.no-thick { --cols: 64px minmax(0, 1fr) 120px 248px; }
    .sk-plp-list .c-coat, .sk-plp-list .c-thick { display: none; }
    .sk-plp-item__spec { display: block; }
    .sk-plp-grid .sk-plp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sk-subcats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sk-plp-filters__row { flex-wrap: wrap; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .sk-plp-intro { padding-top: 20px; }
    .sk-plp-intro .sk-container { gap: 20px; }
    .sk-plp-intro__head { gap: 12px; }
    .sk-plp-intro__title { font-size: 32px; line-height: 40px; }
    .sk-usp { display: none; }
    .sk-subcats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .sk-subcat { min-height: 56px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
    .sk-plp-cat { padding: 24px 0 64px; }
    .sk-plp-cat__inner { gap: 16px; }
    .sk-plp-filters { gap: 16px; padding: 16px; }
    .sk-plp-filters__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
    .sk-plp-view { grid-column: 2; grid-row: 1; }
    .sk-plp-view button { width: 44px; height: 44px; }
    .sk-plp-filters__sel { grid-column: 1 / -1; width: auto; }
    .sk-plp-colors { padding-top: 16px; }
    :is(.sk-site, .sk-home) .sk-swatches.sk-mob-only { display: flex; gap: 6px; }

    /* list view → cards */
    .sk-plp-list, .sk-plp-list.no-coat, .sk-plp-list.no-thick, .sk-plp-list.no-coat.no-thick { gap: 8px; border: 0; background: none; }
    .sk-plp-list__head { display: none; }
    .sk-plp-item { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "img main" "price price" "buy buy"; gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--sk-line); background: #fff; }
    .sk-plp-item__img { grid-area: img; width: 72px; height: 72px; }
    .sk-plp-item__main { grid-area: main; gap: 2px; }
    .sk-plp-item__price { grid-area: price; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; text-align: left; }
    .sk-plp-item__price strong { font-size: 22px; }
    .sk-plp-item__buy { grid-area: buy; gap: 8px; justify-content: stretch; }
    .sk-qty { flex-basis: 120px; height: 48px; }
    .sk-qty button, .sk-qty input { height: 46px; }
    .sk-plp-item__cart, .sk-plp-item__more { flex: 1 1 auto; height: 48px; }

    /* grid view: 2 columns, button only */
    .sk-plp-grid .sk-plp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .sk-plp-grid .sk-plp-item { grid-template-areas: none; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 0 0 12px; }
    .sk-plp-grid .sk-plp-item > :not(.sk-plp-item__img) { margin-inline: 12px; }
    .sk-plp-grid .sk-plp-item__img { grid-area: auto; height: 140px; margin-bottom: 6px; padding: 8px; }
    .sk-plp-grid .sk-plp-item__main, .sk-plp-grid .sk-plp-item__price, .sk-plp-grid .sk-plp-item__buy { grid-area: auto; }
    .sk-plp-grid .sk-plp-item__name { min-height: 60px; font-size: 14px; line-height: 20px; -webkit-line-clamp: 3; } /* long names: 3 lines */
    .sk-plp-grid .sk-plp-item__meta { font-size: 12px; line-height: 16px; gap: 2px 6px; }
    .sk-plp-grid .sk-plp-item__dot { display: none; }
    .sk-plp-grid .sk-plp-item__color { flex: 1 0 100%; gap: 6px; } /* colour on its own line */
    .sk-plp-grid .sk-plp-item__spec { display: none; }
    .sk-plp-grid .sk-plp-item__price { display: grid; padding-top: 4px; }
    .sk-plp-grid .sk-plp-item__price strong { font-size: 18px; line-height: 24px; }
    .sk-plp-grid .sk-qty { display: none; }
    .sk-plp-grid .sk-plp-item__cart, .sk-plp-grid .sk-plp-item__more { height: 40px; padding-inline: 8px; font-size: 13px; }

    .sk-pager__item.is-far { display: none; }
}
