.ksf-favorite-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: #fff;
    color: #171717;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
    touch-action: manipulation;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}

/* No zoom on hover. The circle is filled instead. */
.ksf-favorite-button:hover {
    transform: none;
    background: #171717;
    border-color: #171717;
    color: #fff;
}

.ksf-favorite-button.is-favorite {
    color: #d22b2b;
    border-color: #d22b2b;
}

.ksf-favorite-button.is-favorite:hover {
    background: #d22b2b;
    border-color: #d22b2b;
    color: #fff;
}

.ksf-favorite-button.is-loading {
    opacity: .55;
    pointer-events: none;
}

.ksf-favorite-button:focus-visible,
.ksf-favorites-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* Force the Bootstrap heart glyph to sit exactly in the center. */
.ksf-favorite-button > i {
    width: 1em;
    height: 1em;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    pointer-events: none;
}

.ksf-favorite-button > i::before {
    display: block !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: 0 !important;
}

.ksf-favorite-button.ksf-position-absolute {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 12;
}

.ksf-favorite-button.ksf-position-inline {
    position: relative;
}

.ksf-menu-item {
    display: flex;
    align-items: center;
}

.ksf-favorites-link,
.header-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 3px !important;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #171717;
    text-decoration: none !important;
    line-height: 1;
    vertical-align: middle;
    transition: color .2s ease, background-color .2s ease,
                border-color .2s ease, box-shadow .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ksf-favorites-link-icon,
.header-action__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    line-height: 1;
    pointer-events: none;
}

.ksf-favorites-link-icon > i,
.header-action__icon > i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 23px !important;
    line-height: 1 !important;
    transition: color .2s ease;
}

.ksf-favorites-link-icon > i::before,
.header-action__icon > i::before {
    display: block !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: 0 !important;
}

.ksf-favorites-link .ksf-favorites-count,
.header-action__count {
    position: absolute;
    top: -3px;
    right: -3px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    min-width: 17px;
    height: 17px;
    min-height: 17px;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    border: 0;
    border-radius: 50%;
    background: #171717;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 17px !important;
    letter-spacing: 0;
    text-align: center;
    pointer-events: none;
    transition: background-color .2s ease;
}

.ksf-favorites-link:hover,
.ksf-favorites-link:focus-visible {
    color: #b7861f;
    background: #fff;
    border-color: rgba(183, 134, 31, .55);
    box-shadow: 0 5px 16px rgba(23, 23, 23, .12);
    outline: none;
    transform: none;
}

.ksf-favorites-link:hover .ksf-favorites-count,
.ksf-favorites-link:focus-visible .ksf-favorites-count {
    background: #b7861f;
}

.ksf-favorites-link.has-items .ksf-favorites-link-icon > i {
    color: #171717;
}

.ksf-favorites-link-label {
    line-height: 1.2;
}

.ksf-favorites-page {
    min-height: 120px;
}

.ksf-loading,
.ksf-error,
.ksf-empty {
    width: 100%;
    padding: 48px 20px;
    text-align: center;
}

.ksf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ksf-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ksf-spin .7s linear infinite;
}

.ksf-empty > i {
    display: block;
    margin-bottom: 12px;
    font-size: 42px;
}

.ksf-empty p {
    margin: 0 0 18px;
    font-size: 18px;
}

.ksf-products-wrapper .products {
    width: 100%;
}

/*
 * Favorites use the native Bootstrap grid. The plugin only adds the row
 * classes; column widths come from content-product.php or item_class in the
 * shortcode. No column count is fixed in CSS.
 */
#page-favorites,
#page-favorites .ksf-products-wrapper {
    width: 100%;
}

#page-favorites .products.row {
    display: flex !important;
    flex-wrap: wrap;
    padding: 0;
    list-style: none;
}

#page-favorites .products.row::before,
#page-favorites .products.row::after {
    display: none !important;
    content: none !important;
}

#page-favorites .products.row > * {
    float: none !important;
}

@keyframes ksf-spin {
    to {
        transform: rotate(360deg);
    }
}


@media (max-width: 767px) {
    .ksf-favorite-button {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .ksf-favorite-button.ksf-position-absolute {
        top: 12px;
        right: 12px;
    }

    .ksf-favorites-link {
        min-width: 34px;
        min-height: 34px;
    }

    .ksf-favorites-link-icon > i {
        font-size: 22px;
    }
}

/* ========================================================================
 * KULIK favorites product-card fallback
 *
 * The theme catalog styles are often scoped to #page-shop. Favorites are
 * rendered inside #page-favorites, so without these rules the two product
 * images are displayed one below another and the card badges stay in normal
 * document flow. These styles mirror the KULIK catalog card structure while
 * leaving Bootstrap row/column widths fully controlled by the shortcode and
 * the theme's content-product.php template.
 * ====================================================================== */
#page-favorites .products.row {
    align-items: stretch;
}

#page-favorites .products.row > * {
    min-width: 0;
}

/* Support both common structures:
 * 1) column wrapper > .product
 * 2) the product itself is the Bootstrap column
 */
#page-favorites .products.row > :not(.product) {
    display: flex;
}

#page-favorites .products.row > :not(.product) > .product,
#page-favorites .products.row > .product {
    width: 100%;
    height: 100%;
}

#page-favorites .product {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    border: 1px solid #d5dee7;
    border-radius: 1.5rem;
    background-color: #fff;
    color: #0f0f0f;
    text-decoration: none;
}

#page-favorites .product .right-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
}

#page-favorites .product .right-badges .add-to-compare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid #373737;
    border-radius: 50%;
    background-color: #fff;
    color: #373737;
    line-height: 1;
    text-decoration: none;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

#page-favorites .product .right-badges .add-to-compare:hover {
    border-color: #373737;
    background-color: #373737;
    color: #fff;
}

#page-favorites .product .right-badges .ksf-favorite-button {
    position: static;
    top: auto;
    right: auto;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
}

#page-favorites .product .left-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
}

#page-favorites .product .left-badges .discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: .25rem .45rem;
    border: 1px solid #c01600;
    border-radius: 999px;
    background-color: #c01600;
    color: #fff;
    line-height: 1;
}

#page-favorites .product .image {
    position: relative;
    display: block;
    width: 100%;
    height: 300px;
    flex: 0 0 300px;
    overflow: hidden;
    border-bottom: 1px solid #d5dee7;
    background: #fff;
}

#page-favorites .product .image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    backface-visibility: hidden;
    transition: opacity .3s ease;
}

#page-favorites .product .image .img-main {
    opacity: 1;
}

#page-favorites .product .image .img-hover {
    opacity: 0;
}

#page-favorites .product:hover .image .img-main,
#page-favorites .product .image:hover .img-main {
    opacity: 0;
}

#page-favorites .product:hover .image .img-hover,
#page-favorites .product .image:hover .img-hover {
    opacity: 1;
}

/* When a product has only one image, keep it visible on card hover. */
#page-favorites .product .image .img-main:only-child,
#page-favorites .product:hover .image .img-main:only-child {
    opacity: 1;
}

#page-favorites .product .data {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .35rem;
    width: 100%;
    min-width: 0;
    padding: 1rem 1rem 1.1rem;
    box-sizing: border-box;
}

#page-favorites .product .pre-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .15rem;
}

#page-favorites .product .pre-info .line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 24px;
    padding: .25rem .55rem;
    border-radius: .35rem;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
}

#page-favorites .product .pre-info .rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

#page-favorites .product .pre-info .rating .rate-stars {
    color: #373737;
    line-height: 1;
}

#page-favorites .product .pre-info .rating .count {
    color: #7a7a7a;
    text-decoration: none;
}

#page-favorites .product .sku {
    color: #373737;
    font-size: .9rem;
    line-height: 1.2;
}

#page-favorites .product .name {
    display: block;
    margin-bottom: 0;
    line-height: 1.05;
    text-decoration: none;
}

#page-favorites .product .name span {
    display: block;
    color: #0f0f0f;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

#page-favorites .product .configuration {
    min-height: 2.5em;
    color: #373737;
    font-size: .92rem;
    line-height: 1.35;
    letter-spacing: 0;
}

#page-favorites .product .info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: auto;
}

#page-favorites .product .price {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 0;
    line-height: 1;
}

#page-favorites .product .price del {
    color: #7a7a7a;
    font-size: 1rem;
    font-weight: 400;
    opacity: .9;
    text-decoration-color: #c01600;
    text-decoration-thickness: 1px;
    white-space: nowrap;
}

#page-favorites .product .price ins {
    color: #c01600;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

#page-favorites .product .price > .woocommerce-Price-amount,
#page-favorites .product .price > .amount {
    color: #0a8a25;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

#page-favorites .product .price .screen-reader-text {
    display: none;
}

#page-favorites .product .btn-catalog-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    min-width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 2.6rem;
    border: 1px solid transparent;
    border-radius: 50%;
    background-color: #0f0f0f;
    color: #fff;
    text-decoration: none;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

#page-favorites .product:hover .btn-catalog-more,
#page-favorites .product .btn-catalog-more:hover {
    border-color: #0f0f0f;
    background-color: #fff;
    color: #0f0f0f;
}

@media (max-width: 767.98px) {
    #page-favorites .product {
        border-radius: 1rem;
    }

    #page-favorites .product .image {
        height: 240px;
        flex-basis: 240px;
    }

    #page-favorites .product .data {
        padding: .85rem;
    }

    #page-favorites .product .right-badges,
    #page-favorites .product .left-badges {
        top: .75rem;
    }

    #page-favorites .product .right-badges {
        right: .75rem;
    }

    #page-favorites .product .left-badges {
        left: .75rem;
    }
}
