/**
 * WooCommerce Product Wishlist Styles
 */

/* Wishlist Icon on Product Loop */
.wishlist-icon-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.wishlist-icon {
    background: transparent !important;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: none;
}

.wishlist-icon:hover {
    background: transparent !important;
    transform: scale(1.1);
    box-shadow: none;
}

.wishlist-icon.in-wishlist {
    background: transparent !important;
}

.wishlist-icon.in-wishlist:hover {
    background: transparent !important;
}

.wishlist-icon svg {
    color: #000;
    transition: all 0.3s ease;
}

.wishlist-icon.in-wishlist svg {
    color: #ff0000;
    fill: #ff0000;
}

.wishlist-icon.adding {
    opacity: 0.6;
    pointer-events: none;
}

/* Make product loop items position relative for absolute positioning */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce-page ul.products li.product .woocommerce-loop-product__link {
    position: relative;
    display: block;
}

/* Single Product Page */
.wishlist-icon-single {
    position: relative;
    margin-bottom: 20px;
}

/* Wishlist Page */
.woo-wishlist-page {
    padding: 20px 0;
}

.woo-wishlist-page h2 {
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 600;
}

.wishlist-items-container {
    margin-top: 30px;
}

.wishlist-items {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.wishlist-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.wishlist-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wishlist-item-image {
    position: relative;
    overflow: hidden;
}

.wishlist-item-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.wishlist-item:hover .wishlist-item-image img {
    transform: scale(1.05);
}

.wishlist-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 14px;
    font-weight: bold;
    line-height: 18px;
    cursor: pointer;
    color: #000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
}

.wishlist-remove-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
}

.wishlist-item-details {
    padding: 12px;
}

.wishlist-item-title {
    margin: 0 0 8px;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 0.9em;
}

.wishlist-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 11px !important;
}

.wishlist-item-title a:hover {
    color: #000;
}

.wishlist-item-price {
    margin-bottom: 10px;
    font-size: 10px !important;
    font-weight: 600;
    color: #000;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.wishlist-item-price del {
    opacity: 0.5;
    margin-right: 0;
}

.wishlist-item-price ins {
    text-decoration: none;
}

.wishlist-item-actions {
    margin-top: 15px;
}

.wishlist-item-actions .button {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
}

.wishlist-item-actions .out-of-stock {
    display: block;
    color: #999;
    font-style: italic;
}

.wishlist-empty {
    text-align: center;
    padding: 60px 20px;
}

.wishlist-empty p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

/* Wishlist Loading State */
.wishlist-loading {
    text-align: center;
    padding: 60px 20px;
}

.wishlist-loading p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

/* Wishlist Menu Icon */
.wishlist-menu-icon {
    display: inline-block;
}

.wishlist-menu-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 5px;
}

.wishlist-menu-link:hover {
    opacity: 0.8;
}

.wishlist-menu-link svg {
    color: #000;
}

.wishlist-count {
    position: absolute;
    top: -5px;
    left: -10px;
    background: #D9534F;
    color: #fff;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    line-height: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .wishlist-items {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .wishlist-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .wishlist-item-details {
        padding: 12px;
    }

    .wishlist-item-title {
        font-size: 10px !important;
    }

    .wishlist-item-title a {
        font-size: 10px !important;
    }

    .wishlist-item-price {
        font-size: 9px !important;
    }

    .wishlist-remove-btn {
        width: 16px;
        height: 16px;
        font-size: 12px;
        line-height: 16px;
    }

    .woo-wishlist-page h2 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .wishlist-items-container {
        padding: 0 10px;
    }

    .wishlist-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .wishlist-item-details {
        padding: 10px;
    }

    .wishlist-item-title {
        font-size: 9px !important;
        margin: 0 0 8px;
    }

    .wishlist-item-title a {
        font-size: 9px !important;
    }

    .wishlist-item-price {
        font-size: 8px !important;
        margin-bottom: 10px;
    }

    .wishlist-icon {
        width: 32px;
        height: 32px;
    }

    .wishlist-icon svg {
        width: 18px;
        height: 18px;
    }

    .wishlist-remove-btn {
        width: 15px;
        height: 15px;
        font-size: 11px;
        line-height: 15px;
    }
}

/* Loading animation */
@keyframes wishlist-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.wishlist-icon.adding {
    animation: wishlist-pulse 1s ease-in-out infinite;
}

/* Smooth transitions for count updates */
.wishlist-count {
    transition: all 0.3s ease;
}

.wishlist-count.updating {
    animation: wishlist-pulse 0.5s ease-in-out;
}

/* Popup Notification */
.woo-wishlist-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #fff;
    color: #000;
    padding: 15px 30px;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    font-size: 15px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 90%;
    word-wrap: break-word;
    text-align: center;
}

.woo-wishlist-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 480px) {
    .woo-wishlist-popup {
        padding: 12px 25px;
        font-size: 14px;
        max-width: 85%;
    }
}
