/**
 * IFS Wishlist Styles
 *
 * @package IFS_Wishlist
 */

/*--------------------------------------------------------------
# Wishlist Button (Product Cards)
--------------------------------------------------------------*/
/* When inside theme's action container, use static positioning */
.ifs-product-card__actions .ifs-wishlist-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
}

/* Base wishlist button styles */
.ifs-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ifs-wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ifs-wishlist-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.ifs-wishlist-btn.is-loading .ifs-wishlist-icon {
    animation: ifs-wishlist-pulse 0.5s ease infinite;
}

@keyframes ifs-wishlist-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.8);
    }
}

/* Icons */
.ifs-wishlist-icon {
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.ifs-wishlist-icon--filled {
    display: none;
    color: #e53935;
}

.ifs-wishlist-btn.is-active .ifs-wishlist-icon--empty {
    display: none;
}

.ifs-wishlist-btn.is-active .ifs-wishlist-icon--filled {
    display: block;
}

.ifs-wishlist-btn:hover .ifs-wishlist-icon--empty {
    color: #e53935;
}

/*--------------------------------------------------------------
# Wishlist Button (Single Product)
--------------------------------------------------------------*/
.ifs-wishlist-single-wrap {
    margin: 20px 0;
}

.ifs-wishlist-btn--single {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    height: auto;
    padding: 12px 20px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 0;
    box-shadow: none;
    gap: 8px;
}

.ifs-wishlist-btn--single:hover {
    transform: none;
    box-shadow: none;
    border-color: #1a1a1a;
}

.ifs-wishlist-btn--single .ifs-wishlist-btn__text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ifs-wishlist-btn--single.is-active {
    border-color: #e53935;
    background-color: #fef2f2;
}

.ifs-wishlist-btn--single.is-active .ifs-wishlist-btn__text {
    color: #e53935;
}

/*--------------------------------------------------------------
# Wishlist Page
--------------------------------------------------------------*/
.ifs-wishlist-page h2 {
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
}

/* Empty State */
.ifs-wishlist-empty {
    text-align: center;
    padding: 64px 24px;
    background-color: #fafafa;
    border-radius: 12px;
}

.ifs-wishlist-empty svg {
    color: #ccc;
    margin-bottom: 16px;
}

.ifs-wishlist-empty p {
    margin: 0 0 24px;
    font-size: 16px;
    color: #666;
}

/* Grid */
.ifs-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .ifs-wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ifs-wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Item */
.ifs-wishlist-item {
    position: relative;
    transition: opacity 0.3s ease;
}

.ifs-wishlist-item__image {
    position: relative;
    margin-bottom: 12px;
    background-color: #f5f5f5;
    aspect-ratio: 1;
    overflow: hidden;
}

.ifs-wishlist-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ifs-wishlist-item__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.ifs-wishlist-item:hover .ifs-wishlist-item__remove {
    opacity: 1;
}

.ifs-wishlist-item__remove:hover {
    background-color: #e53935;
    color: #fff;
}

.ifs-wishlist-item__details {
    text-align: center;
}

.ifs-wishlist-item__title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.ifs-wishlist-item__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.ifs-wishlist-item__title a:hover {
    text-decoration: underline;
}

.ifs-wishlist-item__price {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
}

.ifs-wishlist-item__price del {
    color: #999;
    font-weight: 400;
}

.ifs-wishlist-item__price ins {
    text-decoration: none;
    color: #e53935;
}

.ifs-wishlist-item__add-to-cart {
    width: 100%;
    padding: 10px 16px;
    font-size: 12px;
}

.ifs-wishlist-item__out-of-stock {
    display: inline-block;
    padding: 8px 16px;
    font-size: 12px;
    color: #999;
    background-color: #f5f5f5;
}

/*--------------------------------------------------------------
# Notification
--------------------------------------------------------------*/
.ifs-wishlist-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
}

.ifs-wishlist-notification.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ifs-wishlist-notification--success {
    background-color: #059669;
}

.ifs-wishlist-notification--error {
    background-color: #dc2626;
}

.ifs-wishlist-notification--warning {
    background-color: #d97706;
}

.ifs-wishlist-notification svg {
    flex-shrink: 0;
}

/*--------------------------------------------------------------
# Mobile Adjustments
--------------------------------------------------------------*/
@media (max-width: 768px) {
    .ifs-wishlist-btn {
        width: 32px;
        height: 32px;
    }

    .ifs-wishlist-btn svg {
        width: 16px;
        height: 16px;
    }

    .ifs-wishlist-item__remove {
        opacity: 1;
    }

    .ifs-wishlist-notification {
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
        text-align: center;
        justify-content: center;
    }

    .ifs-wishlist-notification.is-visible {
        transform: translateX(0) translateY(0);
    }
}
/* Wishlist Products in My Account - larger cards */
.ifs-wishlist-products.products {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 768px) {
    .ifs-wishlist-products.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
