/* Load after existing CSS. Bootstrap and your existing Font Awesome are reused.
   Place .vc-activity INSIDE .vc-product-media, after the stock badge.
   No display overrides on .d-none or JavaScript-controlled quantity elements. */
.vc-product-column {
    min-width: 0;
}

.productCards.vc-product-card {
    --vc-green: #248b35;
    box-sizing: border-box;
    height: calc(100% - 8px);
    min-height: 0;
    margin: 4px;
    padding: 0;
    border: 1px solid #e0e8df;
    border-radius: 14px;
    background: #fff;
    color: #192b20;
    box-shadow: 0 4px 16px #1a37200a;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.productCards.vc-product-card:hover {
    border-color: #a9c9a9;
    box-shadow: 0 8px 24px #1a372016;
}

.vc-product-card .vc-product-layout {
    height: auto;
    padding: 0 10px 10px;
}

.vc-product-card .vc-product-media {
    position: relative;
    margin: 0 -10px;
    overflow: hidden;
    background: #f5f7f2;
    aspect-ratio: .9;
}

.productCards.vc-product-card .vc-product-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    object-fit: cover;
}

.vc-product-card .vc-stock-badge {
    position: absolute;
    top: 7px;
    right: 7px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 7px;
    border: 1px solid #d7e8cf;
    border-radius: 7px;
    background: #f5ffed;
    color: #236b30;
    box-shadow: 0 2px 5px #00000008;
    font-size: 10px;
    line-height: 1.2;
}

.vc-product-card .vc-stock-badge strong {
    font-size: 12px;
}

.vc-product-card .vc-activity {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 0;
    margin-bottom: 6px;
    border-bottom: 1px solid #edf0e9;
    font-size: 10px;
    line-height: 1.4;
}

.vc-product-card .vc-activity>span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.vc-product-card .vc-remaining {
    color: #b34f26;
}

.vc-product-card .vc-sold {
    color: #43734b;
}

.productCards.vc-product-card .name.vc-product-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    height: auto;
    min-height: 2.6em;
    margin: 0 0 6px;
    padding: 0;
    background: none;
    color: #18281d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    word-break: normal;
    overflow-wrap: anywhere;
}

.productCards.vc-product-card .vc-price-row {
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 6px;
    padding: 0;
}

.productCards.vc-product-card .price {
    margin: 0;
    padding: 0;
    color: #207d30;
    background: none;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.productCards.vc-product-card .lot-qty-p {
    position: static;
    margin: 0;
    padding: 5px 7px;
    width: auto;
    height: auto;
    border: 1px solid #e2e8dc;
    border-radius: 6px;
    color: #58684c;
    background: #f5f7ef;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.vc-product-card .vc-cart-activity {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    margin: 0 0 6px;
    border-radius: 0;
    background: transparent;
    color: #816033;
    font-size: 10px;
    line-height: 1.4;
}

.vc-product-card .vc-cart-activity strong {
    color: #784515;
}

.vc-product-card .vc-actions {
    display: flex;
    align-items: stretch;
    gap: 7px;
}

.productCards.vc-product-card .vc-view-btn,
.productCards.vc-product-card .quick-add-btn.vc-add-btn {
    position: static;
    inset: auto;
    transform: none;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 42px;
    margin: 0;
    padding: 10px 6px;
    border: 1px solid #dce4da;
    border-radius: 9px;
    background: #f4f7f1;
    color: #3d5340;
    box-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
}

.productCards.vc-product-card .quick-add-btn.vc-add-btn {
    background: var(--vc-green);
    border-color: var(--vc-green);
    color: #fff;
}

.productCards.vc-product-card .quick-add-btn.vc-add-btn:hover {
    background: #1b7029;
}

.vc-product-card .vc-view-btn:hover {
    background: #e8efe3;
}

.vc-product-card .vc-view-btn i {
    margin-right: 3px;
}

.productCards.vc-product-card .modify-qty.vc-quantity-control {
    position: static;
    inset: auto;
    transform: none;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    min-height: 42px;
    margin: 0;
    padding: 3px;
    border: 1px solid #cddfc8;
    border-radius: 9px;
    background: #eff7eb;
    box-shadow: none;
    text-align: center;
}

.productCards.vc-product-card .vc-quantity-control p {
    display: inline-block;
    width: auto;
    min-width: 18px;
    margin: 0;
    padding: 7px 1px;
    color: #236b30;
    background: transparent;
    border: 0;
    font-size: 12px;
    line-height: 1.5;
}

.vc-product-card button:focus-visible {
    outline: 3px solid #248b35;
    outline-offset: -3px;
}

/* Image overlay: higher specificity keeps this consistent at all widths. */
.vc-product-card .vc-product-media .vc-activity {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 0;
    padding: 7px 9px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    pointer-events: none;
}

.vc-product-card .vc-product-media .vc-remaining,
.vc-product-card .vc-product-media .vc-sold {
    color: #fff;
    padding: 5px 7px;
    border-radius: 6px;
    background: rgba(18, 33, 23, .9);
}

.vc-product-card .vc-product-media .vc-remaining i {
    color: #ffb486;
}

.vc-product-card .vc-product-media .vc-sold i {
    color: #a5e5a2;
}

.vc-product-card .vc-product-media .vc-activity strong {
    font-weight: 750;
}

.vc-product-card .vc-product-media+.name.vc-product-name {
    margin-top: 9px;
}

@media (min-width: 768px) {
    .productCards.vc-product-card .name.vc-product-name {
        font-size: 14px;
    }
}

@media (max-width: 359px) {
    .productCards.vc-product-card {
        margin: 4px;
        border-radius: 13px;
        height: calc(100% - 8px);
    }

    .vc-product-card .vc-stock-badge span {
        font-size: 9px;
    }

    .vc-product-card .vc-stock-badge {
        top: 6px;
        right: 6px;
        padding: 6px;
    }

    .productCards.vc-product-card .price {
        font-size: 18px;
    }

    .productCards.vc-product-card .name.vc-product-name {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .productCards.vc-product-card {
        transition: none;
    }
}

/* Price and cart activity share one row; the badge text can wrap on phones. */
.productCards.vc-product-card .product-price-container.vc-price-row {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 9px;
}

.productCards.vc-product-card .vc-price-row .price {
    flex: 0 0 auto;
}

.productCards.vc-product-card .vc-price-row .vc-cart-activity {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 0 0 auto;
    padding: 5px 6px;
    border-radius: 6px;
    background: #f4f6f0;
    color: #46573f;
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
    justify-content: flex-end;
}

.productCards.vc-product-card .vc-price-row .vc-cart-activity i {
    flex-shrink: 0;
}

.productCards.vc-product-card .vc-price-row .vc-cart-activity span {
    min-width: 0;
}

.productCards.vc-product-card .vc-price-row .vc-cart-activity {
    background: #fff0f0;
    color: #b4232c;
    border: 1px solid #f5d0d3;
}

.productCards.vc-product-card .vc-price-row .vc-cart-activity i,
.productCards.vc-product-card .vc-price-row .vc-cart-activity strong {
    color: #c52232;
}

/* Mobile: clearer information hierarchy, compact secondary action.
   Keep the existing HTML and all JavaScript visibility hooks. */
@media (max-width: 767.98px) {
    .productCards.vc-product-card {
        height: auto;
        min-height: 0;
        border-color: #dce5d8;
        border-radius: 12px;
        box-shadow: 0 3px 10px #2237190a;
    }

    .vc-product-card .vc-product-layout {
        padding: 0 9px 9px;
    }

    .vc-product-card .vc-product-media {
        margin: 0 -9px;
        aspect-ratio: 3 / 4;
    }

    .vc-product-card .vc-stock-badge {
        top: 6px;
        right: 6px;
        padding: 5px 6px;
        gap: 3px;
        font-size: 11px;
        background: #fff;
        border-color: #d4e2cd;
        box-shadow: none;
    }

    .vc-product-card .vc-stock-badge span {
        font-size: 11px;
    }

    .vc-product-card .vc-stock-badge strong {
        font-size: 12px;
    }

    .vc-product-card .vc-activity {
        gap: 4px;
        padding: 7px 0;
        margin: 0 0 7px;
        font-size: 12px;
        line-height: 1.3;
    }

    .vc-product-card .vc-remaining {
        color: #a84420;
    }

    .vc-product-card .vc-sold {
        color: #365d3c;
    }

    .productCards.vc-product-card .name.vc-product-name {
        min-height: 0;
        height: auto;
        margin-bottom: 7px;
        font-size: 14px;
        line-height: 1.35;
        font-weight: 700;
        color: #18251c;
    }

    .productCards.vc-product-card .vc-price-row {
        gap: 4px 6px;
        margin-bottom: 5px;
    }

    .productCards.vc-product-card .price {
        font-size: 21px;
        line-height: 1.2;
    }

    .productCards.vc-product-card .lot-qty-p {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #4b5d46;
        font-size: 11px;
        font-weight: 600;
        box-shadow: none;
    }

    .vc-product-card .vc-cart-activity {
        margin-bottom: 8px;
        padding: 5px 6px;
        gap: 4px;
        border-radius: 5px;
        background: #f4f6f0;
        color: #46573f;
        font-size: 11px;
        line-height: 1.3;
    }

    .vc-product-card .vc-cart-activity strong {
        color: #243d23;
    }

    .vc-product-card .vc-actions {
        gap: 6px;
        align-items: stretch;
    }

    .productCards.vc-product-card .vc-view-btn,
    .productCards.vc-product-card .quick-add-btn.vc-add-btn {
        min-height: 30px;
        padding: 7px 5px;
        border-radius: 7px;
        font-size: 12px;
        line-height: 1.3;
    }

    .productCards.vc-product-card .vc-view-btn {
        flex: 0 0 38%;
        background: #fff;
        border-color: #d6dfd1;
        color: #40553b;
        min-width:78px
    }

    .productCards.vc-product-card .quick-add-btn.vc-add-btn {
        flex: 1 1 0;
        background: #248b35;
        border-color: #248b35;
        color: #fff;
    }

    .productCards.vc-product-card .modify-qty.vc-quantity-control {
        min-height: 36px;
        padding: 2px;
        align-items: center;
        justify-content: space-around;
        border-radius: 7px;
    }

    .productCards.vc-product-card .vc-quantity-control p {
        padding: 5px 0;
        min-width: 16px;
        font-size: 12px;
    }
}