.wvc-brand-image {
    display: block;
    width: min(94px, 100%);
    height: 72px;
    object-fit: contain;
}

.wvc-makes {
    gap: var(--wvc-gap, 18px);
}

.wvc-make-card {
    position: relative;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    min-height: 184px;
    padding: 24px 20px 20px;
    border-color: #e6e8eb;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(28, 39, 49, .035);
    text-align: center;
}

.wvc-make-card:hover {
    border-color: #83c320;
    box-shadow: 0 7px 20px rgba(28, 39, 49, .1);
}

.wvc-make-logo {
    display: grid;
    place-items: center;
    width: min(132px, 100%);
    height: 96px;
    overflow: hidden;
    background: #fff;
}

.wvc-cat-image {
    display: block;
    width: min(132px, 100%);
    height: 96px;
    object-fit: contain;
    background: #fff;
}

.wvc-make-logo .wvc-brand-image {
    width: min(126px, 100%);
    height: 92px;
}

.wvc-brand-placeholder {
    display: grid;
    place-items: center;
    width: 64px;
    height: 52px;
    border-radius: 10px;
    background: #f3f5f7;
    filter: grayscale(1);
    font-size: 30px;
}

.wvc-make-name {
    min-width: 0;
    color: #2d3338;
    font-size: 19px;
    line-height: 1.25;
}

.wvc-make-name strong {
    font: inherit;
    font-weight: 700;
}

.wvc-make-arrow {
    color: #687078;
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
}

.wvc-title-image {
    width: 180px;
    height: 100px;
    border-radius: 10px;
    object-fit: contain;
    background: #f7f8f9;
}

.wvc-model-card {
    grid-template-columns: 104px minmax(0, 1fr) auto;
}

.wvc-model-image {
    width: 106px;
    height: 72px;
    border-radius: 7px;
    object-fit: contain;
    background: #f7f8f9;
}

.wvc-model-image-fallback { opacity: .72; }

.wvc-product-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e4e7ea;
}

.wvc-product-heading h2,
.wvc-product-heading p { margin: 0; }

.wcat-make-table td { vertical-align: middle; }
.wcat-image-preview { display: inline-flex; width: 76px; min-height: 54px; margin-right: 10px; vertical-align: middle; }
.wcat-image-preview img { width: 76px; height: 54px; object-fit: contain; border: 1px solid #dcdcde; border-radius: 4px; background: #fff; }
.wcat-remove-image { margin-left: 8px; }
.wcat-auto-save-status { display: inline-block; min-width: 76px; margin-left: 10px; color: #646970; font-size: 12px; }
.wcat-auto-save-status.is-saved { color: #16803b; }
.wcat-auto-save-status.is-error { color: #b32d2e; }
.wcat-model-table th:first-child { width: 38%; }
.wcat-model-table th:nth-child(2) { width: 110px; }

@media (max-width: 700px) {
    .wvc-make-card { min-height: 154px; padding: 16px 10px; }
    .wvc-make-logo { width: 100px; height: 72px; }
    .wvc-make-logo .wvc-brand-image { width: 96px; height: 68px; }
    .wvc-make-name { font-size: 16px; }
    .wvc-title-image { width: 105px; height: 64px; }
    .wvc-model-card { grid-template-columns: 78px minmax(0, 1fr) auto; }
    .wvc-model-image { width: 70px; height: 50px; }
    .wvc-product-heading { align-items: start; flex-direction: column; }
}


/* --- W Catalog: вградени решетки (шорткодове) --- */
.wvc-catalog.wvc-inline {
    position: static;
    left: auto;
    width: auto;
    max-width: 100%;
    margin: 0 0 34px;
    transform: none;
}

/* Решетката се подрежда според ширината на контейнера, а не на екрана. */
.wvc-catalog .wvc-grid.wvc-cols {
    grid-template-columns: repeat(auto-fill, minmax(max(var(--wvc-card-min, 190px), calc((100% - (var(--wvc-cols, 4) - 1) * var(--wvc-gap, 18px)) / var(--wvc-cols, 4))), 1fr));
}

.wvc-section-heading {
    margin: 0 0 22px;
}

.wvc-section-heading h2 {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 1.2;
}

.wvc-section-heading p {
    margin: 0;
    color: #68717a;
    font-size: 16px;
}

.wvc-cat-icon {
    display: grid;
    place-items: center;
    width: min(126px, 100%);
    height: 92px;
    border-radius: 12px;
    background: linear-gradient(145deg, #f9fafb, #edf1f4);
    font-size: 46px;
    line-height: 1;
}

.wvc-cat-image {
    display: block;
    width: min(126px, 100%);
    height: 92px;
    object-fit: contain;
}

/* Category media use the uncropped WordPress medium file; keep the whole image visible. */
.wvc-catalog .wvc-make-logo img.wvc-cat-image {
    max-width: 100%;
    max-height: 126px;
    object-fit: contain !important;
    object-position: center;
}

/* WordPress/WoodMart can force image height to auto. Give square category
   thumbnails their full height so the logo wrapper never clips the bottom. */
.wvc-catalog .wvc-category-logo {
    width: min(132px, 100%);
    height: 132px;
}

.wvc-catalog .wvc-category-logo img.wvc-cat-image {
    display: block;
    width: min(126px, 100%);
    height: 126px !important;
    max-height: 126px !important;
}

@media (max-width: 700px) {
    .wvc-catalog .wvc-category-logo { height: 96px; }
    .wvc-catalog .wvc-category-logo img.wvc-cat-image { height: 92px !important; max-height: 92px !important; }
}

.wvc-make-card .wvc-make-count {
    display: block;
    margin-top: 2px;
    color: #737b83;
    font-size: 14px;
    font-weight: 400;
}

.wvc-empty-note {
    margin: 12px 0 0;
    color: #68717a;
}

@media (max-width: 700px) {
    .wvc-section-heading h2 { font-size: 23px; }
}

/* --- W Catalog: каталог по вид част --- */
.wvc-parts-flow .wvc-model-list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.wvc-parts-flow .wvc-model-card {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    min-height: 92px;
}

.wvc-parts-flow .wvc-model-image {
    width: 88px;
    height: 62px;
}

.wvc-engine-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0 0 24px;
}

.wvc-engine-filter > span {
    font-weight: 700;
}

.wvc-engine-chip {
    padding: 8px 14px;
    border: 1px solid #dfe3e7;
    border-radius: 20px;
    background: #fff;
    color: #343a40 !important;
    font-size: 14px;
    text-decoration: none !important;
    transition: .15s;
}

.wvc-engine-chip:hover {
    border-color: var(--wvc-orange, #83c320);
}

.wvc-engine-chip.is-active {
    border-color: var(--wvc-orange, #83c320);
    background: var(--wvc-orange, #83c320);
    color: #fff !important;
}



/* Картите се смаляват според контейнера, а не според ширината на екрана. */
@container wvc-catalog (max-width: 620px) {
    .wvc-make-card { min-height: 150px; padding: 16px 12px 14px; gap: 10px; }
    .wvc-make-logo { height: 74px; }
    .wvc-catalog .wvc-category-logo { height: 96px; }
    .wvc-catalog .wvc-category-logo img.wvc-cat-image { height: 92px !important; max-height: 92px !important; }
    .wvc-make-name { font-size: 16px; }
}

.wvc-catalog .wvc-grid,
.wvc-catalog .wvc-model-list { container-type: inline-size; container-name: wvc-catalog; }

/* --- W Catalog: лента над продуктите --- */
.wcat-products {
    --wcat-accent: #83c320;
    margin-top: 8px;
}

.wcat-products-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin: 0 0 22px;
    padding: 14px 18px;
    border: 1px solid #e6e9ec;
    border-radius: 12px;
    background: #fff;
}

.wcat-products-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.wcat-products-title h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
}

.wcat-products-count {
    flex: none;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(131, 195, 32, .14);
    color: #4f7a15;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.wcat-products-head .shop-loop-head {
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
}

.wcat-products-head .wd-shop-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 18px;
    margin: 0;
}

.wcat-products-head .wd-shop-tools > * {
    margin: 0 !important;
    vertical-align: middle;
}

.wcat-products-head .woocommerce-result-count {
    display: none;
}

.wcat-products-head .wd-products-per-page,
.wcat-products-head .woocommerce-ordering {
    font-size: 14px;
}

.wcat-products .woocommerce-notices-wrapper:empty {
    display: none;
}

.wcat-products .woocommerce-pagination {
    margin-top: 26px;
}

@media (max-width: 700px) {
    .wcat-products-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .wcat-products-title h2 { font-size: 19px; }

    .wcat-products-head .shop-loop-head { width: 100%; margin: 0; }

    .wcat-products-head .wd-shop-tools { width: 100%; justify-content: space-between; }
}

/* --- W Catalog: лента с избрания автомобил --- */
.wcat-vehicle-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    margin: 0 0 24px;
    padding: 14px 18px;
    border: 1px solid #e6e9ec;
    border-left: 4px solid #83c320;
    border-radius: 12px;
    background: #fff;
}

.wcat-vehicle-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.wcat-vehicle-photo .wcat-vehicle-image {
    display: block;
    width: 116px;
    height: 74px;
    object-fit: contain;
}

.wcat-vehicle-icon { font-size: 30px; }

.wcat-vehicle-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.wcat-vehicle-text strong { font-size: 18px; line-height: 1.2; }
.wcat-vehicle-engine { color: #3d444b; font-size: 15px; }
.wcat-vehicle-meta { color: #6d757d; font-size: 13px; }

.wcat-vehicle-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.wcat-vehicle-button {
    padding: 9px 18px;
    border-radius: 24px;
    background: #83c320;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
}

.wcat-vehicle-button:hover { background: #74ae1c; }

.wcat-vehicle-clear {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #e0e4e8;
    border-radius: 50%;
    color: #6d757d !important;
    font-size: 17px;
    line-height: 1;
    text-decoration: none !important;
}

.wcat-vehicle-clear:hover { border-color: #c9ced4; color: #30363c !important; }

.wvc-model-count { color: #4f7a15 !important; font-weight: 600; }

/* --- Таб „OE номера" --- */
.wcat-oem-intro { color: #68717a; }

.wcat-oem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 0 24px;
}

.wcat-oem-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 2px;
    border-bottom: 1px solid #edf0f2;
}

.wcat-oem-brand { color: #68717a; font-size: 14px; }
.wcat-oem-number { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 600; }

@media (max-width: 700px) {
    .wcat-vehicle-bar { padding: 12px 14px; }
    .wcat-vehicle-photo .wcat-vehicle-image { width: 82px; height: 56px; }
    .wcat-vehicle-text strong { font-size: 16px; }
    .wcat-vehicle-actions { width: 100%; }
    .wcat-vehicle-button { flex: 1; text-align: center; }
}

/* --- W Catalog: марките като на startavto.com (десктоп), 2 на ред на телефон --- */
@container wvc-catalog (min-width: 700px) {
    .wvc-brand-grid .wvc-make-card {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
        min-height: 66px;
        padding: 8px 14px 8px 0;
        border: 1px solid #e6e8eb;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(28, 39, 49, .035);
        text-align: left;
    }

    .wvc-brand-grid .wvc-make-card:hover {
        border-color: var(--wvc-orange, #83c320);
        box-shadow: 0 7px 20px rgba(28, 39, 49, .1);
        transform: translateY(-2px);
    }

    .wvc-brand-grid .wvc-make-logo {
        flex: none;
        width: 106px;
        height: 48px;
        padding: 0 18px;
    }

    .wvc-brand-grid .wvc-make-logo .wvc-brand-image {
        width: 100%;
        height: 44px;
        object-fit: contain;
    }

    .wvc-brand-grid .wvc-brand-placeholder {
        width: 44px;
        height: 36px;
        font-size: 20px;
    }

    .wvc-brand-grid .wvc-make-name {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        font-size: 16px;
        line-height: 1.2;
    }

    .wvc-brand-grid .wvc-make-name strong {
        align-self: stretch;
        text-align: left;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .01em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wvc-brand-grid .wvc-make-count { margin: 0; font-size: 12px; }
}

.wvc-catalog .wvc-brand-grid.wvc-makes { --wvc-gap: 12px; gap: 12px; }

@media (min-width: 900px) {
    /* мин. ширина 230 px: 4 колони на широк екран, 3 на по-тесен */
    .wvc-catalog .wvc-brand-grid.wvc-makes { --wvc-gap: 30px; --wvc-card-min: 230px; row-gap: 12px; column-gap: 30px; }
}

/* Телефон: винаги по 2 карти на ред при марките и категориите. */
@media (max-width: 699px) {
    .wvc-catalog .wvc-makes { --wvc-card-min: 130px; }
    .wvc-makes .wvc-make-card { min-height: 132px; padding: 14px 8px 12px; }
    .wvc-makes .wvc-make-name { font-size: 14px; }
}

/* --- W Catalog: двигатели в лентата с автомобила (архив) --- */
.wcat-vehicle-engines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid #edf0f2;
}

.wcat-vehicle-engines > span { font-weight: 700; margin-right: 4px; }

.wcat-engine-chip {
    padding: 6px 12px;
    border: 1px solid #dfe3e7;
    border-radius: 20px;
    background: #fff;
    color: #343a40 !important;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none !important;
    white-space: nowrap;
}

.wcat-engine-chip:hover { border-color: #83c320; }
.wcat-engine-chip.is-active { border-color: #83c320; background: #83c320; color: #fff !important; }

/* --- W Catalog: лентата с автомобила на телефон --- */
.wcat-vehicle-engine-select { display: none; }

@media (max-width: 767px) {
    .wcat-vehicle-bar {
        gap: 10px;
        margin-bottom: 16px;
        padding: 12px;
        border-left-width: 3px;
    }

    .wcat-vehicle-main { gap: 12px; align-items: flex-start; width: 100%; }

    .wcat-vehicle-photo .wcat-vehicle-image { width: 72px; height: 50px; }

    .wcat-vehicle-text strong { font-size: 16px; }
    .wcat-vehicle-engine { font-size: 14px; }

    .wcat-vehicle-meta {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.4;
    }

    .wcat-vehicle-actions { width: 100%; margin: 0; gap: 8px; }
    .wcat-vehicle-button { flex: 1; padding: 9px 12px; text-align: center; font-size: 14px; }
    .wcat-vehicle-clear { flex: none; width: 36px; height: 36px; }

    .wcat-vehicle-engines { display: none; }

    .wcat-vehicle-engine-select {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 100%;
        margin: 0;
        padding-top: 10px;
        border-top: 1px solid #edf0f2;
        font-size: 13px;
        font-weight: 700;
    }

    .wcat-vehicle-engine-select select {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        border: 1px solid #dfe3e7;
        border-radius: 8px;
        background-color: #fff;
        font-size: 15px;
        font-weight: 400;
    }
}
