/**
 * WooCommerce Favourites Widget - CSS
 * Version: 1.0.0
 */

/* ============================================
   Favourite Button on Product Pages
   ============================================ */
.wc-favourite-button-wrapper {
    margin: 15px 0;
}

.favourite-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.favourite-button:hover {
    background: #e74c3c;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.favourite-button i {
    font-size: 18px;
}

.favourite-button-active {
    background: #e74c3c;
    color: #fff;
}

.favourite-button-active:hover {
    background: #c0392b;
    border-color: #c0392b;
}

/* ============================================
   Floating Favourite Icon
   ============================================ */
.floating-favourite-icon {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #e74c3c;
    color: #fff;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: none; /* Hidden by default, shown as flex when active */
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
    font-size: 11px;
    line-height: 1.2;
}

.floating-favourite-icon.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.floating-favourite-icon:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.floating-favourite-icon i {
    font-size: 35px;
    margin-bottom: 2px;
}

.floating-favourite-icon .favourite-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
    display: none;
}

.floating-favourite-icon .favourite-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #fff;
    color: #e74c3c;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #e74c3c;
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.bounce-animation {
    animation: bounce 0.5s ease;
}

/* ============================================
   Favourite Message Notification
   ============================================ */
.favourite-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2ecc71;
    color: #fff;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    font-size: 14px;
    font-weight: 600;
    max-width: 300px;
}

.favourite-message.show {
    display: block;
}

/* ============================================
   Favourite Popout Panel
   ============================================ */
.favourite-popout {
    position: fixed;
    bottom: 30px; /* Same bottom position as icon */
    left: 110px; /* Position to the left of the icon (70px icon + 40px gap) */
    background: #fff;
    width: 375px;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 9999;
    overflow: hidden;
}

.favourite-popout.active {
    display: flex;
    flex-direction: column;
}

.favourite-popout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.favourite-popout-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.favourite-close-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.favourite-close-button:hover {
    color: #333;
}

#favourite-popout-container {
    padding: 15px 20px;
    overflow-y: auto;
    max-height: 350px;
}

.favourite-popout-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favourite-popout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.3s;
    gap: 10px;
}

.favourite-popout-item:hover {
    background: #e9ecef;
}

.favourite-popout-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.favourite-popout-item-image-placeholder {
    width: 50px;
    height: 50px;
    background: #ddd;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
}

.favourite-popout-item-content {
    flex: 1;
    min-width: 0; /* Allow text to wrap properly */
}

.favourite-popout-title {
    flex: 1;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favourite-popout-title:hover {
    color: #e74c3c;
}

.favourite-popout-item .favourite-delete-button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.3s;
}

.favourite-popout-item .favourite-delete-button:hover {
    color: #e74c3c;
}

.no-favourites {
    text-align: center;
    color: #999;
    padding: 30px 20px;
    font-size: 14px;
}

.favourite-popout-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.view-favourites-btn {
    display: block;
    text-align: center;
    background: #e74c3c;
    color: #fff;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.view-favourites-btn:hover {
    background: #c0392b;
    color: #fff;
}

/* ============================================
   Favourites List Page
   ============================================ */
.wc-favourites-list-page {
    padding: 20px 0;
}

.wc-favourites-list-page h2 {
    margin-bottom: 30px;
    font-size: 32px;
    color: #333;
}

#favourites_list_container {
    margin-top: 30px;
}

#no_favourites_message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

#no_favourites_message p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

#no_favourites_message .button {
    background: #e74c3c;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    font-weight: 600;
    transition: background 0.3s;
}

#no_favourites_message .button:hover {
    background: #c0392b;
}

.favourites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

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

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

.favourite-product-image {
    width: 100%;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.favourite-product-image-placeholder {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}

.favourite-product-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.favourite-product-title {
    margin: 0;
    font-size: 18px;
}

.favourite-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.favourite-product-title a:hover {
    color: #e74c3c;
}

.favourite-product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-product-btn {
    flex: 1;
    text-align: center;
    background: #e74c3c;
    color: #fff !important;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s;
}

.view-product-btn:hover {
    background: #c0392b;
}

.favourite-product-item .favourite-delete-button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #666;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.favourite-product-item .favourite-delete-button:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .floating-favourite-icon {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }
    
    .floating-favourite-icon i {
        font-size: 20px;
    }
    
    .floating-favourite-icon .favourite-label {
        font-size: 9px;
    }
    
    .favourite-popout {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 100px; /* Move above icon on mobile */
    }
    
    .favourites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .favourite-product-actions {
        flex-direction: column;
    }
    
    .view-product-btn {
        width: 100%;
    }
    
    .favourite-popout-item {
        flex-wrap: wrap;
    }
    
    .favourite-popout-item-image,
    .favourite-popout-item-image-placeholder {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .favourite-button {
        width: 100%;
        justify-content: center;
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .favourite-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .favourite-product-image,
    .favourite-product-image-placeholder {
        height: 150px;
    }
}