.cw-wishlist-wrapper {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 46px;
    line-height: 1;
}

button.cw-wishlist-btn {
    all: unset;
    box-sizing: border-box;
    position: relative;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background-color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
    z-index: 20;
}

button.cw-wishlist-btn:hover {
    background-color: #ffffff !important;
    transform: scale(1.07);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.23);
}

button.cw-wishlist-btn:focus-visible {
    outline: 2px solid #0353fa;
    outline-offset: 3px;
}

button.cw-wishlist-btn .cw-heart-icon {
    box-sizing: border-box;
    display: block;
    width: 23px;
    height: 23px;
    margin: 0;
    padding: 0;
    overflow: visible;
    fill: transparent;
    stroke: #e53935 !important;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition:
        fill 0.2s ease,
        stroke 0.2s ease,
        transform 0.2s ease;
}

button.cw-wishlist-btn.active .cw-heart-icon {
    fill: #e53935;
    stroke: #e53935 !important;
    transform: scale(1.06);
}

button.cw-wishlist-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

button.cw-wishlist-btn.loading .cw-heart-icon {
    animation: cw-heart-pulse 0.65s ease-in-out infinite alternate;
}

@keyframes cw-heart-pulse {
    from {
        transform: scale(0.88);
    }

    to {
        transform: scale(1.08);
    }
}

/* Desktop and tablet: tooltip opens to the left. */
.cw-tooltip {
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    bottom: auto;
    left: auto;
    transform: translateY(-50%) translateX(5px);
    min-width: max-content;
    padding: 7px 10px;
    border-radius: 5px;
    background-color: #111111;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
    z-index: 9999;
}

.cw-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    width: 0;
    height: 0;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #111111;
}

button.cw-wishlist-btn:hover .cw-tooltip,
button.cw-wishlist-btn:focus-visible .cw-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Elementor product image overlay. */
.cw-product-image-wrap {
    position: relative;
}

.cw-product-image-wrap > .elementor-widget-shortcode,
.cw-product-image-wrap > .e-con-inner > .elementor-widget-shortcode {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    max-width: 46px;
    margin: 0;
    z-index: 30;
}

.cw-product-image-wrap .elementor-shortcode {
    line-height: 1;
}

/* Wishlist page grid. */
.cw-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(var(--cw-columns, 4), minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

.cw-wishlist-item {
    position: relative;
    min-width: 0;
}

.cw-wishlist-item-content {
    height: 100%;
}

button.cw-remove-btn {
    all: unset;
    box-sizing: border-box;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff !important;
    color: #222222 !important;
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    font-weight: 300;
    cursor: pointer;
    z-index: 40;
    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}

button.cw-remove-btn:hover {
    background-color: #f3f3f3;
    transform: scale(1.06);
}

button.cw-remove-btn.loading {
    opacity: 0.55;
    pointer-events: none;
}

.cw-empty-wishlist {
    width: 100%;
    padding: 45px 20px;
    border-radius: 8px;
    background-color: #f7f8fa;
    color: #222222;
    text-align: center;
    font-size: 17px;
}

.cw-default-product-image {
    display: block;
    margin-bottom: 14px;
}

.cw-default-product-image img {
    display: block;
    width: 100%;
    height: auto;
}

.cw-default-product-title {
    margin: 0 0 9px;
    font-size: 18px;
    line-height: 1.35;
}

.cw-default-product-title a {
    color: inherit;
    text-decoration: none;
}

.cw-default-product-price {
    margin-bottom: 15px;
    font-size: 17px;
    font-weight: 600;
}

.cw-default-view-product {
    display: inline-flex;
    padding: 10px 16px;
    border-radius: 5px;
    background-color: #0353fa;
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 1024px) {
    .cw-wishlist-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile: tooltip opens above the heart. */
@media (max-width: 767px) {
    .cw-wishlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .cw-wishlist-wrapper,
    button.cw-wishlist-btn {
        width: 42px;
        min-width: 42px;
        max-width: 42px;
        height: 42px;
        min-height: 42px;
        max-height: 42px;
    }

    button.cw-wishlist-btn .cw-heart-icon {
        width: 21px;
        height: 21px;
    }

    .cw-tooltip {
        top: auto;
        right: auto;
        bottom: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%) translateY(5px);
    }

    .cw-tooltip::after {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: #111111;
    }

    button.cw-wishlist-btn:hover .cw-tooltip,
    button.cw-wishlist-btn:focus-visible .cw-tooltip {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .cw-wishlist-grid {
        grid-template-columns: 1fr;
    }
}
