/**
 * Apimo Favorites - Styles
 */

/* ============================================
   BOUTON FAVORI (cœur)
   ============================================ */
.apimo-fav-btn,
.apimo-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.apimo-fav-btn:hover,
.apimo-heart:hover {
    background: #fff;
    transform: scale(1.1);
    color: #e74c3c;
}

.apimo-fav-btn.is-favorited,
.apimo-heart.is-favorited {
    background: #e74c3c;
    color: #fff;
}

.apimo-fav-btn.is-favorited:hover,
.apimo-heart.is-favorited:hover {
    background: #c0392b;
    color: #fff;
}

.apimo-fav-btn.is-loading,
.apimo-heart.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

.apimo-fav-icon {
    width: 18px;
    height: 18px;
}

/* ============================================
   COMPTEUR FAVORIS (header)
   ============================================ */
.apimo-fav-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apimo-fav-counter:hover {
    background: rgba(0, 0, 0, 0.05);
}

.apimo-fav-counter-icon {
    width: 18px;
    height: 18px;
}

.apimo-fav-counter-num {
    min-width: 18px;
    text-align: center;
}

/* Version avec badge */
.apimo-fav-counter.has-badge .apimo-fav-counter-num {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   PAGE FAVORIS
   ============================================ */
.apimo-fav-page {
    padding: 20px 0;
}

.apimo-fav-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 15px;
}

.apimo-fav-loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #eee;
    border-top-color: #3D5A40;
    border-radius: 50%;
    animation: apimo-spin 0.8s linear infinite;
}

@keyframes apimo-spin {
    to { transform: rotate(360deg); }
}

.apimo-fav-count {
    margin-bottom: 24px;
    font-size: 14px;
    color: #666;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.apimo-fav-empty {
    text-align: center;
    padding: 80px 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.apimo-fav-empty p {
    margin: 0 0 20px;
    color: #666;
    font-size: 16px;
}

.apimo-fav-browse-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #3D5A40;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.apimo-fav-browse-btn:hover {
    background: #2d4530;
    color: #fff;
}

.apimo-fav-login-hint {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #888;
    text-align: center;
}

.apimo-fav-login-hint a {
    color: #3D5A40;
    text-decoration: underline;
}

/* ============================================
   GRILLE FAVORIS
   ============================================ */
.apimo-fav-grid {
    display: grid;
    gap: 24px;
}

/* ============================================
   CARTE FAVORI
   ============================================ */
.apimo-fav-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apimo-fav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.apimo-fav-thumb {
    position: relative;
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}

.apimo-fav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.apimo-fav-card:hover .apimo-fav-thumb img {
    transform: scale(1.05);
}

.apimo-fav-thumb-ph {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
}

.apimo-fav-info {
    padding: 16px;
}

.apimo-fav-topline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.apimo-fav-loc {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.apimo-fav-price {
    font-size: 14px;
    font-weight: 600;
    color: #3D5A40;
    white-space: nowrap;
}

.apimo-fav-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.apimo-fav-title a {
    color: #222;
    text-decoration: none;
}

.apimo-fav-title a:hover {
    color: #3D5A40;
}

.apimo-fav-meta {
    font-size: 13px;
    color: #666;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .apimo-fav-btn,
    .apimo-heart {
        width: 32px;
        height: 32px;
    }
    
    .apimo-fav-icon {
        width: 16px;
        height: 16px;
    }
    
    .apimo-fav-info {
        padding: 12px;
    }
    
    .apimo-fav-title {
        font-size: 14px;
    }
    
    .apimo-fav-meta {
        font-size: 12px;
    }
}

/* ============================================
   INTÉGRATION AVEC CARTES EXISTANTES
   ============================================ */

/* Style pour .apimo-card (widget Elementor) */
.apimo-card .apimo-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: #999;
    text-decoration: none;
}

.apimo-card .apimo-heart:hover {
    background: #fff;
    transform: scale(1.1);
    color: #e74c3c;
}

.apimo-card .apimo-heart.is-favorited {
    background: #e74c3c;
    color: #fff;
}

/* Style pour .apm-feat-card (slider) */
.apm-feat-card .apimo-fav-btn {
    top: 10px;
    right: 10px;
    left: auto;
}

/* Animation d'ajout */
@keyframes apimo-heart-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.apimo-fav-btn.just-added,
.apimo-heart.just-added {
    animation: apimo-heart-pop 0.4s ease;
}

/* ============================================
   TOAST NOTIFICATION (optionnel)
   ============================================ */
.apimo-fav-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.apimo-fav-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.apimo-fav-toast.is-success {
    background: #3D5A40;
}

.apimo-fav-toast.is-error {
    background: #e74c3c;
}
