/* ═══════════════════════════════════════════════════════════════ */
/* ESTILOS — SISTEMA DE FAVORITOS                                */
/* ═══════════════════════════════════════════════════════════════ */

.btn-favorito {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #ef4444;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    flex-shrink: 0;
}

.btn-favorito:hover:not(.is-loading):not(:disabled) {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25);
}

.btn-favorito:active:not(.is-loading):not(:disabled) {
    transform: scale(0.95);
}

.btn-favorito svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ─────────────────────────────────────────────────────────────── */
/* Estado: Favorito agregado                                      */
/* ─────────────────────────────────────────────────────────────── */

.btn-favorito.is-favorited {
    background: #fef2f2;
    color: #dc2626;
}

.btn-favorito.is-favorited svg {
    fill: currentColor;
    stroke: currentColor;
}

.btn-favorito.is-favorited:hover:not(.is-loading):not(:disabled) {
    background: #fee2e2;
    color: #991b1b;
    transform: scale(1.15);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
}

/* ─────────────────────────────────────────────────────────────── */
/* Estado: Cargando                                               */
/* ─────────────────────────────────────────────────────────────── */

.btn-favorito.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
    animation: pulse-heart 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-heart {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* ─────────────────────────────────────────────────────────────── */
/* Estado: Deshabilitado                                          */
/* ─────────────────────────────────────────────────────────────── */

.btn-favorito:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────── */
/* Responsive                                                      */
/* ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .btn-favorito {
        width: 40px;
        height: 40px;
    }

    .btn-favorito svg {
        width: 20px;
        height: 20px;
    }

    .btn-favorito:hover:not(.is-loading):not(:disabled) {
        transform: scale(1.08);
    }

    .btn-favorito.is-favorited:hover:not(.is-loading):not(:disabled) {
        transform: scale(1.12);
    }
}

@media (max-width: 480px) {
    .btn-favorito {
        width: 38px;
        height: 38px;
    }

    .btn-favorito svg {
        width: 18px;
        height: 18px;
    }
}

/* ═══════════════════════════════════════════════════════════════ */
/* Dark Mode Support                                              */
/* ═══════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    .btn-favorito {
        background: rgba(30, 30, 30, 0.9);
        color: #fca5a5;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    .btn-favorito:hover:not(.is-loading):not(:disabled) {
        background: rgba(40, 40, 40, 0.95);
        box-shadow: 0 4px 16px rgba(252, 165, 165, 0.2);
    }

    .btn-favorito.is-favorited {
        background: rgba(127, 29, 29, 0.2);
        color: #fca5a5;
    }

    .btn-favorito.is-favorited:hover:not(.is-loading):not(:disabled) {
        background: rgba(127, 29, 29, 0.3);
        box-shadow: 0 4px 20px rgba(252, 165, 165, 0.15);
    }
}
