/* Wishlist Button Styles */
.wc-wishlist-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: 10px;
    position: relative;
    transition: transform 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-wishlist-button:hover {
    transform: scale(1.1);
}

.wc-wishlist-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* === SVG Icon === */
.wc-wishlist-button .wishlist-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

/* === Неактивне серце (контурне) === */
.wc-wishlist-button .wishlist-icon path {
    stroke: #E97C3C;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

/* === Активне серце (додано до Wishlist) === */
.wc-wishlist-button.added .wishlist-icon path {
    fill: #E97C3C;
    stroke: #E97C3C;
}

/* === Анімація при додаванні === */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
}

.wc-wishlist-button.added {
    animation: heartBeat 0.6s ease-in-out;
}


/* Wishlist Link Styles */
.wc-wishlist-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.wc-wishlist-link:hover {
    opacity: 0.7;
}

.wc-wishlist-link-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-wishlist-link-icon svg {
    display: block;
}

.wc-wishlist-count {
    position: absolute;
    top: -2px; /* підняли вище, щоб було як у cart */
    right: -2px; /* вивели трохи за межі іконки */
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: #ff3d29;
    font-family: var(--font-family-base);
    color: #ffffff;
    font-size: 8px;
    line-height: 1;
    font-weight: 400;
    width: 13px;
    height: 13px;
    padding-bottom: 1px;
    overflow: hidden;
    z-index: 2; /* поверх SVG */
}

/* приховуємо, якщо лічильник порожній або 0 */
.wc-wishlist-count:empty,
.wc-wishlist-count[data-count="0"] {
    display: none;
}


.wc-wishlist-link-text {
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-wishlist-link-text {
        display: none;
    }
}

/* Loop button positioning */
.wc-wishlist-button-loop {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wc-wishlist-button-loop:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wc-wishlist-button-loop .wishlist-icon {
    width: 20px;
    height: 20px;
}

/* Ensure product has position relative for absolute positioning */
.products .product {
    position: relative;
}

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

.wc-wishlist-page h2 {
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 600;
}

.wc-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

.wc-wishlist-items .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.wishlist-item {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.wishlist-item a {
    text-decoration: none;
    color: inherit;
}

.wishlist-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

.wishlist-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #333;
}

.wishlist-item .price {
    font-size: 18px;
    font-weight: 700;
    color: #e74c3c;
    margin: 10px 0;
}

.wishlist-item .button {
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: auto;
}

.wishlist-item .button:hover {
    background: #000;
}

/* Notification Styles */
.wc-wishlist-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.wc-wishlist-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.wc-wishlist-notification-success {
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.wc-wishlist-notification-error {
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}


/* Responsive Styles */
@media (max-width: 768px) {
    .wc-wishlist-items .products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .wishlist-item {
        padding: 15px;
    }
    
    .wishlist-item h3 {
        font-size: 14px;
    }
    
    .wishlist-item .price {
        font-size: 16px;
    }
    
    .wc-wishlist-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .wc-wishlist-items .products {
        grid-template-columns: 1fr;
    }
    
    .wc-wishlist-button-loop {
        width: 36px;
        height: 36px;
    }
}

/* Animation for adding to wishlist */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
}

.wc-wishlist-button.added {
    animation: heartBeat 0.6s ease-in-out;
}

.wc-wishlist-button:focus,
.wc-wishlist-button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
