/* Kupetz v0.8 — staging-only WooCommerce adapter. All styles scoped by body class.
   This is NOT a copy of the HTML prototype: theme/WooCommerce retain actual data and links. */
body.kupetz-catalog-v08 {
    --kcv8-wine: #540b16;
    --kcv8-deep: #34040c;
    --kcv8-gold: #c8a574;
    --kcv8-ivory: #fbf8f1;
    --kcv8-line: #e8dbc9;
    --kcv8-text: #352126;
    background: var(--kcv8-ivory);
    color: var(--kcv8-text);
}
body.kupetz-catalog-v08 .kupetz-site-header__bar {
    background: var(--kcv8-wine);
    border-bottom: 1px solid var(--kcv8-gold);
}
body.kupetz-catalog-v08 .kupetz-top-logo {
    align-items: center;
    display: inline-flex;
}
/* Preserve the live home link; only replace its decorative mark on pilot pages. */
body.kupetz-catalog-v08 .kupetz-top-logo img { opacity: 0; }
body.kupetz-catalog-v08 .kupetz-top-logo::before {
    background: url('../../img/catalog-v08/logo-mark-gold.svg') center / contain no-repeat;
    content: '';
    display: block;
    width: 60px;
    height: 46px;
    margin-right: -60px;
}
.kcv8-catalog-shell,
.kcv8-catalog-shell * { box-sizing: border-box; }
/* Catalog has its own sidebar/results proportions, not chrome width.
 * Shared semantic token definitions keep this consistent across catalog pages.
 * Fallbacks preserve legacy behavior if the redesign is disabled. */
body.kupetz-catalog-v08 .kcv8-catalog-shell {
    width: 100%;
    max-width: var(--kcv-catalog-max, 1484px);
    margin: 0 auto;
    padding: 42px var(--kcv-catalog-gutter, clamp(15px, 2.25vw, 36px)) 68px;
    min-height: 660px;
}
body.kupetz-catalog-v08 .kcv8-catalog-shell h1,
body.kupetz-catalog-v08 .kcv8-catalog-shell h2,
body.kupetz-catalog-v08 .kcv8-catalog-shell h3 {
    color: var(--kcv8-wine);
    display: block;
    position: static;
    text-transform: none;
    text-align: left;
    letter-spacing: normal;
    padding: 0;
    margin: 0;
    font-family: var(--kupetz-font-serif, Georgia, serif);
}
body.kupetz-catalog-v08 .kcv8-catalog-shell h1::before,
body.kupetz-catalog-v08 .kcv8-catalog-shell h1::after,
body.kupetz-catalog-v08 .kcv8-catalog-shell h2::before,
body.kupetz-catalog-v08 .kcv8-catalog-shell h2::after,
body.kupetz-catalog-v08 .kcv8-catalog-shell h3::before,
body.kupetz-catalog-v08 .kcv8-catalog-shell h3::after { content: none; }
.kcv8-breadcrumb { margin: 0 0 16px; }
.kcv8-breadcrumb .woocommerce-breadcrumb {
    color: #916e5a;
    font: 12px/1.5 var(--kupetz-font-body, Arial, sans-serif);
    margin: 0;
}
.kcv8-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 22px; align-items: start; }
.kcv8-sidebar { min-width: 0; }
body.kupetz-catalog-v08 .kcv8-sidebar__title { font-size: clamp(32px, 3vw, 46px); line-height: 1.08; }
.kcv8-flourish {
    background: url('../../img/catalog-v08/flourish.svg') left center / 100% 100% no-repeat;
    height: 15px;
    width: 100%;
    margin: 9px 0 13px;
}
.kcv8-filters { border: 1px solid #e2d4bd; border-radius: 3px; background: #f9f5ed; padding: 7px 17px 15px; }
.kcv8-filter-section { padding: 12px 0; border-bottom: 1px solid #e5d8c8; }
.kcv8-filter-section h2 { font: 700 13px/1.3 var(--kupetz-font-body, Arial, sans-serif); }
.kcv8-filter-toggle {
    align-items: center; display: flex; justify-content: space-between;
    border: 0; background: transparent; color: var(--kcv8-wine);
    padding: 0 0 8px; margin: 0; width: 100%; text-align: left;
    font: 700 13px/1.4 var(--kupetz-font-body, Arial, sans-serif);
    text-transform: uppercase; cursor: pointer;
}
.kcv8-filter-toggle span { transition: transform .15s ease; }
.kcv8-filter-toggle[aria-expanded='false'] span { transform: rotate(180deg); }
.kcv8-filter-body { display: grid; gap: 7px; }
.kcv8-filter-body[hidden] { display: none; }
.kcv8-check { display: flex; gap: 9px; align-items: start; color: #4b3731; cursor: pointer; font: 13px/1.3 var(--kupetz-font-body, Arial, sans-serif); }
.kcv8-check input[type='checkbox'] {
    appearance: none; -webkit-appearance: none; width: 14px; height: 14px;
    border: 1px solid #bfa17d; border-radius: 2px; background: #fff;
    padding: 0; margin: 1px 0 0; flex: 0 0 14px;
}
.kcv8-check input[type='checkbox']:checked { background: var(--kcv8-wine); box-shadow: inset 0 0 0 3px #fff8ef; }
.kcv8-check small { margin-left: auto; color: #9d887a; }
.kcv8-category-scroll { position: relative; }
#kcv8-categories { max-height: 420px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 3px 9px 3px 2px; scrollbar-width: none; }
#kcv8-categories::-webkit-scrollbar { display: none; width: 0; height: 0; }
#kcv8-categories::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.kcv8-category-scroll__thumb { position: absolute; top: 0; right: 0; width: 2px; border-radius: 2px; background: var(--kcv8-wine); touch-action: none; cursor: grab; }
.kcv8-category-scroll__thumb[hidden] { display: none; }
.kcv8-category-check { margin-left: calc(var(--category-depth, 0) * 13px); min-width: 0; }
.kcv8-category-check span { min-width: 0; overflow-wrap: anywhere; }
.kcv8-category-check small { flex-shrink: 0; }
@media (max-width: 767px) {
    .kcv8-category-check { min-height: 36px; align-items: center; }
}
.kcv8-price-labels { display: flex; justify-content: space-between; gap: 8px; color: #785d51; font: 12px/1.4 var(--kupetz-font-body, Arial, sans-serif); }
.kcv8-price-slider { height: 30px; position: relative; isolation: isolate; }
.kcv8-price-track { position: absolute; inset: 13px 9px auto; height: 4px; background: #dfcdbc; border-radius: 10px; overflow: hidden; }
.kcv8-price-track span { position: absolute; top: 0; bottom: 0; left: var(--start, 0%); right: calc(100% - var(--end, 100%)); background: var(--kcv8-wine); }
.kcv8-price-slider input[type='range'] {
    appearance: none; -webkit-appearance: none; position: absolute; inset: 0;
    height: 30px; width: 100%; margin: 0; padding: 0; border: 0; background: transparent;
    pointer-events: none; accent-color: var(--kcv8-wine);
}
#kcv8-min-range { z-index: 3; }
#kcv8-max-range { z-index: 2; }
.kcv8-price-slider input[type='range']::-webkit-slider-runnable-track { background: transparent; border: 0; height: 4px; }
.kcv8-price-slider input[type='range']::-moz-range-track { background: transparent; border: 0; height: 4px; }
.kcv8-price-slider input[type='range']::-webkit-slider-thumb {
    appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px;
    border-radius: 50%; border: 2px solid #f4e7d3; background: #651223;
    box-shadow: 0 0 0 1px var(--kcv8-wine); pointer-events: auto; cursor: ew-resize;
}
.kcv8-price-slider input[type='range']::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%; border: 2px solid #f4e7d3;
    background: #651223; box-shadow: 0 0 0 1px var(--kcv8-wine); pointer-events: auto; cursor: ew-resize;
}
body.kupetz-catalog-v08 .kcv8-filter-apply,
.kcv8-filter-reset { display: block; width: 100%; text-align: center; padding: 9px; margin-top: 12px; border-radius: 3px; font: 13px/1.35 var(--kupetz-font-body, Arial, sans-serif); }
body.kupetz-catalog-v08 .kcv8-filter-apply { background: var(--kcv8-wine); color: white; border: 1px solid var(--kcv8-wine); cursor: pointer; }
.kcv8-filter-reset { color: var(--kcv8-wine); border: 1px solid #a66e72; background: transparent; }
/* JS applies every filter after a short delay; keep manual submit for no-JS. */
body.kupetz-catalog-v08 .kcv8-filters.has-auto-apply .kcv8-filter-apply { display: none; }

.kcv8-results { min-width: 0; }
.kcv8-promo { position: relative; isolation: isolate; display: grid; grid-template-columns: 53% 47%; min-height: 216px; background: var(--kcv8-deep); border: 1px solid var(--kcv8-gold); overflow: hidden; margin-bottom: 16px; }
.kcv8-promo::after { position: absolute; content: ''; inset: 6px; border: 1px solid #c9a37699; pointer-events: none; z-index: 2; }
.kcv8-promo__copy { position: relative; z-index: 2; padding: 24px 9px 20px 32px; }
.kcv8-promo__eyebrow { color: #dfb77d; letter-spacing: .18em; font: 700 12px/1.4 var(--kupetz-font-body, Arial, sans-serif); text-transform: uppercase; }
body.kupetz-catalog-v08 .kcv8-promo h2 { color: #fff4e7; font-size: clamp(28px, 2.7vw, 39px); line-height: 1.1; margin: 7px 0 10px; }
.kcv8-promo p { color: #f1dfcf; font: 14px/1.4 var(--kupetz-font-body, Arial, sans-serif); margin: 0; }
.kcv8-promo__image { height: 100%; object-fit: cover; position: absolute; inset: 0 0 0 52%; width: 48%; z-index: 1; }
.kcv8-live-search .kupetz-product-search { max-width: none; width: 100%; margin: 0 0 16px; }
.kcv8-live-search .kupetz-product-search__field { border: 1px solid #d6b58d; border-radius: 4px; height: 45px; background: #fffdfa; }
.kcv8-live-search .kupetz-product-search__clear,
.kcv8-live-search .kupetz-product-search__submit { height: 41px; }
.kcv8-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 4px 0 12px; }
.kcv8-toolbar__count { color: #51413c; font: 14px/1.5 var(--kupetz-font-body, Arial, sans-serif); }
.kcv8-toolbar__sort { display: flex; align-items: center; gap: 10px; margin: 0; }
.kcv8-toolbar__sort label { font-size: 12px; color: #74232a; }
.kcv8-toolbar__sort select { background: transparent; border: 0; color: #5b111e; font-size: 13px; width: auto; max-width: 210px; padding: 5px 14px 5px 0; box-shadow: none; }
.kcv8-toolbar__sort select:focus-visible {
    outline: none;
    outline-offset: 0;
}
body.kupetz-catalog-v08 .kcv8-results ul.products {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
    padding: 0; margin: 0; list-style: none; justify-content: normal;
}
body.kupetz-catalog-v08 .kcv8-results ul.products li.product {
    min-width: 0; width: 100%; margin: 0; float: none; display: block;
}
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card {
    box-sizing: border-box; border: 1px solid #e9dbc7; border-radius: 4px;
    background: #fffdfa; padding: 4px 4px 10px; margin: 0;
    width: 100%; max-width: none; min-height: 100%; box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card:hover { border-color: #cfaf84; box-shadow: 0 3px 14px #8d63381a; }
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__media,
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__media a { display: block; width: 100%; overflow: hidden; }
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__media img {
    display: block; width: 100%; height: 100%; aspect-ratio: 1.22 / 1; object-fit: cover; max-width: none;
}
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__title {
    text-align: left; padding: 8px 8px 0; margin: 0; font: 21px/1.12 var(--kupetz-font-serif, Georgia, serif);
    color: var(--kcv8-text); min-height: 56px;
}
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__weight-value { color: #a57755; margin: 0 8px 5px; text-align: left; font-size: 12px; }
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__divider { display: none; }
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__purchase {
    margin: auto 0 0; padding: 5px 8px 0; display: flex; align-items: end; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
}
body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__price,
body.kupetz-catalog-v08 .kcv8-results .woocommerce-Price-amount.amount { color: var(--kcv8-wine); font: 700 20px/1.15 var(--kupetz-font-serif, Georgia, serif); }
body.kupetz-catalog-v08 .kcv8-results .add_to_cart_button,
body.kupetz-catalog-v08 .kcv8-results .button.product_type_simple,
body.kupetz-catalog-v08 .kcv8-results .button.product_type_variable {
    background: var(--kcv8-wine); color: #fff2df; border: 1px solid var(--kcv8-wine);
    border-radius: 3px; font: 12px/1.3 var(--kupetz-font-body, Arial, sans-serif);
    width: auto; max-width: none; min-height: 36px; padding: 8px 12px; margin: 0;
}
body.kupetz-catalog-v08 .kcv8-results .add_to_cart_button::after,
body.kupetz-catalog-v08 .kcv8-results .button.product_type_simple::after { display: none; }
.kcv8-results .woocommerce-pagination { margin-top: 26px; }
.kcv8-results .woocommerce-pagination ul.page-numbers { display: flex; align-items: center; justify-content: center; gap: 7px; list-style: none; border: 0; }
.kcv8-results .woocommerce-pagination .page-numbers a,
.kcv8-results .woocommerce-pagination .page-numbers span { padding: 7px 11px; border: 1px solid #e4cfb3; color: var(--kcv8-wine); background: transparent; }
.kcv8-results .woocommerce-pagination .page-numbers .current { background: var(--kcv8-wine); color: #fff; }
.kcv8-mobile-toggle { display: none; }
@media(max-width: 1300px) {
    .kcv8-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 17px; }
    body.kupetz-catalog-v08 .kcv8-results ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media(max-width: 860px) {
    .kcv8-layout { grid-template-columns: 205px minmax(0, 1fr); gap: 15px; }
    body.kupetz-catalog-v08 .kcv8-results ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kcv8-promo { min-height: 190px; }
    body.kupetz-catalog-v08 .kcv8-promo h2 { font-size: 29px; }
    .kcv8-promo p { display: none; }
}
/* Shop, categories and search share the same internal-page top spacing. */
@media (max-width: 991px) {
    body.kupetz-catalog-v08 .kcv8-catalog-shell { padding-top: 35px; }
}
@media(max-width: 640px) {
    body.kupetz-catalog-v08 .kcv8-catalog-shell h1.kcv8-sidebar__title { margin: 0 0 16px; }
    .kcv8-layout { display: block; }
    .kcv8-sidebar__title, .kcv8-flourish { display: none; }
    .kcv8-mobile-toggle { display: flex; width: 100%; justify-content: space-between; background: #fffaf4; color: var(--kcv8-wine); border: 1px solid #bd9981; border-radius: 3px; padding: 10px 14px; margin-bottom: 12px; }
    .kcv8-filters { display: none; margin-bottom: 15px; }
    .kcv8-filters.is-open { display: block; }
    .kcv8-promo { min-height: 175px; display: block; }
    .kcv8-promo__copy { max-width: 360px; padding: 22px 17px; }
    body.kupetz-catalog-v08 .kcv8-promo h2 { font-size: 27px; }
    .kcv8-promo__image { left: 42%; width: 58%; opacity: .45; }
    .kcv8-toolbar { flex-wrap: wrap; }
    body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__title { min-height: 58px; font-size: 17px; padding: 7px 4px 0; }
    body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__purchase { align-items: stretch; display: flex; flex-direction: column; padding: 5px 4px 0; }
    body.kupetz-catalog-v08 .kcv8-results .add_to_cart_button,
    body.kupetz-catalog-v08 .kcv8-results .button.product_type_simple { width: 100%; }
}
@media(max-width: 359px) {
    body.kupetz-catalog-v08 .kcv8-results ul.products { gap: 7px; }
    body.kupetz-catalog-v08 .kcv8-results .kupetz-product-card__title { font-size: 16px; }
}
@media(prefers-reduced-motion: reduce) {
    body.kupetz-catalog-v08 .kcv8-catalog-shell * { transition: none; }
}


/* v0.8.2 — убрать обводку у сортировки */
.kupetz-catalog-v08 .woocommerce-ordering select,
.kupetz-catalog-v08 .woocommerce-ordering select:focus,
.kupetz-catalog-v08 .woocommerce-ordering select:focus-visible,
.kupetz-catalog-v08 .woocommerce-ordering select:active {
    outline: none;
    box-shadow: none;
    -webkit-box-shadow: none;
}

.kupetz-catalog-v08 .woocommerce-ordering select:focus,
.kupetz-catalog-v08 .woocommerce-ordering select:focus-visible {
    border-color: var(--kupetz-color-gold, #c79a57);
}


/* BEGIN KUPETZ CATALOG CHEVRON FIX V0.8.6
   TEST theme-only correction: fixed optical and geometric centering.
   Replaces V0.8.5; no WSS, slider, or filter JS changes. */
body.kupetz-catalog-v08 .kcv8-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    min-height: 44px;
    height: 44px;
    padding: 0;
    /* Reclaim 12px of the panel's 17px right inset, including click area. */
    margin: 0 -12px 0 0;
    width: calc(100% + 12px);
    gap: 8px;
    line-height: 1.2;
}

/* Preserve the existing aria-hidden span; use it only as a stable icon box. */
body.kupetz-catalog-v08 .kcv8-filter-toggle > span {
    display: block;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 0;
    position: relative;
    line-height: 0;
    font-size: 0;
    transform: none;
    transition: none;
}

/* SVG path is centered within a fixed 24x24 viewBox; no rotated border box. */
body.kupetz-catalog-v08 .kcv8-filter-toggle > span::before {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 15L12 8L19 15' stroke='%23520e1b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    transform: rotate(0deg);
    transform-origin: 50% 50%;
    transition: transform .18s ease;
}

body.kupetz-catalog-v08 .kcv8-filter-toggle[aria-expanded='false'] > span,
body.kupetz-catalog-v08 .kcv8-filter-toggle[aria-expanded='true'] > span {
    transform: none;
}

body.kupetz-catalog-v08 .kcv8-filter-toggle[aria-expanded='false'] > span::before {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    body.kupetz-catalog-v08 .kcv8-filter-toggle > span::before {
        transition: none;
    }
}
/* END KUPETZ CATALOG CHEVRON FIX V0.8.6 */

/* Shared mobile filter dialog for category archives and search.
   Desktop retains its original sidebar and automatic GET filtering. */
.kcv8-filter-dialog:not([open]) { display: none; }
.kcv8-filter-actions { display: contents; }
@media (max-width: 640px) {
    html.kcv8-filter-dialog-open { overflow: hidden; }
    body.kupetz-catalog-v08 .kcv8-mobile-toggle {
        box-sizing: border-box;
        align-items: center;
        min-height: 44px;
        padding: 9px 12px 9px 14px;
        text-align: left;
    }
    body.kupetz-catalog-v08 .kcv8-mobile-toggle > span {
        display: grid;
        place-items: center;
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        font-size: 0;
        line-height: 0;
    }
    body.kupetz-catalog-v08 .kcv8-mobile-toggle > span::before {
        content: '';
        width: 18px;
        height: 18px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 9L12 16L19 9' stroke='%23520e1b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    body.kupetz-catalog-v08 .kcv8-mobile-toggle[aria-expanded='true'] > span::before { transform: rotate(180deg); }
    body.kupetz-catalog-v08 .kcv8-filter-dialog[open] {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        width: min(440px, calc(100% - 24px));
        max-width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        margin: auto;
        padding: 0;
        border: 1px solid #c8a574;
        border-radius: 5px;
        background: #fbf8f1;
        color: #540b16;
        box-shadow: 0 12px 40px rgb(52 4 12 / 24%);
        overflow: hidden;
    }
    .kcv8-filter-dialog::backdrop { background: rgb(31 8 15 / 56%); }
    .kcv8-filter-dialog__heading {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 14px;
        border-bottom: 1px solid #e2d4bd;
    }
    .kcv8-filter-dialog__heading strong {
        font: 400 26px/1.2 var(--kupetz-font-serif, Georgia, serif);
    }
    .kcv8-filter-dialog__close {
        display: grid;
        place-items: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #540b16;
        cursor: pointer;
    }
    .kcv8-filter-dialog__close:focus-visible { outline: 2px solid #b8793c; outline-offset: -2px; }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-filters.is-open {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        margin: 0;
        padding: 0 14px;
        border: 0;
        background: transparent;
    }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-filter-section { padding: 4px 0 8px; }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-filter-toggle { min-height: 36px; height: 36px; }
    body.kupetz-catalog-v08 .kcv8-filter-dialog #kcv8-categories {
        max-height: min(220px, 29vh);
        max-height: min(220px, 29dvh);
        gap: 7px;
    }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-category-check {
        min-height: 0;
        align-items: start;
    }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        position: sticky;
        bottom: 0;
        z-index: 5;
        margin: 0 -14px;
        padding: 12px 14px max(12px, env(safe-area-inset-bottom));
        background: #fbf8f1;
        border-top: 1px solid #e2d4bd;
    }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-filter-actions :is(.kcv8-filter-apply, .kcv8-filter-reset) {
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        min-height: 44px;
        margin: 0;
        padding: 8px;
    }
    body.kupetz-catalog-v08 .kcv8-filter-dialog .kcv8-filter-actions .kcv8-filter-apply { background: #630f22; color: #fff3df; }
}

/* TEST alternate imagery uses the existing WC category grid, not a second
   homepage block. Current mode never enters this scope. Unprepared categories
   keep their real original thumbnail, in the same alternate card geometry. */
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    justify-items: stretch;
    align-content: start;
    max-width: none;
    width: 100%;
    aspect-ratio: auto;
    min-height: 0;
    height: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e4d4bd;
    background: #fffbf4;
    color: #5b2430;
}
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a > img.kupetz-product-category__frame {
    display: none;
}
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a > img:not(.kupetz-product-category__frame) {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    aspect-ratio: 560 / 360;
    margin: 0;
    padding: 14px;
    object-fit: contain;
    background: #fffbf4;
}
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a > img[data-catalog-art-active="true"] {
    padding: 0;
    object-fit: cover;
}
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a > .woocommerce-loop-category__title {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    min-height: calc(2.4em + 24px);
    color: #5b2430;
    font: 400 clamp(13px, 1.1vw, 18px)/1.2 var(--kupetz-font-serif, Georgia, serif);
    text-align: center;
    text-transform: uppercase;
    overflow-wrap: break-word;
}

/* Equal-height native category cards across every row, including the final row.
   Restrict equal grid tracks to category-only grids; product cards are unchanged. */
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products:has(> li.product-category):not(:has(> li.product:not(.product-category))) {
    grid-auto-rows: 1fr;
    align-items: stretch;
}
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category {
    display: flex;
    align-items: stretch;
    min-width: 0;
}
body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a {
    flex: 1 1 auto;
}
@media (max-width: 991px) {
    body.kupetz-catalog-v08.kcv-catalog-art-preview #kcv8-products .products > li.product-category > a > .woocommerce-loop-category__title {
        padding: 10px 6px;
        min-height: calc(3.6em + 20px);
    }
}
