.krf-products-widget {
    width: 100%;
}

.krf-products-widget .krf-products-grid,
.krf-products-widget .krf-products-grid.products {
    display: grid !important;
    grid-template-columns: repeat(var(--krf-products-columns, 4), minmax(0, 1fr)) !important;
    gap: 24px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    float: none !important;
    clear: both !important;
}

.krf-products-widget .krf-products-grid > li.product {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.krf-products-widget .krf-products-grid > li.product.krf-product-hidden {
    display: none !important;
}

.krf-products-widget__more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.krf-products-widget__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 28px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-family: Montserrat, Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.krf-products-widget__more:hover,
.krf-products-widget__more:focus {
    background: #1d4ed8;
    color: #fff;
}

.krf-products-widget__more:active {
    transform: translateY(1px);
}

.krf-products-widget__notice {
    padding: 16px 18px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #333;
    font-family: Montserrat, Inter, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .krf-products-widget .krf-products-grid,
    .krf-products-widget .krf-products-grid.products {
        grid-template-columns: repeat(var(--krf-products-columns-tablet, 2), minmax(0, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 640px) {
    .krf-products-widget .krf-products-grid,
    .krf-products-widget .krf-products-grid.products {
        grid-template-columns: repeat(var(--krf-products-columns-mobile, 1), minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

/* Keep add-on product cards visually identical to theme WooCommerce cards */
.krf-products-widget a.krf-product-card__button.button.added::after,
.krf-products-widget a.krf-product-card__button.button.is-added::after,
.krf-products-widget a.krf-product-card__button.added::after,
.krf-products-widget a.krf-product-card__button.is-added::after {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart {
    grid-template-columns: minmax(116px, 1.35fr) minmax(72px, .7fr) 40px !important;
    gap: 10px !important;
}

.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__button.is-added,
.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__button.added,
.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__button.button.is-added,
.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__button.button.added {
    min-width: 116px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 11px 10px !important;
    background: #2563eb !important;
    color: #fff !important;
    font-family: Montserrat, Inter, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 20px !important;
    white-space: nowrap !important;
    gap: 0 !important;
}

.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__button-plus {
    display: none !important;
}

.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .added_to_cart.wc-forward,
.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__view-cart {
    min-width: 72px !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 8px 6px !important;
    background: #f3f4f6 !important;
    color: #4b5563 !important;
    font-family: Montserrat, Inter, Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 13px !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: normal !important;
}

.krf-products-widget .krf-product-card__actions.krf-product-card__actions--in-cart .krf-product-card__favorite {
    grid-column: 3 !important;
}


/* YITH Wishlist inside Klimat RF products widget */
.krf-products-widget .krf-product-card__favorite--yith,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-add-to-wishlist,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-add-button,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-wishlistaddedbrowse,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-wishlistexistsbrowse {
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.krf-products-widget .krf-product-card__favorite--yith a,
.krf-products-widget .krf-product-card__favorite--yith button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 0 !important;
    text-decoration: none !important;
}

.krf-products-widget .krf-product-card__favorite--yith a::before,
.krf-products-widget .krf-product-card__favorite--yith button::before {
    content: '♡';
    font-family: Arial, sans-serif;
    font-size: 24px;
    line-height: 1;
}

.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-wishlistaddedbrowse a::before,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-wishlistexistsbrowse a::before,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-add-button.exists a::before,
.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-add-button.added a::before,
.krf-products-widget .krf-product-card__favorite--yith a.added_to_wishlist::before {
    content: '♥';
}

.krf-products-widget .krf-product-card__favorite--yith .yith-wcwl-icon,
.krf-products-widget .krf-product-card__favorite--yith .feedback,
.krf-products-widget .krf-product-card__favorite--yith .separator,
.krf-products-widget .krf-product-card__favorite--yith img,
.krf-products-widget .krf-product-card__favorite--yith span:not(.ajax-loading),
.krf-products-widget .krf-product-card__favorite--yith .ajax-loading {
    display: none !important;
}


/* Klimat RF custom YITH Wishlist button inside products widget */
.krf-products-widget .krf-product-card__favorite--yith-js {
    cursor: pointer;
}

.krf-products-widget .krf-product-card__favorite--yith-js.is-loading {
    opacity: .55;
    pointer-events: none;
}

.krf-products-widget .krf-product-card__favorite--yith-js.is-active {
    border-color: #ef4444;
    background: #fee2e2;
    color: #dc2626;
}

.krf-products-widget .krf-product-card__favorite--yith-js.is-active svg path {
    fill: currentColor;
}
