.ks-search, .ks-results {
    --ks-red: #d6281f;
    --ks-ink: #1c1d20;
    --ks-muted: #64676d;
    --ks-line: #e5e5e7;
    --ks-fill: #f6f6f7;
    color: var(--ks-ink);
    font: 15px/1.45 Arial, sans-serif;
    text-align: left;
    box-sizing: border-box;
}
.ks-search *, .ks-results * { box-sizing: border-box; }
.ks-fallback-hidden, .ks-search [hidden], .ks-results [hidden] { display: none !important; }
.ks-search :focus-visible, .ks-results :focus-visible {
    outline: 2px solid var(--ks-red);
    outline-offset: 2px;
}
.ks-search {
    position: relative;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
}
.ks-bar {
    display: flex;
    align-items: stretch;
    min-height: 48px;
    border: 1px solid var(--ks-line);
    border-radius: 8px;
    background: var(--ks-fill);
}
.ks-bar .ks-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    margin: 0;
    border: 0;
    border-radius: 8px 0 0 8px;
    background: transparent;
    color: var(--ks-ink);
    font: inherit;
    font-size: 16px;
}
.ks-input::-webkit-search-cancel-button { display: none; }
.ks-clear, .ks-submit, .ks-apply {
    border: 0;
    cursor: pointer;
    font: inherit;
    text-align: center;
}
.ks-clear { flex: 0 0 44px; color: var(--ks-muted); background: transparent; font-size: 24px; }
.ks-submit {
    flex: 0 0 106px;
    padding: 8px 12px;
    border-radius: 0 7px 7px 0;
    color: #fff;
    background: var(--ks-red);
    font-weight: bold;
}
.ks-submit:hover, .ks-apply:hover { background: #b62019; }
.ks-suggestions {
    position: absolute;
    z-index: 100;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-width: 760px;
    max-height: min(62vh, 560px);
    max-height: min(62dvh, 560px);
    overflow: auto;
    padding: 8px 12px;
    border: 1px solid var(--ks-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 26px rgb(0 0 0 / 14%);
}
.ks-suggestion-heading { margin: 9px 8px 4px; color: var(--ks-muted); font-size: 13px; font-weight: bold; }
.ks-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--ks-line);
    color: inherit;
    text-decoration: none;
}
.ks-suggestion:hover, .ks-suggestion:focus-visible { background: var(--ks-fill); }
.ks-suggestion-label { flex: 0 0 auto; color: var(--ks-muted); }
.ks-suggestion-product { justify-content: flex-start; }
.ks-suggestion-product .ks-photo { flex: 0 0 52px; height: 52px; }
.ks-suggestion-all {
    display: block;
    padding: 10px 8px;
    color: var(--ks-red);
    font-weight: bold;
    text-decoration: underline;
}
.ks-hierarchy, .ks-article { color: var(--ks-muted); font-size: 13px; }
.ks-badge { margin-left: 7px; padding: 1px 5px; border-radius: 5px; background: var(--ks-fill); font-size: 12px; }
.ks-tips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ks-tips:empty { display: none; }
.ks-tips a, .ks-filter-chip {
    padding: 5px 10px;
    border: 1px solid var(--ks-line);
    border-radius: 18px;
    background: var(--ks-fill);
    color: inherit;
    font-size: 13px;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.ks-tips a:hover, .ks-filter-chip:hover { border-color: var(--ks-red); }
.ks-results {
    width: 100%;
    padding: 18px max(16px, calc((100% - 1740px) / 2)) 36px;
    background: #fff;
}
.ks-results .ks-results-title {
    margin: 0 0 12px;
    padding: 0;
    color: var(--ks-ink);
    font: bold 26px/1.2 Arial, sans-serif;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
}
.ks-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px;
}
.ks-active-filters:empty { display: none; }
.ks-filter-chip { display: inline-flex; align-items: center; gap: 7px; }
.ks-chip-cross { color: var(--ks-red); font-size: 17px; line-height: 1; }
.ks-reset { padding: 5px; color: var(--ks-red); text-decoration: underline; font-size: 13px; }
.ks-layout {
    display: grid;
    grid-template-columns: minmax(180px, 245px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}
.ks-filters {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--ks-line);
    border-radius: 9px;
    background: #fff;
}
.ks-filters > summary { padding: 3px 0; cursor: pointer; font-weight: bold; }
.ks-filter-group { margin: 0 0 14px; }
.ks-filter-group:last-child { margin-bottom: 0; }
.ks-filter-group h3 { margin: 5px 0; font: bold 15px/1.45 Arial, sans-serif; }
.ks-filter-options { max-height: 230px; overflow: auto; }
.ks-filter-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 7px;
    min-height: 34px;
    padding: 6px 7px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}
.ks-filter-link span { overflow-wrap: anywhere; }
.ks-filter-link small { color: var(--ks-muted); }
.ks-filter-link:hover, .ks-filter-link[aria-current="true"] { background: var(--ks-fill); }
.ks-filter-link[aria-current="true"] { color: var(--ks-red); font-weight: bold; }
.ks-filter-choice {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 7px;
    border-radius: 6px;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.ks-filter-choice:hover { background: var(--ks-fill); }
.ks-filter-choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--ks-red); }
.ks-filter-choice small { color: var(--ks-muted); }
.ks-filter-form > .ks-filter-choice { margin-bottom: 10px; }
.ks-filter-error { margin: 4px 0 0; color: var(--ks-red); font-size: 13px; }
.ks-filter-error:empty { display: none; }
.ks-price-fields { display: flex; gap: 7px; }
.ks-price-fields input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    min-height: 40px;
    padding: 7px;
    border: 1px solid var(--ks-line);
    border-radius: 6px;
    background: var(--ks-fill);
    font: inherit;
}
.ks-apply {
    width: 100%;
    margin-top: 7px;
    padding: 8px;
    border-radius: 6px;
    background: var(--ks-red);
    color: #fff;
}
.ks-listing { min-width: 0; }
.ks-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.ks-result-count { color: var(--ks-muted); font-size: 14px; }
.ks-sort {
    max-width: 100%;
    min-height: 38px;
    padding: 5px 8px;
    border: 1px solid var(--ks-line);
    border-radius: 7px;
    background: #fff;
    color: inherit;
    font: inherit;
}
.ks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 16px;
}
.ks-product {
    --ks-card-padding: 14px;
    --ks-card-photo-height: 228px;
    --ks-gallery-edge: 4px;
    --ks-gallery-arrow-width: 32px;
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
    padding: var(--ks-card-padding);
    border: 1px solid var(--ks-line);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.ks-product:hover { border-color: #d5a8a3; box-shadow: 0 3px 12px rgb(0 0 0 / 7%); }
.ks-product-link {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}
.ks-product > .ks-cart-slot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.ks-cart-slot .ks-cart-button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: var(--ks-red);
    cursor: pointer;
}
.ks-cart-slot .ks-cart-button:hover { background: #b62019; }
.ks-cart-slot:disabled .ks-cart-button,
.ks-cart-slot:disabled .ks-quantity-button { cursor: wait; opacity: .6; }
.ks-cart-button img { width: 20px; height: 20px; object-fit: contain; }
.ks-quantity {
    display: grid;
    width: min(100%, 148px);
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    border: 1px solid #e3c4c2;
    border-radius: 8px;
    background: #fff;
}
.ks-quantity-button {
    display: grid;
    place-items: center;
    width: 100%;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ks-red);
    font: 600 22px/1 Arial, sans-serif;
    cursor: pointer;
}
.ks-quantity-button:hover:not(:disabled) { background: #fff2f1; }
.ks-quantity-button:disabled { color: #a2a2a2; cursor: default; }
.ks-quantity-value { text-align: center; font-size: 15px; font-weight: bold; overflow-wrap: anywhere; }
.ks-cart-open { display: grid; min-height: 44px; align-items: center; color: var(--ks-red); font-size: 13px; }
.ks-cart-message, .ks-cart-notice { color: var(--ks-muted); font-size: 13px; }
.ks-cart-message { flex-basis: 100%; padding-top: 4px; text-align: right; }
.ks-cart-message:empty, .ks-cart-notice:empty { display: none; }
.ks-cart-notice { margin: 5px 0 10px; }
.ks-photo { display: flex; align-items: center; justify-content: center; }
.ks-product .ks-photo { height: var(--ks-card-photo-height); }
.ks-photo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.ks-product .ks-photo img { width: 100%; height: 100%; object-fit: scale-down; object-position: center; }
.ks-product:has(> .ks-gallery) .ks-photo {
    padding-inline: calc(var(--ks-gallery-edge) + var(--ks-gallery-arrow-width) - var(--ks-card-padding) + 2px);
}
.ks-gallery {
    position: absolute;
    z-index: 1;
    inset: var(--ks-card-padding) var(--ks-gallery-edge) auto;
    display: flex;
    height: var(--ks-card-photo-height);
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}
.ks-gallery-arrow {
    display: grid;
    place-items: center;
    width: var(--ks-gallery-arrow-width);
    height: 44px;
    padding: 0;
    border: 1px solid var(--ks-line);
    border-radius: 8px;
    background: rgb(255 255 255 / 94%);
    color: var(--ks-ink);
    font: 28px/1 Arial, sans-serif;
    cursor: pointer;
    pointer-events: auto;
}
.ks-gallery-arrow:hover { border-color: var(--ks-red); color: var(--ks-red); }
.ks-gallery-count {
    position: absolute;
    inset-inline-end: calc(var(--ks-card-padding) - var(--ks-gallery-edge));
    inset-block-end: 4px;
    padding: 3px 7px;
    border: 1px solid var(--ks-line);
    border-radius: 12px;
    background: rgb(255 255 255 / 94%);
    color: var(--ks-muted);
    font-size: 12px;
}
.ks-product-description { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.ks-product-category { color: var(--ks-muted); font-size: 12px; }
.ks-product .ks-product-title { font-size: 16px; line-height: 1.35; font-weight: 600; }
.ks-product-link:hover .ks-product-title { text-decoration: underline; }
.ks-product-meta { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.ks-product .ks-product-meta { padding-top: 5px; }
.ks-product-price { font-size: 21px; }
.ks-suggestion-product .ks-product-price { font-size: 15px; }
.ks-stock { color: var(--ks-muted); font-size: 13px; }
.ks-stock-available { color: #187134; }

@supports (grid-template-rows: subgrid) and selector(:has(*)) {
    .ks-product {
        container-type: inline-size;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto 1fr auto;
        gap: 0;
    }
    .ks-product > .ks-product-link {
        display: grid;
        grid-area: 1 / 1 / 6 / -1;
        grid-template-columns: subgrid;
        grid-template-rows: subgrid;
        gap: 0;
    }
    .ks-product-link > .ks-product-description { display: contents; }
    .ks-product-link > .ks-photo { grid-area: 1 / 1 / 2 / -1; margin-block-end: 8px; }
    .ks-product-link :is(.ks-product-category, .ks-product-title, .ks-article) {
        grid-column: 1 / -1;
        margin-block-end: 4px;
    }
    .ks-product-link .ks-product-category { grid-row: 2; }
    .ks-product-link .ks-product-title { grid-row: 3; }
    .ks-product-link .ks-article { grid-row: 4; align-self: start; }
    .ks-product-link .ks-product-meta { grid-area: 5 / 1 / 6 / -1; align-self: center; margin-top: 0; }
    .ks-product:has(> .ks-cart-slot:not([hidden])) .ks-product-meta { grid-column: 1; margin-inline-end: 8px; }
    .ks-product > .ks-cart-slot { grid-area: 5 / 2; align-self: center; width: 44px; }
    .ks-product > .ks-cart-slot:has(> :is(.ks-quantity:not([hidden]), .ks-cart-open:not([hidden]), .ks-cart-message:not(:empty))) {
        width: 120px;
    }

    /* Narrow cards keep controls on separate rows so the photo and touch targets have room. */
    @container (max-width: 199px) {
        .ks-product:has(> .ks-gallery) .ks-photo { margin-block-end: 56px; padding-inline: 0; }
        .ks-gallery {
            inset: calc(var(--ks-card-padding) + var(--ks-card-photo-height) + 4px) var(--ks-card-padding) auto;
            display: grid;
            grid-template-columns: var(--ks-gallery-arrow-width) 1fr var(--ks-gallery-arrow-width);
            height: 44px;
        }
        .ks-gallery-arrow:last-of-type { grid-area: 1 / 3; }
        .ks-gallery-count { position: static; grid-area: 1 / 2; justify-self: center; }
        .ks-product > .ks-cart-slot:has(> :is(.ks-quantity:not([hidden]), .ks-cart-open:not([hidden]), .ks-cart-message:not(:empty))) {
            grid-area: 6 / 1 / 7 / -1;
            width: auto;
            margin-block-start: 6px;
        }
        .ks-product:has(> .ks-cart-slot > :is(.ks-quantity:not([hidden]), .ks-cart-open:not([hidden]), .ks-cart-message:not(:empty))) .ks-product-meta {
            grid-column: 1 / -1;
            margin-inline-end: 0;
        }
    }
}

.ks-load-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 24px;
    margin-top: 16px;
    color: var(--ks-muted);
}
.ks-load-button {
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--ks-line);
    border-radius: 7px;
    background: #fff;
    color: var(--ks-ink);
    font: inherit;
    cursor: pointer;
}
.ks-load-button:hover { border-color: var(--ks-red); }
.ks-status { margin: 0; padding: 14px 0; }
@media (min-width: 900px) {
    .ks-filters[open] > summary { display: none; }
}
@media (max-width: 899px) {
    .ks-bar .ks-input { padding: 8px 10px; }
    .ks-submit { flex-basis: 76px; padding: 8px; }
    .ks-clear { flex-basis: 36px; }
    .ks-suggestions { padding: 5px; }
    .ks-suggestion-label { display: none; }
    .ks-results { padding: 14px 12px 24px; }
    .ks-results .ks-results-title { font-size: 20px; }
    .ks-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .ks-filters { padding: 8px 10px; }
    .ks-filter-link, .ks-filter-choice { min-height: 42px; }
    .ks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ks-product { --ks-card-padding: 8px; --ks-card-photo-height: clamp(126px, 40vw, 190px); gap: 8px; }
    .ks-product .ks-product-title { font-size: 14px; }
    .ks-product-price { font-size: 18px; }
    .ks-quantity { width: 100%; }
}
@media (min-width: 560px) and (max-width: 899px) {
    .ks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
